The ESP32 chip is becoming increasingly popular in the Arduino environment. As a 32-bit processor, it is also the most powerful Arduino with very good support from the Chinese manufacturer Espressif, who also released the entire support for Arduino on GitHub. In addition, the ESP32 can of course communicate via WiFi and Bluetooth, with our ECO Power board even via LoRa radio technology and achieves ranges of 200 m to 20 km. This article describes our experience with the ESP32 in battery operation.
This is how easy it is to get an ESP32 WROOM module running: First program the module with an adapter, then connect the module, and battery operation starts.
Power consumption of the ESP32 WROOM module
Some determined power consumption values of the ESP32 chip:
|Normal (240 MHz)||50 mA|
|Reduced clock (3 MHz)||3,8 mA|
|WiFi operation||80-180 mA|
We measured these values with the ESP32-WROOM module, but we also achieve them with our ECO Power board in battery operation. However, most ESP32 boards do not come close to this low power consumption. Usually ESP32 boards still need about 20 mA despite deepsleep mode – that’s more than two-thousand times as much! Important factors for power consumption are the additional circuits on the board, the implementation of the USB power supply and the implementation of battery operation. With regular ESP32 boards, power consumption can’t be reduced any further, so we had to develop something of your own. This is what we have done with the ECO Power board.
Comparison: 32 bit MCUs in power saving mode
We have obtained these results in practice, which shows that the very powerful ESP32 is extremely energy-efficient – with compromises of course, but at least with a standard Arduino environment.
Choosing the right batteries or rechargeable batteries
The ESP32 always runs at approx. 2.55 to 3.6 volts, as is the case with the ESP32 WROOM module. External extensions such as a screen or other components often require at least 3.3 volts. If you want to operate the ESP32 with a long battery life, there are a few things to consider. To avoid running into these traps, here is an overview.
1. ESP32 operation via a power bank
This is pretty much the worst option. Such a power bank internally uses a 3.7V lithium battery, then transforms this voltage to 5 volts with loss, a connected ESP32 then uses an LDO (low drop-out voltage regulator), which reduces the 5 to 3.3 volts. This is a disaster in terms of energy efficiency; multiple conversions permanently consume considerable amounts of power (i.e. constantly, even if the ESP32 only requires 7 µA). In addition, some power banks switch off automatically, as they believe that no loads are connected due to the ESP32’s low power consumption.
2. ESP32 operation via a NiMH battery or standard batteries (2 x 1.5 V)
Direct operation with two NiMH batteries does not work, as one battery only supplies approx. 1.2 volts, i.e. 2.4 volts with two batteries. This is too little for the required 2.55 volts, which the ESP32 needs at least. Three NiMH batteries connected in series are also not an option, as the maximum voltage of 3.6V for the ESP32 is exceeded with full batteries.
With regular batteries (except lithium) this does not work for long, because the minimum voltage of the ESP32 of 2.55V is not reached after a certain operating time and the battery is still at 70% of its total capacity. In addition, the ESP32 on WiFi needs 400 mA pulses at short notice – the battery voltage of regular batteries collapses and the ESP32 runs into a reset.
3. ESP32 operation via lithium batteries
Whether two 1.5V lithium batteries in series or one CRV123 3V lithium battery, everything works perfectly with lithium batteries. These keep a voltage of 3V quite constant, at less than 2.7 volts more than 90% of the capacity of a lithium battery is used, at 2.55 volts it is practically empty. Lithium batteries also provide the high short-term power requirements of WiFi operation without any problems. For example, a Varta CRV123 (3V, 1700 mAh) can even be used in standby mode for over 5 years, depending, of course, on how often the ESP32 wakes up and has to do something, or how long and how often WiFi or Bluetooth is used.
As lithium batteries have a very low self-discharge and also function well at -20 °C, these are to be preferred.
4. ESP32 operation via LiFePO4 batteries
Modern LiFePO4 batteries also work excellently, but deliver approx. 70% less energy than a lithium battery of the same size. However, LiFePO4 batteries can be recharged or replaced with a charged battery. LiFePO4 batteries also deliver unproblematically high performance for WiFi operation, but do not have the disadvantage like lithium polymer batteries, which can catch fire if used incorrectly or if quality is poor.
LiFePO4 batteries are well suited for short-term operation, i.e. weeks and months. However, it is important to note that a special charger is required which is suitable for LiFePO4 3V batteries.
5. ESP32 operation via lithium polymer or lithium batteries
Needless to say, lithium polymer or lithium batteries work because they provide enough power for the ESP32. However, the voltage of 3.7 to 4.2V is much too high for the ESP32, depending on the state of charge, and must therefore be reduced. This has the disadvantage that a large part of the energy is permanently used to reduce the voltage to 3.3V. Simple LDO controllers require approximately 2000 times more power for standby than the ESP32 in deepsleep mode, every second, 24 hours a day, 365 days a year. Even better controllers still need a lot of power.
Of course, lithium polymer batteries work for one day or a few days, but for weeks and years this is almost impossible.
The lithium battery is the first choice for battery operation with a standby time of weeks and years.
Power consumption of ESP32 boards in deepsleep mode:
|ECO Power||7 µA||via lithium or LiFePO4 battery|
|ESP32 DevKitC||11 mA||via USB power supply|
The time in deepsleep mode on the ESP32
In deepsleep mode, the ESP32 switches off the CPU and the corresponding crystal oscillator. An internal oscillator ensures that the time continues to run. However, this internal oscillator is very inaccurate and temperature-dependent, so that in permanent deepsleep mode a deviation of 20% and more can quickly occur. This means that after a few days the watch is no longer correct at all. In addition, the time is reset to 0 during a battery change or a reset or watchdog. This is quite problematic for a long-term battery operation; this restriction exists practically with all ESP32 boards.
Our ECO Power board solves this problem by using a high-precision RTC clock (DS3231), which simply sets the correct time after a deepsleep. In addition, all DS3231 RTCs are individually calibrated against an atomic clock during ECO Power production. The DS3231 is also temperature compensated (TCXO), so it provides the exact time over many years, regardless of the weather.