ESP32-C3 deep sleep: where did my 40 µA go
Moved from the old blog in October 2026. I redrew the power path diagram and re-exported the PPK2 trace from the saved CSV, the numbers are the same.
In December I made a small sensor for my parents’ garage: ESP32-C3 SuperMini board, SHT40 for temperature and humidity, 1000 mAh LiPo. Wakes every 10 minutes, sends one UDP packet to a Raspberry Pi in the house, goes back to deep sleep. The C3 datasheet says about 5 µA in deep sleep with the RTC timer, so I expected something like a year on one charge.
The battery was empty after 4 weeks.
The setup for measuring
I have a Nordic Power Profiler Kit II, which is the best 90 € I spent on test equipment. It can work as a source meter: it supplies the voltage and measures the current from 200 nA to 1 A, and it switches the ranges by itself, so the sleep current and the Wi-Fi peaks are in the same trace.
First mistake, so you don’t repeat it: my first measurement was PPK2 at 3.3 V into the 3V3 pin of the board. Result: 11 µA. I was happy for about ten minutes, until I realised that this way I bypass the LDO and the battery divider completely. They were simply not in the circuit. The battery doesn’t connect to 3V3, it connects to the LDO input.
Correct way: PPK2 in source mode at 3.90 V (a typical LiPo voltage in the middle of its discharge) connected where the battery connects. USB cable disconnected, otherwise the board is powered from USB and you measure nothing useful.
Power path as it was. The red cross is the power LED, which was the first thing to go.
Step by step
| # | Change | Sleep current |
|---|---|---|
| 0 | Board as bought, my 100k/100k divider, SHT40 on 3V3 | 1.34 mA |
| 1 | Power LED desoldered | 72 µA |
| 2 | Divider changed to 1M/1M | 55 µA |
| 3 | LDO ME6211 replaced with RT9080 | 13.9 µA |
| 4 | SHT40 supply moved to a GPIO, held low in sleep | 44.6 µA (!) |
| 5 | I2C pins disabled properly before sleep | 9.1 µA |
Step 1 is obvious: a red LED with 1 kΩ from 3.3 V is about 1.3 mA, all the time. Everybody who does battery projects with these boards removes it. I knew this, and still forgot, because I tested the firmware on USB power for two weeks and didn’t think about it again.
Step 2: the divider for measuring battery voltage. 100k + 100k at 3.9 V is 19.5 µA. With 1M + 1M it is under 2 µA. The ADC doesn’t like a 500 kΩ source impedance, but the 100 nF capacitor on the divider output keeps the node stable while the ADC samples. In practice the first reading after wake-up is 2–3 % low, so I take three readings and use the last one.
Step 3 is the one from the title. 55 µA was still way too much, and nothing else on the board looked suspicious. I lifted the output pin of the LDO and measured the LDO alone, without load: 41 µA. The ME6211 on this board is specified with a quiescent current of about 40 µA typical. It’s a fine regulator for a board that is always on. For a battery device sleeping 99.9 % of the time, it is the biggest consumer by far.
I replaced it with an RT9080 (2 µA quiescent, 600 mA, same SOT-23-5 pinout for the pins that matter here, but check yours). The ESP32-C3 needs peaks over 300 mA during Wi-Fi transmit, so the very low-current LDOs like the MCP1700 (250 mA) are not a good idea.
Step 4 made it worse, which was confusing. The SHT40 breakout has its own small regulator, so I moved its supply to GPIO5 and switched it off before sleep. Current went from 13.9 µA to 44.6 µA.
Step 5 explains why. Before sleep I called gpio_reset_pin() on SDA and SCL, thinking it puts the pins into a neutral state. It doesn’t. The ESP-IDF documentation says it clearly, I just didn’t read it: reset enables the internal pull-up. So with the sensor unpowered, the pull-ups were feeding current through the sensor’s protection diodes into its supply. Disabling the pins and their pull-ups fixed it.
#include "esp_sleep.h"
#include "driver/gpio.h"
#define SENSOR_PWR GPIO_NUM_5
#define I2C_SDA GPIO_NUM_6
#define I2C_SCL GPIO_NUM_7
#define SLEEP_US (600ULL * 1000 * 1000)
static void pins_for_sleep(void)
{
gpio_set_level(SENSOR_PWR, 0);
gpio_hold_en(SENSOR_PWR);
const gpio_num_t bus[] = { I2C_SDA, I2C_SCL };
for (int i = 0; i < 2; i++) {
/* NOT gpio_reset_pin(): that one turns the pull-up on */
gpio_set_direction(bus[i], GPIO_MODE_DISABLE);
gpio_set_pull_mode(bus[i], GPIO_FLOATING);
}
gpio_deep_sleep_hold_en();
}
void app_main(void)
{
measure_and_send(); /* about 410 ms, see the trace below */
pins_for_sleep();
esp_sleep_enable_timer_wakeup(SLEEP_US);
esp_deep_sleep_start();
}
This is ESP-IDF 5.1.2. In newer versions the hold API may have changed, check the docs for your version.
What is left: 9.1 µA. Datasheet chip current is about 5, the RT9080 2, the divider just under 2. It adds up, so I stopped there.
The awake part
Sleep is only half of the story. The wake-up cycle, measured with the same PPK2 at 3.90 V:
One wake cycle. Boot, sensor reading, then Wi-Fi with the TX peaks. The average over the 410 ms is 70.8 mA.
To keep it short I use a static IP and save the channel and BSSID of the access point in RTC memory, so the C3 doesn’t scan. With DHCP and scan it was 1.6 s instead of 0.41 s.
Battery estimate
Per wake-up: 70.8 mA × 0.41 s ≈ 0.0081 mAh. 144 wake-ups a day gives 1.16 mAh per day. Then the sleep part:
| Sleep current | Sleep per day | Total per day | 1000 mAh lasts |
|---|---|---|---|
| 1.34 mA | 32.2 mAh | 33.3 mAh | 30 days |
| 72 µA | 1.7 mAh | 2.9 mAh | 11 months |
| 9.1 µA | 0.22 mAh | 1.38 mAh | about 2 years |
The first line is exactly what happened in the garage. The last line is theory. LiPo self-discharge, the cold in winter and the cut-off voltage will make it shorter; I’ll be happy with one year. Now Wi-Fi is 84 % of the energy, so the next improvement would be ESP-NOW instead of Wi-Fi, but then I need a second ESP in the house as a receiver. Maybe later.
Questions or corrections: marek@peplow-labs.info. There are no comments here, but I read the mail.