Articles / Embedded

  • batteries
  • fuel-gauge
  • hardware
  • right-to-repair
  • embedded
  • debugging

Why a New Phone Battery Shows the Wrong Percentage at First

You fit a brand new battery, the phone says 100%, and twenty minutes later it shuts off at 30%. Or it sits at 1% for an hour. The cell is usually fine; the thing that is wrong is the phone's idea of what the cell is.

A battery has no percentage sensor. Nothing in a lithium-ion cell can report "62% full". The number on screen is an estimate, and after a swap the estimate is built on the wrong cell.

The percentage is a guess made by a fuel gauge

A fuel gauge chip measures what it can: voltage, current and temperature. From those it estimates state of charge. There are two basic methods, and real gauges blend them.

  • Voltage lookup: map the resting cell voltage to a charge level using a curve. Cheap, but the curve is very flat in the middle, and it shifts with temperature, age and load.
  • Coulomb counting: integrate current in and out, like a bank balance. Accurate over short periods, but small measurement errors accumulate and never cancel.

Coulomb counting needs one number to turn "charge moved" into "percent": the full capacity of the cell. That number is not fixed. The gauge learns it.

What the gauge has learned belongs to the old cell

Over months, the gauge updates its stored capacity as the cell ages, and often an estimate of internal resistance too. Those learned values live in non-volatile memory, either in the gauge chip, or in the host's software, depending on the design.

Swap the cell and the stored numbers describe a battery that is no longer there. The new cell has more capacity and lower resistance than the worn one, so every calculation is off.

A worked example, with made-up round numbers:

  • The old cell has faded to 3000 mAh, so the gauge has learned 3000.
  • The new cell is really 4500 mAh.
  • You charge 1500 mAh into it. The gauge says 50%. The true figure is about 33%.
  • The charger then reaches its end-of-charge condition and the gauge snaps to 100%, so the percentage jumps around rather than drifting smoothly.

Going the other way, the gauge thinks 3000 mAh is "everything", so it reaches 0% after using two thirds of the new cell. You see odd results on the way down instead: stalls, sudden drops, or a refusal to shut off.

Quick detour: why resistance matters too

Actually, this bit is interesting. A worn cell has higher internal resistance, so under load its voltage sags. Gauges that model this use the sag to work out how much charge is left at a given load.

If the gauge still carries a high resistance figure from the old cell, it sees a healthy voltage under load and concludes it is lower than it should be, or applies the wrong cut-off. The new cell is better than the model, and the model punishes it for that.

What "calibration" really means here

The folk remedy is "drain it to zero, charge to 100%, repeat three times". There is a grain of truth in it: a gauge learns capacity by observing a clean, long charge or discharge between two known points. It does not need your ritual, though.

The gentler, usually sufficient version:

  1. Charge to full on a normal charger, and leave it plugged in for a while after it says 100%, so the charge taper finishes and the gauge sees a real full point.
  2. Use the phone normally down to a low level, without topping up halfway.
  3. Charge to full again, uninterrupted.

Some gauge designs also want the cell to rest, with no load, so the voltage settles and a clean reading can be taken. That is one reason leaving the phone idle on the charger can help.

Things that are folklore

Deep discharge is not a good idea on lithium-ion cells, and a gauge relearn does not require it. Running a cell flat repeatedly adds wear and can trip protection circuits.

Deleting a battery statistics file on Android, a tip you will see everywhere, does not reset the fuel gauge. That file is the operating system's usage accounting. The gauge is a separate piece of hardware or firmware with its own memory.

When it does not come right

If the percentage is still wrong after two or three full cycles, the cause is probably not calibration.

  • The gauge is in the old battery's pack, or is paired to it, and the replacement lacks matching data or a genuine gauge. Some manufacturers tie the battery to the board, which is a separate argument from the calibration one.
  • The replacement cell is lower quality than its label claims, and its true capacity is below the figure printed on it.
  • The gauge firmware has no learning cycle the user can trigger, so it relearns slowly over weeks.

Behaviour differs a lot between models and I have not tested this across devices, so treat the steps above as the common pattern rather than a guarantee. A good sign is that the percentage stops jumping and the 100% to 0% runtime starts to look believable.

The wider lesson

This is a nice example of state that lives outside the thing you replaced. The part is new, the memory about the part is not. Anywhere hardware carries learned data, a swap needs a story for what happens to it, and in most phones that story is simply "the gauge works it out eventually".