Battery life calculator
How long a battery runs a device that wakes, works and sleeps — and the part the capacity-divided-by-current answer hides: the ceiling your sleep current puts on the lifetime however rarely the device wakes, and which of the drains is actually worth cutting.
Active and sleep currents are what the circuit draws after the regulator. Always-on is drawn straight from the battery — the regulator's own quiescent current, a battery-monitor divider, a protection circuit. Battery figures are typical; pick Custom to enter a datasheet's.
| Where the charge goes | Battery current | Share |
|---|
| Wakes every | Average current | Battery life | Of the ceiling |
|---|
Everything else held as entered. The highlighted row is your design. Past the interval where sleep catches up, waking less often can at most double the life.
How this is calculated
A device that wakes for ton every T seconds, drawing Iactive while awake and Isleep otherwise, draws on average
Iavg = Isleep + (Iactive − Isleep) · ton / T
The sleep current flows all the time and the active current only adds its excess while awake, which is why it is subtracted inside the bracket. A linear regulator passes its load current through unchanged, so those currents come out of the battery as they are. A switching regulator converts power instead, so the battery supplies I · Vout / (η · Vbattery). The always-on drain — the regulator's own quiescent current, any divider across the battery, a cell's protection circuit — is added last, on the battery side.
Self-discharge is modelled as a leak proportional to the charge left, the way cells actually lose it: a cell that keeps a fraction 1 − r of its charge over a year on the shelf leaks at k = −ln(1 − r) / 8760 per hour. With the load drawing I from a usable capacity C, the charge runs out after
t = ln(1 + k · C / I) / k
which is exactly C / I when nothing leaks, and falls further below it the smaller the load is next to the leak. The usable percentage covers everything the label's capacity was measured without: a cut-off voltage higher than the rating's end point, cold, age, and capacity lost to high pulse currents.
The ceiling your sleep current sets
Stretch the wake interval towards infinity and the active term vanishes, leaving only the sleep and always-on drain. That is a hard ceiling: no firmware change to how often the device wakes can make the battery outlast it. At the defaults the ceiling is 4.6 years, and the device as specified gets 2.7 of them.
The ceiling gives the most useful number on the page, the wake interval at which the charge spent awake equals the charge spent between wakes:
T* = (Iactive − Isleep) · ton / (Isleep + Ialways-on)
Ignoring self-discharge, a device waking every n · T* gets exactly n / (n + 1) of the ceiling. So at T* it has half, at 3 T* three quarters, and at 9 T* nine tenths. That is the point of diminishing returns stated as a number: below T*, sending data less often is the lever; above it, only lowering the sleep and always-on current helps, and waking less often can at most double what you already have. At the defaults T* is 7.2 seconds, the device wakes every 10, and it is already on the flat part of the curve.
Which drain to cut first
The verdict above compares the two levers directly — halve the charge spent awake, or halve everything drawn between wakes — and reports what each would buy. At the defaults the answer is not the one people reach for. The 12 mA radio burst looks like the expensive part, but it averages 36 µA; the 40 µA always-on drain, a regulator's quiescent current plus a battery-monitor divider, costs more than the radio does and is invisible on a bench meter set to milliamps. Halving the awake charge buys 26 % more life; halving the drain between wakes buys 39 %.
The always-on figure is where the easiest wins usually live. A regulator with a 1 µA quiescent current in place of a 25 µA one, and a divider switched off with a MOSFET between measurements, cost cents. The voltage divider calculator reports what a battery-monitor divider draws continuously, and a power LED left on as an indicator is a steady drain sized on the LED resistor calculator — at 2 mA, more than twenty times this whole device.
Self-discharge sets its own limit
A cell loses charge on the shelf, and the lower the load the more that matters. The page reports self-discharge as the current it is equivalent to at full charge, so it can be compared directly with the circuit's. A 2500 mAh pair of alkaline AAs losing 2 % a year leaks about 5 µA — negligible beside a 100 µA load, dominant beside a 2 µA one. A Li-ion 18650 at 25 % a year leaks about 85 µA, more than most sleeping microcontrollers draw, which is why a Li-ion cell is the wrong choice for a sensor meant to run for years and lithium thionyl chloride, at around 1 % a year, is the usual right one.
Two limits the model does not capture, both of which the page warns about. Self-discharge rises steeply with temperature, so the percentage should be the one for where the device lives. And past about ten years the answer is set by the cell's shelf life and ageing, not by this arithmetic — a projected fifteen years means the circuit is no longer what limits the product.
Coin cells and pulse current
A CR2032's 220 mAh or so is measured at a fraction of a milliamp. Draw a 10 to 15 mA radio burst from it and the voltage sags under the cell's internal resistance, which rises as it discharges, so the device browns out while plenty of charge remains. The effective capacity at pulse loads is well below the label, and a large capacitor across the cell to supply the burst is the usual remedy. The page warns when the active current is well past what the chosen cell is comfortable with; the usable percentage is where to account for it.
FAQ
How do I calculate battery life?
Divide the usable capacity by the average current. For a device that is always on, that is the capacity in mAh over the current in mA, giving hours. For anything that sleeps, work out the average current with the duty-cycle formula above first — dividing by the active current alone understates the life, and dividing by the sleep current alone overstates it, often by years.
How long will a CR2032 last?
Around 220 mAh with perhaps 85 % usable is 187 mAh. At an average of 20 µA that is about a year; at 5 µA, about four. Most real designs are limited by the pulse-current problem above before they reach the arithmetic figure.
Why is my measured sleep current so different from the datasheet?
The datasheet figure is the microcontroller alone. Everything else on the board keeps drawing: the regulator's quiescent current, pull-up resistors held low, dividers, sensors never put to sleep, floating inputs, LEDs, and leakage through protection diodes into unpowered peripherals. Measure the whole board with a meter able to resolve microamps, and put the part you cannot remove into the always-on field.
Does a switching regulator always save battery?
During active bursts, usually, when the battery voltage is well above the output. Between wakes, often not: a switching regulator's efficiency at microamp loads can be far below its headline figure, and its quiescent current is typically higher than a good LDO's. If sleep dominates, enter the light-load efficiency from the datasheet, or compare against a low-quiescent LDO.
Does this work for rechargeable batteries?
Yes — the result is the runtime per charge. For lithium cells, the usable percentage is also where to account for charging them to less than 4.2 V to extend their cycle life.
What about battery voltage falling as it discharges?
For a linear regulator or no regulator, the current does not depend on the battery voltage, so the capacity figure already accounts for it; the device simply stops at the cut-off. For a switching regulator the battery current rises as the voltage falls, so use a mid-discharge voltage rather than the fresh one — this page uses whatever voltage you enter.