Battery runtime
How many hours and days a circuit lasts with sleep.
How run time is calculated
The circuit's average current is Iavg = Iactive × (1 − d) + Isleep × d, where d is the fraction of time spent asleep. If the board wakes every T minutes and works for t seconds, d = (60 × T − t) / (60 × T). The calculator divides the average current by the regulator efficiency and adds self-discharge as a separate current: capacity × percent per month / 730 h. Run time equals the capacity divided by the sum of these currents.
ESP32 currents from the Espressif datasheet (version 5.3, tables 4-2 and 5-4): Wi-Fi transmit 802.11b at +19.5 dBm 240 mA, receive 95-100 mA, deep sleep with the RTC timer and RTC memory 10 µA, with the ULP coprocessor on 150 µA. That is the current of the chip itself.
Examples
- An ESP32 wakes every 10 minutes, works for 5 seconds at 80 mA and sleeps at 10 µA. The sleep fraction is 595 / 600 = 99.17 %, the average current is 0.68 mA, and an 18650 of 2600 mA·h with 90 % efficiency and 3 % self-discharge per month lasts 126 days.
- The same circuit on a dev board that draws 5 mA asleep: average current 5.6 mA, run time 17 days.
Common mistakes
- For a dev board, people enter the 10 µA from the ESP32 datasheet as the sleep current. The regulator, the power LED and the USB-UART bridge on the board draw milliamps, and the battery drains many times faster than calculated.
- People take the active current from a single multimeter reading. During wake-up the current swings between receive and transmit levels, and the field needs the average current over the whole wake-up.
- People calculate from the capacity on the label. Capacity is measured at a low current down to 2.5 V, and a circuit that shuts down at a higher voltage gets less.
FAQ
- How long will an ESP32 run from an 18650 in deep sleep?
- If the whole circuit draws 10 µA asleep and works for 5 seconds every 10 minutes at 80 mA, an 18650 of 2600 mA·h lasts 126 days. A dev board that draws 5 mA asleep lasts 17 days on the same battery.
- Why does the board draw milliamps in sleep?
- The 10 µA in the datasheet is for the ESP32 chip alone. On a dev board the regulator and the power LED keep running during sleep, and on some boards the USB-UART bridge too. The quiescent current of the AMS1117-3.3 is 5 mA typical and up to 11 mA per its datasheet, and a power LED with a 1 kΩ resistor from 3.3 V draws about 1.3 mA. For battery operation, use a module without these parts and a regulator with a quiescent current in microamps.
- How do I calculate the average current if the device wakes every N minutes?
- The sleep fraction d = (60 × N − t) / (60 × N), where t is the active time in seconds. Average current = Iactive × (1 − d) + Isleep × d. Enter the sleep fraction in percent in the "Share of time asleep" field.
- How much does a 3000 mA·h 18650 deliver before cutoff?
- The 3000 mA·h of a Samsung INR18650-30Q is specified at a discharge current of 600 mA (0.2C) down to 2.5 V at 25 °C. A circuit with a 3.3 V regulator shuts down earlier, when the cell voltage drops below the regulator's minimum input, and the capacity below that voltage stays in the cell. Its share can be read from the discharge curve in the cell's datasheet. In the cold and at high current the cell also gives less.