The MagSafe adapter in MacBooks and MacBook Pros is probably the greatest single advancement in laptop technology in the last 10 years. Interestingly, the MagSafe port is also a an analog volt meter that can be read by the OS, and it’s not just limited to monitoring battery voltage; with the right software, you can turn a MagSafe port into a terrible and expensive analog sensor, letting scripts on the computer run based on analog values.
[Peter] created a voltmeter application for his mac after realizing the System Management Controller – the chip responsible for charging the battery – was accessible through low-level kernel calls. If you care enough to chop an Apple power adapter in half, the MagSafe port can read other analog inputs.
The SMC Voltmeter app [Peter] wrote samples the voltage every second and displays values on a graph. This app also allows you to run scripts. While you won’t be able to do much with an extremely expensive, very slow, one-channel data logger (the battery is going to run down eventually), we’re sure we’ll see something that’s held together with duct tape and prayer that uses this weird tool.