How it's calculated
battery life (hours) = capacity (mAh) × usable % ÷ average current (mA)
Sleep modes make a huge difference
Many battery projects spend most of their time asleep, waking briefly to take a reading or send data. The average current is then:
average = active current × active fraction + sleep current × sleep fraction
A device that draws 80 mA while awake for 1% of the time, and 0.05 mA (50 µA) while asleep, averages 0.8 + 0.0495 ≈ 0.85 mA. On the same 2,500 mAh battery, that's around 2,350 hours, or about three months, instead of 40 hours.
Why real batteries fall short
- High currents reduce usable capacity, especially for alkaline and coin cells. A CR2032 is rated with a tiny current draw and delivers much less at tens of milliamps.
- Cold cuts capacity noticeably.
- Cut-off voltage: your circuit may stop working before the battery is truly empty.
- Self-discharge: batteries slowly lose charge even when unused, which matters over months and years.
- Regulators waste some energy, and some draw current all the time.
The capacity buttons above are typical ballpark figures. Check your battery's datasheet for the capacity at your actual current.