# How is the battery level calculated in the magic mouse?

I wonder how the battery level in the magic mouse is calculated.

This question about battery problems raised another one, I would like to know how the electronics in the magic mouse work and evaluate the remaining energy left as it seems quite inaccurate with some of my batteries.

If you don't know how the magic mouse does its calculation maybe you know how other electronic devices calculate the level?

I am no electrician and I have no skills in e- engineering. But maybe this image from iFixit might give a clue to a someone with the right knowledge (click the image for the original high-res version):

High res pictures available here if you need more details.

-
They should award a Nobel prize to the first guy who can correctly predict how much battery I have left in my devices... it always progresses like 90%... 85%... 75%... 35%... 15%...BEEP BEEP! – R. M. Apr 2 '12 at 20:54
@R.M I agree with you. And it would be nice to see more engineering nobels delivered too. Why is it that physics is always rewarded and engineering only barely makes the list from time to time? – Coyote Apr 2 '12 at 21:00

Generally the amount of energy left in a cell is related to its voltage at a given current draw, and the chemistry. For instance, AA Alkaline cells are about 1.62V new, and drop to 0.9V near the end of their life as they are depleted. Rechargeable cells often output 1.29V fully charged and will discharge to 0.9V.

Further, the voltage drops more with larger current draws, and this drop increases for cells that are near the end of their life. So if you turn off the mouse and test the voltage, then turn the mouse on and test for voltage, the second test will have a lower voltage. If that difference is small, the cell is near the beginning of its life. If the difference is large, the cell is near the end of its life.

There are ways to determine the battery chemistry with some level of confidence by performing a few tests, but generally there's no reason to. The majority of users merely need to have a little advance notice that their favorite iDevice is about to cease functioning so they can prepare.

So most such devices simply wait for the battery to drop below a specified voltage, before alerting the user. Since most batteries can be considered dead at 0.9 volts, and few batteries go lower than 1.2 volts when new, the simplest solution is to alert the user to a low battery condition at 1.0 or 1.1 volts.

When a user expects a battery bar that gives a relative measurement (3 boxes for full, 0 boxes for nearly dead) then it will generally show full until it gets below 1.2 volts.

So an alkaline battery will often show full until very close to the end of its life, then appear to die quickly. A rechargeable battery will show 3/4 full for most of its life, then die rapidly (due to the discharge curve being more flat than an alkaline, and being closer to the 1.0v cutoff).

The batteries you will have the most problem with are "heavy duty" which is code for "cheap, non-alkaline" batteries. They have their uses, but not in electronic devices. If you use the cheapest of the cheap AA batteries from the drugstore, or the "40 batteries for \$6.99" pack from woot, amazon, or [insert favorite membership club here] then you're very likely getting non-alkaline, "heavy duty" batteries. These cells have a very different, and much faster, discharge curve when used in most electronics, and you will see flakiness long before the battery is actually dead, and perhaps even before the mouse itself recognizes it's dead. The issue is that they can't supply the sudden bursts of power the radio in the mouse requires, so some transmissions are lost. When it's not transmitting, the voltage appears to be fine, but the difference between no load and an RF load causes the battery voltage to drop significantly simply because it wasn't designed to support those power draws.

This is why almost all electronic devices insist on "name brand alkaline" batteries. Rechargeable batteries work well for this type of use as well.

This article, "Does the battery fuel gauge lie?" is relevant to this discussion, though it mostly focuses on larger rechargeable batteries used in the iPad and similar devices. It discuses how smart battery electronics monitor and manage the charge and discharge of batteries in advanced electronic devices.

-
I am not going to destroy my magic mouse to find out the battery management chip it uses to see what capabilities it has, but if someone wants more info, send me a mouse I can destroy. iSuppli doesn't appear to have a chip breakdown for the magic mouse, and the ifixit photographs aren't sufficient to determine what chip it uses. – Adam Davis Apr 2 '12 at 21:11
This sounds like a good explanation to me... And yes I recognize the issues I get with some "Heavy Duty" batteries. Thank you for your time, but I won't be sending you the Magic mouse, although you will probably be getting a new iPad soon I see ;) – Coyote Apr 2 '12 at 21:27
I will keep the question open for some time, maybe someone with insight about the Mighty Mouse itself gets to tells more about it. – Coyote Apr 2 '12 at 21:53
"So an alkaline battery will often show full until very close to the end of its life, then appear to die quickly" That really helps. Thanks for it. And, the piece in the other post about rotating the batteries in place to get rid of possible corrosion. This has been frustrating me for a while now and I was about to order a new Magic mouse so thanks for helping me avoid that, for the time being. – Richard Apr 2 '12 at 22:00