Wi-Fi DISCUSSION

How can I make a battery-powered ESP32 Wi-Fi sensor last for months instead of days?

Started by swapnilsingh ESP32 deep sleepWi-Fi power consumptionbattery life calculationlow power IoT nodeconnection time
5 replies 248 views 6 participants
Latest activity · 30 Sep 2026

How can I make a battery-powered ESP32 Wi-Fi sensor last for months instead of days?

swapnilsingh Wi-Fi Forum
#1

My ESP32 temperature node runs from a 2000 mAh lithium cell and sends one reading over Wi-Fi every 10 minutes. It stays connected all the time, and the battery is flat in under two days. I have seen claims of months of battery life with the same chip.

How is the battery life estimated for a Wi-Fi node, and which changes make the biggest difference: deep sleep, shorter connection time, or the hardware around the module?

Community replies 5

Re: How can I make a battery-powered ESP32 Wi-Fi sensor last for months instead of days?

#2

Battery life is capacity divided by average current, so work out the average. An ESP32 with the radio active draws on the order of 100 mA, with transmit peaks of a few hundred mA according to the datasheet; 2000 mAh at that level lasts about a day, which is what you see. In deep sleep the chip itself needs around 10 µA with only the RTC timer running.

Now duty-cycle it. Suppose each wake-up takes 3 seconds at an average of 100 mA: that is 300 mA·s, or 0.083 mAh. With 144 wake-ups per day the active part costs 12 mAh per day, and sleep adds 0.01 mA × 24 h = 0.24 mAh. At about 12.2 mAh per day, 2000 mAh lasts roughly 160 days before allowing for self-discharge and usable capacity.

Re: How can I make a battery-powered ESP32 Wi-Fi sensor last for months instead of days?

#3

The calculation shows where the energy goes: almost all of it is the awake time, so shortening each wake-up matters more than anything else. A plain connect with DHCP often takes 2 to 5 seconds. Typical savings: use a static IP address to skip DHCP; store the access point's channel and BSSID in RTC memory and pass them to WiFi.begin() so the scan across all channels is skipped; read the sensor before turning the radio on; and keep the exchange short, since a TLS handshake alone can add a second or more.

Getting the awake time from 3 seconds to 1 second roughly triples the battery life in the example above.

Re: How can I make a battery-powered ESP32 Wi-Fi sensor last for months instead of days?

#4

The board often matters more than the chip. The 10 µA figure is for the bare chip or module. A typical development board adds a USB-to-serial chip, a power LED and a linear regulator with a quiescent current of several mA, so it draws milliamps while "asleep". At 5 mA the sleep current alone uses 120 mAh per day, and the battery is empty in about 16 days however clever the firmware is.

For a real battery node, use a bare module or a board designed for low power, with a regulator whose quiescent current is in the microamp range, no always-on LED, and sensors that are powered down during sleep. Measure the sleep current with a meter on the µA range before optimising anything else.

Re: How can I make a battery-powered ESP32 Wi-Fi sensor last for months instead of days?

#5

Watch the voltage as well as the capacity. The module is specified for about 3.0 to 3.6 V and a lithium cell goes from 4.2 V down to about 3.0 V, so a regulator is required, and a common linear type with around 1 V of dropout cannot hold 3.3 V from a single cell at all. Choose a low-dropout regulator rated for the transmit peaks (at least 500 mA) with low quiescent current, or a buck-boost converter, and put a bulk capacitor close to the module so the peaks do not cause brownout resets on a partly discharged cell.

Use a protected cell or a protection circuit, charge it only with a proper lithium charger, and do not discharge below the limit in the cell's datasheet.

Re: How can I make a battery-powered ESP32 Wi-Fi sensor last for months instead of days?

#6

If the node must stay reachable instead of waking on a timer, deep sleep is not an option, but the Wi-Fi power-save modes are. In modem sleep the station keeps its association and turns the radio on only for beacons at the DTIM interval, bringing the average down to a few tens of mA; automatic light sleep reduces it further, at the cost of latency.

Those modes suit mains-backed or large-battery devices. They do not get anywhere near the duty-cycled deep sleep figures, so for a sensor that reports every 10 minutes, timer wake-up from deep sleep is the right design.

TEP COMMUNITY