The lid angle sensor is also serialized to the motherboard: you cannot replace it, or the motherboard, without performing calibration, which can be performed by an apple authorized service provider, or alternatively, in Europe (and elsewhere where Apple offers parts for self-service repair), you can purchase the sensor from Apple, connect the machine to the internet after replacing it, to then perform the calibration, only if the sensor was purchased from Apple.
So the hardware is capable of performing the calibration, Apple just does not graciously grant you the right to install a recycled or third party sensor in your machine.
To those wondering why the MacBook would have a sensor for this, it’s likely there to support Desk View[0]. It shows the items on your desk in a geometrically correct, top-down view. Knowing the angle of the display is very helpful when applying keystone correction.
The sensor angle would be in a file like `/sys/bus/iio/devices/iio:device*/in_angl0_raw` (device number can vary). At least I have this in a config file and remember it working (maybe on a different computer?). I cannot get it to work anymore on my laptop.
I wonder why? Presumably this information doesn't come for free, and Apple spends money to put this sensor in.
Is it a backup if the magnet for closed lid detection fails? Is it some kind of input for the brightness sensor or True Tone? Is it for warranty investigation, that if the hinge breaks they can figure out if it was physically pushed too far, or was repeatedly slammed open and shut like a toy?
Apple is going to see an increase in MacBook Pro hinges breaking from people trying to play the Star Trek theme in theremin mode or other songs with other instrument sounds.
Apple: How did the hinge break?
Customer: I don’t know, I just opened it one day and it came off.
You could use that to display some kind of billboard affect, so that an image is always in a correct aspect ration to the observer in front :D Please could someone with a macbook do this and post a video here? :D
Great! so they already know that I've been squinting at a 42deg gap trying to use my old MBP. The year with the faulty designed screen connector which was only covered for replacement on certain models, not mine. I wonder if that is why they added this, to check for 'holding the lid wrong'. If I open it any further I need a reboot to get the display back, oh and that angle decreases over time.
I wouldnt mind but I was 95% of the time clamshell, and still the keyboard made from butterflies wings lasted next to no time, and the battery put on too much weight after only 30 something cycles. After all these years I never understand how they produce such lemon models some years, just trying to save a few cents here and there. The one before was thermal paste nvidia meltdown.
The most interesting takeaway from this project and the Mac touchpad actually measuring it's pressure in grams[1] is how Apple seems to prioritise it's ability to deliver new features in later software releases rather than their BOM.
I work in the automotive industry, and for volume products the price-cutting is really brutal. If you can save a cent somewhere you will, because that cent multiplied by 8 million cars a year is a sizeable amount of money.
This seems to be generally true for most OEMs of hardware products, but not for Apple. Apple could have cut costs by just using a magnet and a reed switch/hall effect sensor, because it is not using the exact angle of the screen anyway (afaik?), but they chose not to.
They could have implemented their "3d Touch" by using a simpler circuit which just indicates if the press was really hard or soft. But again they chose not too.
And they sell over 20 million Macs per year, so they really sacrifice a sizeable amount of profit
I learned of the lid angle sensor due to my MBP draining its battery. Whenever I flew across the country I'd always end up with a dead battery. Originally thought it was some process preventing sleep but was spinning circles hunting it down until one night, I closed the laptop... the screen turned off as it was closing and just as it shut.. you could see the faint glow of the screen turning back on again. If I cracked the lid open 1/8th of an inch it would turn off again.
I had thought that the MBP (an Intel one) had used magnets to detect lid closure but alas that's when I learned of the lid angle sensor and all the symptoms I was experiencing made sense. Basically the laptop would wake up when shut and the screen would stay on the entire time thus draining the battery.
Ended up getting the LAS replaced which was not DIY'able unfortunately... but was a relatively cheap fix (~$90).
A lot of foldables have a hinge angle sensor - it's actually a public API in Android, and robust enough that we use it to detect whether a device is a foldable:
There was a sensor where it would detect when you slapped the side of the screen, and a guy wired it up so when you did that it shifted to the next space (virtual desktop).
Reminds me of a "stable window" app gadget from mid-2000's that used the built-in accelerometer to make a window stable irrespectively of laptop's tilt.
As someone who recently wrecked their MacBook's screen by leaving something hard and pointy in between keyboard and screen when closing the lid, I wonder if one can turn on the webcam briefly before the lid closes and sound an alarm if it detects anything in the way.
Microsoft has had this in their Surface Book. It has a screen that could detach and be used as a table, which had an accelerometer in it that could measure the angle.
Does anyone know if this is used by any program to check if you are actually looking at the screen? I could imagine it being used for some blackmirror type stuff
my guess: probably there to support the camera system and depth camera.
although unless there's some sort of angle measurement with respect to the ground in the base, i'm not sure what it would be useful for. maybe to provide continuity for the depth camera when the lid angle is changing (without heavy duty estimation calculations).
It would be cool if the Macbook can figure out the relative position of a newly connected external monitor. It would help in setting up the monitor with little manual adjustments.
Since covid, we no longer have assigned desks at work --- it's first come, first served. And while most are respectful of the desks we have "chosen" for ourselves, every once in a while, I'll have to sit at some other, often new desk. And that means my laptop will not recognize the monitor and that I'll have to configure it (scaling, relative position, etc).
And Windows being the mediocre OS that it is, will always select to duplicate the screens even though the logical choice is to extend. My laptop screen and the external monitor aren't even the same aspect ratio. SMH.
At least Macs have the sense to extend screens by default. Though, if I could place a Macbook on the desk, plug in the external monitor, tilt the screen back until the camera can see the monitor, the hinge sensor and cameras can work together to figure out where the monitor is relative to the laptop, and automatically determine the right settings for the monitor instead of requiring my intervention.
This post was also made (by the same person, it seems) on Mastodon: https://hachyderm.io/@samhenrigold/115159295473019599 — which has the added benefit of not being X, not requiring cookies, and has more information than the tweet, including a follow-up "theremin" hinge.
Classic Apple overengineering. Every other laptop I know of just uses a single lid switch. It reminds me of their mouse that has capacitive buttons and a speaker to produce clicking sounds.
And also it has a magnet to detect the lid being closed. People think this is over engineered, but I've yet to see another brand that has a working closed lid detection
Yea this is how the new Apple silicon devices will start if they are off. The fingerprint sensor is just used to manually do it or override the current state / put it into recovery mode.
The MacBook has a sensor that knows the exact angle of the screen hinge
(twitter.com)1014 points by leephillips 7 September 2025 | 487 comments
Comments
So the hardware is capable of performing the calibration, Apple just does not graciously grant you the right to install a recycled or third party sensor in your machine.
https://www.ifixit.com/Answers/View/759262/Torn+Lid+angle+se...
0: https://support.apple.com/en-us/121541
https://www.phoronix.com/news/Intel-Hinge-Driver-Linux-5.12
The sensor angle would be in a file like `/sys/bus/iio/devices/iio:device*/in_angl0_raw` (device number can vary). At least I have this in a config file and remember it working (maybe on a different computer?). I cannot get it to work anymore on my laptop.
https://nime.org/proc/meacham2016/index.html
I wonder if Apple uses this internally at Apple stores to set the screen angle at 76 degrees.
Is it a backup if the magnet for closed lid detection fails? Is it some kind of input for the brightness sensor or True Tone? Is it for warranty investigation, that if the hinge breaks they can figure out if it was physically pushed too far, or was repeatedly slammed open and shut like a toy?
Apple: How did the hinge break?
Customer: I don’t know, I just opened it one day and it came off.
Author can submit this to the AppStore.
I wouldnt mind but I was 95% of the time clamshell, and still the keyboard made from butterflies wings lasted next to no time, and the battery put on too much weight after only 30 something cycles. After all these years I never understand how they produce such lemon models some years, just trying to save a few cents here and there. The one before was thermal paste nvidia meltdown.
I work in the automotive industry, and for volume products the price-cutting is really brutal. If you can save a cent somewhere you will, because that cent multiplied by 8 million cars a year is a sizeable amount of money.
This seems to be generally true for most OEMs of hardware products, but not for Apple. Apple could have cut costs by just using a magnet and a reed switch/hall effect sensor, because it is not using the exact angle of the screen anyway (afaik?), but they chose not to.
They could have implemented their "3d Touch" by using a simpler circuit which just indicates if the press was really hard or soft. But again they chose not too.
And they sell over 20 million Macs per year, so they really sacrifice a sizeable amount of profit
[1] https://news.ycombinator.com/item?id=44635808
I had thought that the MBP (an Intel one) had used magnets to detect lid closure but alas that's when I learned of the lid angle sensor and all the symptoms I was experiencing made sense. Basically the laptop would wake up when shut and the screen would stay on the entire time thus draining the battery.
Ended up getting the LAS replaced which was not DIY'able unfortunately... but was a relatively cheap fix (~$90).
https://source.android.com/docs/core/interaction/sensors/sen...
Probably a nicer interface for anyone who wants to play with this :)
There was a sensor where it would detect when you slapped the side of the screen, and a guy wired it up so when you did that it shifted to the next space (virtual desktop).
> Jacket zipper
> C Major scale
> Slide whistle
> Washboard
> Airlock
> Vinyl record scratch
although unless there's some sort of angle measurement with respect to the ground in the base, i'm not sure what it would be useful for. maybe to provide continuity for the depth camera when the lid angle is changing (without heavy duty estimation calculations).
Since covid, we no longer have assigned desks at work --- it's first come, first served. And while most are respectful of the desks we have "chosen" for ourselves, every once in a while, I'll have to sit at some other, often new desk. And that means my laptop will not recognize the monitor and that I'll have to configure it (scaling, relative position, etc).
And Windows being the mediocre OS that it is, will always select to duplicate the screens even though the logical choice is to extend. My laptop screen and the external monitor aren't even the same aspect ratio. SMH.
At least Macs have the sense to extend screens by default. Though, if I could place a Macbook on the desk, plug in the external monitor, tilt the screen back until the camera can see the monitor, the hinge sensor and cameras can work together to figure out where the monitor is relative to the laptop, and automatically determine the right settings for the monitor instead of requiring my intervention.
Why does it say it's by Lisa?
I signed up for my developer account when I was a kid, used my mom's name, and now it's stuck that way forever and I can't change it. That's life.
Apple has a _lot_ of catching up to do.