“There is no question that ESP32 is a worthy competitor to many WiFi/MCU SoCs out there, often beating it on both performance and price. But, depending on which state it’s in, the ESP32 can be a relatively power-hungry device.
When your IoT project is powered by a plug in the wall, you tend not to care too much about power consumption. But if you are going to power your project by batteries, every mA counts.
The solution here is to cut back ESP32’s power usage by leveraging one of its Sleep Modes. It’s really a great strategy for dramatically extending the battery life of a project that doesn’t need to be active all the time.
What is ESP32 sleep mode?
ESP32 Sleep mode is a power-saving state that ESP32 can enter when not in use. The ESP32’s state is maintained in RAM. When ESP32 enters sleep mode, power is cut to any unneeded digital peripherals, while RAM receives just enough power to enable it to retain its data.
Inside ESP32 chip
In order to understand how ESP32 achieves power saving, we need to know what’s inside the chip. The following illustration shows function block diagram of ESP32 chip.
ESP32 Internal Functional Block Diagram
At the heart of the ESP32 chip is a Dual-Core 32-bit microprocessor along with 448 KB of ROM, 520 KB of SRAM and 4MB of Flash memory.
It also contains WiFi module, Bluetooth Module, Cryptographic Accelerator (a co-processor designed specifically to perform cryptographic operations), the RTC module, and lot of peripherals.
ESP32 Power Modes
Thanks to the ESP32’s advanced power management, it offers 5 configurable power modes. As per the power requirement, the chip can switch between different power modes. The modes are:
Modem Sleep Mode
Light Sleep Mode
Deep Sleep Mode
Each mode has its own distinct features and power saving capabilities. Let’s look in to them one by one.
ESP32 Active Mode
The normal mode is also known as Active Mode. In this mode all the features of the chip are active.
As the active mode keeps everything (especially the WiFi module, the Processing Cores and the Bluetooth module) ON at all times, the chip requires more than 240mA current to operate. Also we observed that if you use both WiFi and Bluetooth functions together, sometimes high power spikes appear (biggest was 790mA).”