Battery-life estimator
How long a microcontroller project runs on its battery — a duty cycle built from datasheet currents for the ESP32, ESP32-C3, ESP32-S3, nRF52840 and RP2040 (each cited to its table), capacity derating for temperature, ageing and cut-off, self-discharge, and an LDO's quiescent current or a switcher's efficiency — with a one-cycle current timeline, where the charge goes, and what-ifs.
Added
How to use it
How to use it
-
Start from an example (an ESP32 Wi-Fi sensor on 2 × AA, an ESP32-C3 on an 18650 behind an LDO, an nRF52840 beacon on a CR2032, an RP2040 logger, an ESP32-S3 with a daily OTA check), or build your own.
-
Set the duty cycle. "Wake every" is the cycle. Each state has a current, a duration, and either runs once every cycle or has its own "every", for a rarer event such as an hourly sync or a daily OTA check. The sleep row fills the rest of the cycle. "Always-on extras" are what never sleeps: a battery-voltage divider (3.3 V across 1 MΩ draws 3.3 µA), a sensor left powered, a power LED. Currents can be typed as
240 mA,10 µAor3.16u; a bare number means mA. Times can be250 ms,1.8 s,10 minor1 h. -
Datasheet presets: pick the chip and tap a state to add it, or choose "Set as the sleep state" first. Each preset is a typical figure from the chip’s datasheet at 3.3 V and 25 °C; hover it for the table it comes from. The chip’s current is not the board’s: a dev board’s USB-serial chip, regulator and LEDs often draw more in sleep than the chip itself. The RP2040 list therefore has the bare chip and the Pico board at 5 V.
-
Describe the battery: chemistry (typical voltage and self-discharge from the battery tool), cells in series, capacity, and the derating:
-
usable to cut-off — how much you get before the voltage is too low (a rule of thumb, 80–90 %);
-
lost to ageing — capacity fade;
-
temperature — the cold-weather factor from the battery tool’s derating table (alkaline cells lose most: about 40 % of capacity is left at −10 °C);
-
self-discharge — blank uses the chemistry’s typical figure, as a steady drain.
-
-
Choose the regulator:
-
None — the chip runs from the battery.
-
LDO — the battery supplies the load current plus the quiescent current, at any voltage, so a 3.3 V LDO on a 4.2 V cell wastes the difference as heat. The tool warns when the LDO drops out before the cell is empty.
-
Buck / buck-boost — the battery current is the load current × Vout / (Vbat × efficiency), plus Iq. Use the efficiency at your average current from the data sheet’s curve: many converters manage 90 % at 100 mA and 50 % at 10 µA.
-
-
Read the runtime, the average currents, mAh a day, the number of wake-ups and the peak. The bar shows where the charge goes, as the battery sees it. One cycle draws the current over a cycle on a log scale (⛶ Full screen or
Ffor a closer look). What if re-runs the estimate with one thing changed: wake half or twice as often, halve the biggest consumer, a leakier sleep, no regulator Iq, the other regulator type, twice the battery, no self-discharge.
Warnings flag a peak above what the cell delivers comfortably. For a CR2032 that is about 15 mA: above it the voltage sags under Wi-Fi-like pulses, and a big capacitor or a different cell is the fix. They also flag an LDO that drops out early.
Export JSON saves the whole set-up and Open JSON reads it back. Settings are remembered in this browser.
Where the numbers come from
-
ESP32 — Espressif, ESP32 Series Datasheet v5.3. Table 4-2: Modem-sleep 20–68 mA (the upper end is used), Light-sleep 0.8 mA, Deep-sleep 150 µA with the ULP on and 10 µA with the RTC timer and memory, Hibernation 5 µA, off 1 µA. Table 5-4: TX 802.11b at +19.5 dBm 240 mA, 802.11n MCS7 at +14 dBm 180 mA, RX 95–100 mA, BLE TX at 0 dBm 130 mA.
-
ESP32-C3 — ESP32-C3 Series Datasheet v2.4. Table 5-7: TX 802.11b at +21 dBm 335 mA peak, HT20 MCS7 at +18.5 dBm 276 mA, RX 84 mA. Table 5-8: Modem-sleep 13–28 mA. Table 5-9: Light-sleep 130 µA, Deep-sleep 5 µA, off 1 µA.
-
ESP32-S3 — ESP32-S3 Series Datasheet v2.2. Tables 5-7 and 5-8: TX 340 / 283 mA, RX 88 mA, BLE TX at 0 dBm 176 mA, BLE RX 93 mA. Table 5-9: Modem-sleep. Table 5-10: Light-sleep 240 µA (plus the PSRAM), Deep-sleep 7–8 µA with the RTC memory, 170 µA with the ULP-FSM, off 1 µA.
-
nRF52840 — Nordic, nRF52840 Product Specification v1.1, section 5.2.1. System ON with full RAM and RTC wake 3.16 µA, System OFF 0.4 µA, CPU CoreMark from flash 3.3 mA (DC/DC), radio TX at 0 dBm 6.4 mA and +8 dBm 16.4 mA, RX 6.26 mA (DC/DC).
-
RP2040 — RP2040 Datasheet Table 637: typical DVDD current 0.18 mA DORMANT, 0.39 mA SLEEP, BOOTSEL with USB active 9.4 mA DVDD + 1.2 mA IOVDD. Raspberry Pi Pico Datasheet Tables 3–5: the board at 5 V draws 0.8 mA DORMANT, 1.3 mA SLEEP and 8.7 mA in BOOTSEL with USB idle (25 °C means).
How long the active phases take (boot, Wi-Fi connect, a BLE advertising event) depends on your firmware and network. The examples use common round numbers, not datasheet figures: measure yours with a current meter or a power profiler and type them in.
Limits
-
Peak currents are the chip’s alone; radio figures are measured at the RF port at 3.3 V.
-
Capacity is a single number. The tool does not model the voltage curve, Peukert losses at high current or the regulator’s efficiency varying with load, so treat the answer as an estimate. Battery discharge simulates the voltage under load.
-
Self-discharge is a steady drain at the chemistry’s typical rate, and the temperature factor is approximate.
-
nRF52832 and other chips are not built in: add their states by hand from their datasheets.
Linking to an example
Share link copies a URL with the whole set-up: the states, the battery and the regulator. These
are packed into ?s=. A hand-written link can still set the parameters below.
| Parameter | Meaning |
|---|---|
|
Cycle length in seconds |
|
Preset chip shown in the presets list: |
|
Temperature units: |
|
A preset (below) |
Feedback is a gift. Something to improve, a feature to add, or a bug? Tell me.
Runs entirely in your browser; nothing you type leaves this page.