Battery life for a sleeping sensor: duty cycle, sleep current, real mAh

How to estimate battery life for a device that wakes, works and sleeps: average current step by step, which current to cut first, hidden drains and usable capacity.

Battery life for a sleeping sensor: duty cycle, sleep current, real mAh
On this page

A temperature sensor on two AA cells, a door contact on a coin cell, a soil probe in the garden. They all spend most of their life asleep, wake for a few seconds, send a reading and go back to sleep. "How long will the battery last?" sounds like it needs a lab. It needs one formula, honest numbers for each current, and a realistic idea of how much of the label capacity you can actually use.

This article walks through the estimate the same way the battery tab of the electronics calculator does it, with worked numbers and the traps that make real devices die early.

The only formula you need: average current

A battery does not care about peaks or sleep separately. Over hours it sees one average current, and that is what drains it:

I_avg = I_active × D + I_sleep × (1 − D)

where D is the duty cycle, the fraction of time the device is awake. Then:

Life (hours) = usable capacity (mAh) / I_avg (mA)

Usable capacity is the label value times a realistic share, usually 70 to 85 %. More on that below. Everything else in this article is about getting those three inputs right.

Worked example: a sensor that wakes every 5 minutes

Say a microcontroller with a radio wakes every 300 seconds, stays awake for 3 seconds at 50 mA, and sleeps at 50 µA. It runs on two AA alkaline cells in series, around 2,500 mAh at low drain. Series cells add voltage, not capacity, so the pack is still 2,500 mAh.

  1. Duty cycle: D = 3 / 300 = 0.01, so 1 %.
  2. Active part: 50 mA × 0.01 = 0.5 mA.
  3. Sleep part: 0.05 mA × 0.99 = 0.0495 mA.
  4. Average: 0.5 + 0.0495 = 0.55 mA.
  5. Usable capacity at 80 %: 2,500 × 0.8 = 2,000 mAh.
  6. Life: 2,000 / 0.5495 = 3,640 hours, or about 152 days.

So roughly five months. A spreadsheet or the scientific calculator gives the same result. The point of doing it by hand once is to see where the 0.55 mA comes from: 91 % of it is the 3 seconds awake.

Which current to cut first

A quick way to see that is a charge budget per cycle. Each 300-second cycle uses 50 mA × 3 s = 150 mA·s while awake and 0.05 mA × 297 s = 14.85 mA·s while asleep. The awake part dominates, so making sleep better barely helps. Here is what each change buys, always with 2,000 mAh usable:

ChangeAverage currentEstimated life
Baseline: 3 s awake every 5 min, 50 µA sleep0.55 mA152 days
Sleep cut to 5 µA0.50 mA165 days
Awake time cut to 1 s0.22 mA385 days
1 s awake, every 15 min, 50 µA sleep0.106 mA2.2 years
Same, with 5 µA sleep0.061 mA3.8 years

A tenfold better sleep current gives 9 % more life in the baseline. Shortening the awake time by two seconds more than doubles it. But look at the last two rows: once the device rarely wakes, sleep becomes half the budget, and the same 5 µA fix now buys 1.7× more life.

The rule of thumb: compare I_active × t_active with I_sleep × t_sleep for one cycle and attack the bigger one. Shorter radio sessions, fewer reports, batching readings and sending them together usually beat heroic sleep tuning, until they don't.

Hidden currents that ruin the estimate

The 50 µA sleep figure in a datasheet is the chip alone. The board around it often draws far more, and these drains run 24 hours a day:

  • Voltage regulator quiescent current. A common AMS1117 linear regulator draws around 5 mA by itself. Add that to the example and the average jumps to 5.55 mA: about 15 days instead of 152. Low-quiescent regulators draw a few µA.
  • Power LEDs. A 2 mA "on" LED on a development board brings the example down to about 33 days.
  • Pull-up resistors and dividers. A 10 kΩ pull-up held low at 3.3 V passes 0.33 mA. A battery-voltage divider of two 100 kΩ resistors across 3 V passes 15 µA all the time.
  • USB-to-serial chips and sensors that never sleep. Many modules leave them powered.

Measure the whole board's sleep current with a multimeter in series, on the µA range, before trusting any estimate. If the reading is ten times the datasheet value, one of the items above is usually why.

Usable capacity: why 2,500 mAh is not 2,500

The label figure is measured at a gentle, constant drain down to a low cut-off voltage. Real use takes away from it in four ways:

  • Cut-off voltage. If your circuit stops working at 2.7 V from two alkaline cells, it gives up at 1.35 V per cell and may leave about half the energy unused. A circuit that runs down to 1.8 V uses most of it.
  • High pulses. Radios draw short bursts of 100 mA or more. Alkaline and coin cells sag under such pulses, so the device can brown out while the cell still holds charge.
  • Cold. Batteries outdoors in winter deliver noticeably less than at room temperature.
  • Self-discharge. Cells lose charge even unused. Treat it as one more constant current, as the table shows.
BatteryTypical self-dischargeEquivalent current
Alkaline AA, 2,500 mAhabout 2 to 3 % per yearabout 9 µA
Li-ion cell, 2,000 mAhabout 2 to 3 % per monthabout 80 µA

That Li-ion row is bigger than many sleep currents. Add the alkaline 9 µA to the 3.8-year case above and it drops to about 3.3 years. If any estimate goes past five years, check the battery's shelf life before believing it. This is why the tool asks for a usable share, and why 70 to 85 % is a sensible planning range.

When mAh stops being the right unit

mAh works when the battery current equals the load current. With a linear regulator (an LDO) that is true: a 3.7 V Li-ion cell feeding a 3.3 V circuit through an LDO supplies the same milliamps the circuit draws, and the extra voltage turns into heat.

With a switching converter, the battery current changes. Two AA cells boosted to 5 V at 85 % efficiency for a 20 mA load:

  • Output power: 5 V × 0.02 A = 0.1 W.
  • Input power: 0.1 / 0.85 = 0.118 W.
  • At about 2.4 V from two loaded alkaline cells: 0.118 / 2.4 = 49 mA from the battery.

The load draws 20 mA, the battery delivers 49. In that case work in energy instead: watt-hours = mAh × voltage / 1,000, divided by the input power.

A short checklist

  • Write down active current, active time, period and sleep current for one cycle.
  • Measure the board's real sleep current; don't copy the chip datasheet.
  • Compute the average, then the life with 70 to 85 % usable capacity.
  • Compare active charge with sleep charge per cycle and optimise the bigger one.
  • Add self-discharge for multi-year designs, and convert via power if there is a boost or buck converter.

For the resistor side of the same board, from current limiting to power ratings, see Ohm's law and picking an LED resistor.

Tools mentioned in this article

Back to the blog