databit.me

Calculator

Battery Life Calculator

Estimate runtime from battery mAh, sleep/active current and duty cycle.

mAh
%
mA
s
µA
s

Result

Estimated runtime
237 days
Average current
281.6 µA
Duty cycle
0.333 %
Energy used while awake
94.7 %
Runtime in days
236.7 days
  • !Awake time dominates — shorten the active window or lower the active current for the biggest gain.
Ad space · top

How it works

Most battery-powered gadgets spend nearly all their time asleep and wake briefly to take a reading and send it. The battery life therefore depends on the average current, which blends a large active current for a short time with a tiny sleep current for a long time.

Enter your battery capacity, how much current the board draws awake and asleep, how long each wake-up lasts, and how often it happens. Derating accounts for the fact you can rarely use 100% of the rated capacity — cut-off voltage, temperature and ageing all take a share. Measure your real currents with a proper meter if you can; datasheet values for bare chips are often optimistic compared with a whole board.

Formula

Average currentIavg = (Iactive × tactive + Isleep × (T − tactive)) / T
Runtimehours = (capacity × usable%) / Iavg
Duty cycleduty = tactive / T

Worked example. 2000 mAh battery at 80% usable, 80 mA awake for 2 s every 10 minutes, 15 µA asleep: Iavg ≈ 0.2678 + 0.0149 ≈ 0.28 mA → about 5,700 hours ≈ 8 months.

Ad space · inline

Frequently asked questions

How accurate is this estimate?

It is a good planning number, usually within ±30% if your current figures are measured. Radio retries, sensor warm-up time, battery self-discharge and cold temperatures all reduce real life.

Why is my board's sleep current so much higher than the chip's datasheet?

A dev board adds a voltage regulator, USB-serial chip, power LED and pull-ups that draw continuously. A bare ESP32 might sleep at 10 µA while a dev board sleeps at 1 mA or more. Use a low-quiescent regulator and remove the power LED for real battery projects.

What usable capacity should I assume?

70–85% is a reasonable range for lithium cells with a typical cut-off voltage. Use less for very cold environments or aged cells.

Does battery self-discharge matter?

For projects measured in years, yes. Lithium primary cells lose about 1% per year, alkalines a few percent, and cheap LiPo pouches several percent per month. Include it as extra leakage current if your runtime estimate is long.

Boards this helps with

Free download

The Microcontroller Cheat Sheet

Logic levels, pins to avoid, I2C / SPI / UART basics and a quick-pick table of the best boards — on one printable PDF. Enter your email and it's yours.

Only used to send the sheet and the odd databit.me update. See the privacy policy.