Battery Life and Low-Power Design: the short answer
Battery life is set by the average current, not the active current. A sensor that wakes for 2 s every 5 minutes spends over 99 % of its time asleep, so its sleep current usually decides how long it lasts.
- Level
- Advanced
- Time
- About 6 min
- Topic
- Power
Measure sleep and active currents, compute battery life from a duty cycle, and remove the hidden drains that kill it.
Before this: Batteries: Voltage, Capacity and Runtime, Power Budgets and Thermal Design, Interrupts, Timers and FreeRTOS on ESP32
Battery life is set by the average current, not the active current. A sensor that wakes for 2 s every 5 minutes spends over 99 % of its time asleep, so its sleep current usually decides how long it lasts. Write the duty cycle as a table: each state (sleep, sensor warm-up, measure, Wi-Fi connect, transmit), its current and its duration. The average current is the sum of current × time divided by the total period. Battery life in hours is the usable capacity in mAh divided by the average current in mA.
The ESP32 chip in deep sleep draws around 10 µA, but a typical dev board draws far more: its USB-serial chip, power LED and AMS1117 regulator can add several milliamps between them. For battery projects use a bare module or a board designed for low power, a low-quiescent regulator (an HT7333 draws a few microamps; an AMS1117 draws several milliamps), and remove or cut the power LED. Power sensors from a GPIO pin or through a MOSFET so they are completely off while the chip sleeps, and make sure no pin back-powers a sensor through its I/O lines.
Measure, do not guess. A multimeter on the µA range in series with the battery reads sleep current, but its burden voltage may reset the board on wake; a current meter with auto-ranging or a dedicated power profiler shows the whole cycle. Wi-Fi is costly: connecting can take 1 to 3 s at around 100 to 150 mA on average. Use a static IP, store the Wi-Fi channel and BSSID in RTC memory, or switch to ESP-NOW or LoRa to cut the active time.
Average current decides battery life
Battery life is capacity divided by average current. A device that draws 80 mA for 2 seconds every minute and 20 µA otherwise averages about 2.7 mA, which runs a 2000 mAh battery for about 30 days. Cutting the awake time or the awake current helps most; the sleep current matters once it is a large share of the average.
Measure real current with a tool that can see both the bursts and the sleep floor, such as a power profiler or a series resistor and an oscilloscope. A multimeter's average can hide short peaks.
Sleep properly
Use the deep sleep mode of the chip and wake on a timer or an interrupt. Turn off what you do not need before sleeping: radios, sensor power and LEDs. A development board's USB chip and power LED can draw more in sleep than the processor, so judge battery life on a bare module or a board designed for it.
A radio burst is often the largest use, so connect, send and disconnect quickly, and send less often, or batch readings and send them together.
Power supply losses
A linear regulator's own quiet current and a leaky capacitor or pull-up can set the sleep floor. Choose a regulator with low quiet current, and switch off sensor power with a MOSFET when the device sleeps.
- Estimating battery life from the sleep current alone and ignoring bursts.
- Judging low-power design on a board with a power LED and USB chip.
- Leaving the radio on between sends.
- Iavg = (Ion × ton + Isleep × tsleep) ÷ (ton + tsleep)
- average current with sleep
Run time against average current
Work it with your own numbers: Battery run time
Practise this lesson with Pro
The explanation above is free for everyone. The practice for Advanced lessons in every domain are part of the Pro plan at ₹999 a month.
With Pro you also get: a worked example, a hands-on task, a 3-question check.
