Did you know your MacBook has a sensor that knows the exact angle of the screen hinge?

It’s not exposed as a public API, but I figured out a way to read it and make it sound like an old wooden door.

Source code and a downloadable app to try it yourself: https://github.com/samhenrigold/LidAngleSensor

I have so much free time it’s unbelievable. I’m open to full-time work in NYC or remote. Senior product designer/design engineer. https://samhenri.gold
Sam Henri Gold

Sam Henri Gold is a product design engineer building playful, useful software.

@samhenrigold for this precious & perfect magic that you have bestowed upon us, may your dream job be just around the corner (or working remotely). thank you. :)

@kathimmel @samhenrigold

☝️ ☝️ ☝️ ☝️ 💯

@samhenrigold
(Plays video)
“What’s that??”
“Theremin.”
“What’s that?!”
“Theremin.”
“WHAT’S THAT?!”
“A musical instrument.”
“Is that your phone?!?!”
“Yes.”
“Don’t give me weird answers. Just say it’s your phone.”
@joesteel oh you’re better than me, i would’ve totally escalated “WHAT’S THAT” with a louder “THEREMIN”
@samhenrigold very cool, and I also predict a lot of broken screen hinges in the future
@samhenrigold how much have you ruined your hinge testing this
@willhbr i didn't buy applecare just to NOT fuck up the hinge
@samhenrigold "honestly Tim it was like that when I bought it, please don't look my my mastodon"
@samhenrigold @kf nice - just in time for spooky season!
@kboyd @samhenrigold @kf it's a pumpkin spice hinge hack!
@samhenrigold hehehe, I'd love to have it on my Linux laptop 😄 😂
@justbob @samhenrigold lmfao, mine is so old, I don't even need an app for the sound

@utf_7 @samhenrigold

😂 I can relate. Some of the "old" systems that I've rebuilt into non Microsoft systems...

@samhenrigold this brings joy to my day 🥰
@samhenrigold I have an idea! You could have it scrub the startup chime based on the angle, which would be fun while opening and shutting it, but you could also work it like a turntable
@rezmason @samhenrigold my idea was a version of pacman where you have to "munch" to move
@samhenrigold I want to hear this sentence said about a lot more situations
@samhenrigold hinge replacement rates explode 100x in the next few months
@samhenrigold I love this so much...

@samhenrigold Awesome discovery, this is even working on the Web via the WebHID API (chromium based browsers only)

https://vnjlhn.csb.app/

(Just displaying the value no fancy sounds)

WebHID Demo - Lid Tilt

@samhenrigold if I had macbook I wouldnt be able to focus Id be just messing around with the sounds and how long would the hinges last  good stuff you have created 
@samhenrigold Now I think that one is why Apple doesn't exposes it, imagine the amount of entirely used up hinges due to people playing with the lid.

@samhenrigold
And when your LCD fails, you need to replace the entire screen assembly, including hinges and sensor.

Sensor need calibration to know the angle (which was not needed on previous macbooks, that had a dumb Hall effect sensor, and a magnet).

Apple never made this calibration tool available to unofficial repair shops...

So the macbook repair community did one themselves :
https://github.com/Vladislav98759/Macbook-Lid-Angle-Sensor-Calibration-Tool

@samhenrigold great for watching vintage Dr. Who, even if it’s a bit difficult to actually see the screen.
@samhenrigold angle for pitch, and then light- or temperature-sensor for volume? (or vice versa)
@samhenrigold This is a fun little app. Thanks for sharing.
@samhenrigold this should be combined with the pressure sensor in the trackpad for the Theremin’s second degree of control so you can use *two* undocumented sensors.
@samhenrigold I wonder whether "I wanted to play the Doctor Who theme" would be a reasonable explanation when my boss asks why my work laptop is broken ​
@samhenrigold This is the missing piece for a good laptop-accordion! https://www.instagram.com/p/DIuATrQI-Hk/
Anatole Muster on Instagram: "come see us live in london 👨🏼‍💻 may 15 @thejazzcafe it's my album release show #laptop #logicprox with my 🐕's @king.ie 🥁 and @hugo_piper on bass 🎥 @will.rhodeo"

8,284 likes, 133 comments - anatolemuster on April 21, 2025: "come see us live in london 👨🏼‍💻 may 15 @thejazzcafe it's my album release show #laptop #logicprox with my 🐕's @king.ie 🥁 and @hugo_piper on bass 🎥 @will.rhodeo".

Instagram
@T_X @samhenrigold Nice. That could even be a theremin where one can hold a tone. How would we do volume ;) ?
@kellertuer @samhenrigold two MacBooks maybe :D? I'm wondering if that could be done via #MIDI over #Ethernet or MIDI over #RTP (or does MIDI over X expect both the tone and volume to come from the same source? is MIDI even suitable for an analog pitch?)
@samhenrigold I fucking love this
why does it want to be a keylogger, but then still works without that permission
@grishka earlier explorations I forgot to scrape out
@grishka i’ll get to this the next time I get up but right now I’m laying down on the floor since my back hurts

@grishka figured it out. the documentation is kinda crummy but I had to preemptively search for the angle sensor and open it (rather than opening everything and searching for it after the fact) https://bugs.winehq.org/show_bug.cgi?id=50153

I think it's fixed now in the new release but lmk to confirm

Making sure you're not a bot!

@samhenrigold Apple Store employees are supposed to set up laptops with a specific screen angle. I wouldn't be surprised if the sensor exists entirely for that reason.
@cinebox @samhenrigold That would be costly, when they could just give everyone a precut piece of angled plastic to hold between the keyboard and screen on setup.
@macinthrope @samhenrigold I believe the previous solution was an iphone app they held against the screen that changed color when at the right angle
@cinebox @samhenrigold you would think they would use like a modified set square or something
@samhenrigold huh, i don't remember seeing this in the device tree...

@mildsunrise it doesn't have a name or anything, so it's pretty well hidden. I only found it while disassembling relatived.

`hidutil list --matching '{"VendorID":0x5ac,"ProductID":0x8104,"PrimaryUsagePage":32,"PrimaryUsage":138}'`

@samhenrigold ah it's a USB device, that explains it doesn't appear on the device trees. lemme see if I have it on my M3 Pro one
@samhenrigold it's apparently behind the AOP