Reading the undocumented MEMS accelerometer on Apple Silicon MacBooks via iokit

2026-02-205:0615461github.com

reading the undocumented mems accelerometer on apple silicon macbooks via iokit hid - olvvier/apple-silicon-accelerometer

More information: read the article on Medium

reading the undocumented mems accelerometer on apple silicon macbooks via iokit hid

demo

apple silicon chips (M1/M2/M3/M4) have a hard to find mems accelerometer managed by the sensor processing unit (SPU). it's not exposed through any public api or framework. this project reads raw 3-axis acceleration data at ~800hz via iokit hid callbacks.

only tested on macbook pro m3 pro so far - might work on other apple silicon macs but no guarantees

the sensor lives under AppleSPUHIDDevice in the iokit registry, on vendor usage page 0xFF00, usage 3. the driver is AppleSPUHIDDriver which is part of the sensor processing unit. we open it with IOHIDDeviceCreate and register an asynchronous callback via IOHIDDeviceRegisterInputReportCallback. data comes as 22-byte hid reports with x/y/z as int32 little-endian at byte offsets 6, 10, 14. divide by 65536 to get the value in g. callback rate is ~100hz

you can verify the device exists on your machine with:

ioreg -l -w0 | grep -A5 AppleSPUHIDDevice
git clone https://github.com/olvvier/apple-silicon-accelerometer
cd apple-silicon-accelerometer
pip install -r requirements.txt
sudo python3 motion_live.py

requires root because iokit hid device access on apple silicon needs elevated privileges

  • spu_sensor.py - the core: iokit bindings, device discovery, hid callback, shared memory ring buffer
  • motion_live.py - vibration detection pipeline, heartbeat bcg, terminal ui, main loop

the sensor reading logic is isolated in spu_sensor.py so you can reuse it independently

place your wrists on the laptop near the trackpad and wait 10-20 seconds for the signal to stabilize. this uses ballistocardiography - the mechanical vibrations from your heartbeat transmitted through your arms into the chassis. experimental, not reliable, just a fun use-case to show what the sensor can pick up. the bcg bandpass is 0.8-3hz and bpm is estimated via autocorrelation on the filtered signal

  • experimental / undocumented AppleSPU hid path
  • requires sudo
  • may break on future macos updates
  • use at your own risk
  • not for medical use
  • macbook pro m3 pro, macos 15.6.1
  • python 3.14

MIT

not affiliated with Apple or any employer


Read the original article

Comments

  • By seductivebarry 2026-02-207:385 reply

    Way back in ~2008 I wrote the Newton Virus https://www.everita.com/how-the-newton-virus-was-made + https://www.youtube.com/watch?v=eh75j6OHhRc (sorry for the broken images, need to update that site). Between that and using a hidden API to take screenshots of each individual element on your desktop (from icons, to taskbar, to windows) the effect was pretty believable. One of the most fun (and frustrating) projects I ever worked on.

    • By outadoc 2026-02-2013:22

      I've tried to find this for so long. I remember seeing it at the time as a teenager and thinking it was SO COOL. Basically made me discover Apple and want a Mac. :)

    • By directmusic 2026-02-2013:38

      When I saw the post the Newton Virus was the first thing I thought of. Thanks for making it. I remember showing my family the video and remarking about how cool it was.

    • By swiftcoder 2026-02-208:47

      Offtopic, but I have nostalgic feelings for the era of MacBook in the video

    • By tmslnz 2026-02-208:26

      Troika! Hello from a friend in London :)

    • By 486sx33 2026-02-2119:24

      [dead]

  • By krackers 2026-02-207:203 reply

    >have a hard to find mems accelerometer managed by the sensor processing unit

    How did OP even know that an accelerometer exists in the first place?

    • By rustyhancock 2026-02-207:312 reply

      The presence of the sensor is well documented as part of Apples Sudden Motion Sensor hard drive protection system.

      How to access it is undocumented.

      • By future10se 2026-02-207:432 reply

        Aaackshually, the Sudden Motion Sensor was introduced on 2005 in the PowerBook G4, and continued through the intel MacBooks with hard drives.

        While officially undocumented, people figured out how to access it back then, with novel uses like smacking your MacBook to change spaces (virtual desktops) or swinging the Mac around to make lightsaber noises.

        - https://www.youtube.com/watch?v=6uvQTTPr9Rw

        - https://osxdaily.com/2006/12/06/macsaber-turn-your-mac-into-...

        (I should know, I was in university back then and swung my Mac around like an idiot, lol.)

        On the first Retina MacBook Pro 15" in 2012, and moving forward with all MacBooks that were SSD-only, they removed the SMS as it was not needed.

        To my knowledge, this is the first time we're hearing that Apple Silicon machines have an accelerometer on the SoC, officially or otherwise. It's also certainly not branded or marketed as the SMS was. (https://support.apple.com/en-us/100871)

        Happy to be corrected on this!

        • By lelandfe 2026-02-2013:31

          In 2022 "a little birdy pointed out an accelerometer" to iFixit on their teardown of an M2 MBA: https://www.ifixit.com/News/62674/m2-macbook-air-teardown-ap...

          They could not figure out what it was for.

          Ars Technica commenters at the time believed it was to record drops so Apple repair teams could rebuff requests :)

        • By 1e1a 2026-02-2010:21

          I think there's some sort of motion sickness reducing feature in MacOS Tahoe which would require an accelerometer.

      • By nerdsniper 2026-02-207:521 reply

        Given that current drives don't have moving parts, what function is this serving today?

        • By juggerl6 2026-02-2010:541 reply

          [dead]

          • By nerdsniper 2026-02-2013:061 reply

            Has anyone reported this happening?

            • By xattt 2026-02-2018:22

              People who knew what they did aren’t going to go online and say that they tried to return a dropped device.

    • By argsnd 2026-02-208:501 reply

      Apple has a motion sickness mitigation feature that displays dots on your screen that move based on physical motion, so it’s fairly well known that the accelerometer exists.

      • By mschuster91 2026-02-2011:173 reply

        That's for iOS devices though

        • By Someone 2026-02-2014:32

          https://support.apple.com/en-om/guide/mac-help/mchla3c4f1da/...:

          “Vehicle Motion Cues

          Vehicle Motion Cues may help reduce vehicle motion sickness while using a Mac and riding as a passenger in a car or other on-road vehicle.

          To customize Vehicle Motion cues, click Customize Appearance, then set any of the following options:

          - Pattern: Select Regular for a stable and predictable pattern of onscreen dots, or Dynamic for a more engaging visual experience.

          - Color: Select a color of onscreen dots. Color saturation will automatically adjust to maintain contrast with the content behind each dot.

          - Larger dots: Turn on Large dots to increase the size of the dots that appear onscreen.

          - More dots: Turn on More dots to increase the number of dots that appear onscreen.

          Note: This option is available on Mac laptop computers. It’s not available on MacBook Air (M1) or 13-inch MacBook Pro (M1) or earlier.”

        • By angulardragon03 2026-02-2012:09

          It’s also for macOS

        • By nom 2026-02-2012:15

          No.

    • By saagarjha 2026-02-207:59

      > the sensor lives under AppleSPUHIDDevice in the iokit registry, on vendor usage page 0xFF00, usage 3. the driver is AppleSPUHIDDriver which is part of the sensor processing unit.

  • By userbinator 2026-02-207:144 reply

    undocumented

    The one thought that comes to mind is this: "Your warranty claim was denied because we determined that the laptop was subjected to a sudden shock."

    • By consp 2026-02-207:231 reply

      Back in the days this was to lock up the hard disk read/write head. Maybe a relic from those times instead?

      • By userbinator 2026-02-207:34

        Apple is not known for backwards-compatibility, and they were already using SSDs in their laptops long before switching to ARM.

    • By tpmoney 2026-02-2214:31

      From elsewhere in this discussion, it's likely for the motion sickness functionality they added in recent years: https://support.apple.com/en-om/guide/mac-help/mchla3c4f1da/...

    • By sysguest 2026-02-207:191 reply

      idk you can just use simple liquid-container or sticker?

      maybe apple was preparing for "carrying-around laptop experience"?

      • By XorNot 2026-02-207:251 reply

        That's an entirely different product build path compared to the electronics production line though.

        If a pick and place machine can drop it on and reflow it, that's what you want.

        • By sysguest 2026-02-207:45

          well it would be hardened when contact with air or something

          see "Shipping Damage Indicators"

    • By altairprime 2026-02-207:20

      Did it park the drive heads?

HackerNews