100nF

Battery runtime

How long a cell lasts when the device mostly sleeps and occasionally wakes: the time-weighted average current, what self-discharge adds, and the runtime from the capacity you can actually use.

avg 171.6 µA20.0 mA for 0.5 ssleep 5.0 µAt → 120 s
Fig 1 — Average 171.6 µA over a 60 s cycle; 44 days of runtime.
Runtime
43.6 days (1047 h)
Average load
172 µA
Duty cycle
0.833 %
Self-discharge, as a current
308 nA (0 % of drain)
Usable capacity
180 mAh
Sleep share of load
3 %

20 mA pulses exceed what a CR2032 lithium coin delivers comfortably (3.00 mA). Pulses over ~10 mA sag badly; add a 100 µF or bigger capacitor for radio bursts.

What it computes

A two-state load: the device sleeps at Isleep, wakes every Tperiod for tactive at Iactive, goes back to sleep. The average current is the time-weighted mean of the two states. Self-discharge is folded in as a third, parallel drain, expressed as the current that would empty the same fraction of the cell in a month. Runtime is the usable capacity divided by the total.

D        = t_active / T_period                 duty cycle
I_avg    = I_active · D + I_sleep · (1 − D)
I_self   = C_nom · (SD% / 100) / 730.5 h        self-discharge as a current
I_total  = I_avg + I_self
C_usable = C_nom · usable fraction
t        = C_usable / I_total                  hours; /24 for days, /8766 for years

The chemistry presets fill in the self-discharge figure and carry a continuous-current limit the tool warns against but does not model. Nothing about the cell's voltage curve, its internal resistance, or temperature is in the arithmetic; those go into the usable fraction, and that is the number you should be least confident about.

Worked example

A BLE sensor on a CR2032: 225 mAh, 80 % usable, 5 µA asleep, 20 mA for 0.5 s once a minute, 0.1 %/month self-discharge.

D        = 0.5 / 60                       = 0.008333  (1 in 120)
I_avg    = 20 mA × 0.008333 + 5 µA × 0.991667
         = 166.67 µA + 4.96 µA           = 171.63 µA
I_self   = 225 mAh × 0.001 / 730.5 h      = 0.308 µA
I_total  = 171.63 + 0.308                 = 171.93 µA
C_usable = 225 × 0.8                      = 180 mAh
t        = 180 mAh / 171.93 µA            = 1047 h = 43.6 days
share    = 0.308 / 171.93                 = 0.18 %

Six weeks. The 20 mA burst is 97 % of the drain; the sleep current is 3 %; self-discharge is noise. Now wake every ten minutes instead:

D        = 0.5 / 600                      = 0.000833
I_avg    = 20 mA × 0.000833 + 5 µA × 0.999167
         = 16.67 µA + 5.00 µA            = 21.66 µA
I_total  = 21.66 + 0.308                  = 21.97 µA
t        = 180 mAh / 21.97 µA             = 8193 h = 341 days ≈ 11 months

Same hardware, eight times the life. The wake period is the lever; the sleep current only starts to matter once the active term has been pushed below it. Take it further, one wake an hour at 1 µA sleep:

I_avg    = 20 mA / 7200 + 1 µA × 0.99986  = 2.78 + 1.00 = 3.78 µA
I_total  = 3.78 + 0.308                   = 4.08 µA
t        = 180 mAh / 4.08 µA              = 44 100 h ≈ 5.0 years
share    = 0.308 / 4.08                   = 7.5 %

Self-discharge is now a twelfth of the budget, and at 1 µA it would be the largest term. Past this point the cell's shelf life, not your firmware, sets the answer.

Where it stops being valid

Sleep current is measured, not read. The MCU datasheet figure is the die with everything off. On the board add the regulator's quiescent current (1 µA is good, 30 to 100 µA is common), pull-ups on any line held low in sleep, the battery-sense divider, floating input pins, the RTC, and the flash in whatever mode it defaulted to. Put a meter with a µA range in series with the cell, in the real sleep state, at the real temperature. Five microamps on paper is routinely fifty on the board, and once the active term is small that is a factor of ten in runtime.

Coin cells and pulses. A CR2032 is a 3 mA part. Its internal resistance starts around 10 to 20 Ω fresh and climbs past 50 Ω as it depletes, so a 20 mA radio burst drops 0.4 V from a fresh cell and well over a volt from a half-used one. The radio browns out with capacity still in the can, which is what the usable fraction is for. A 100 µF or larger capacitor across the cell supplies the burst and averages the cell current down to something it can deliver; without it, plan on 60 % usable, not 80 %.

Capacity depends on rate and temperature. The datasheet mAh is at a stated discharge, a few hundred µA for coin cells, tens of mA for alkaline. Alkaline at 500 mA delivers a fraction of its rating and loses a further third at 0 °C. The tool does not derate; lower the usable fraction from the manufacturer's curve for your current and temperature.

Cutoff voltage. The usable fraction is the capacity above your system's minimum voltage. A 3.0 V LDO on a Li-ion cell throws away everything below about 3.3 V, 10 to 15 % of the cell; a boost converter that runs an alkaline down to 0.9 V gets nearly all of it. Cutoff comes from the regulator's dropout plus the load's minimum; read the fraction off the discharge curve.

Lead-acid. Not modelled. Peukert's law (t = H · (C / (I · H))k, k ≈ 1.1 to 1.3) makes the capacity depend strongly on the discharge rate, and a two-state average current is not the right input to it. Use the manufacturer's rate tables.

Self-discharge is not constant. The percent-per-month figure roughly doubles every 10 °C. NiMH that is not the low-self-discharge kind loses 15 to 30 % in the first month. Li-SOCl2 passivates after a long sleep and the first pulse after it sags; that is a voltage problem, not a capacity one, and it is why those cells are paired with a hybrid layer capacitor.

Common mistakes

Further reading