What is the best battery for the ESP32?
In this article you learn what is the best battery for the ESP32 microcontroller.
First I describe the different voltage levels on the ESP32 board to avoid magic smoke and a damage of the microcontroller.
On top of all this content, you learn which batteries need a voltage regulator and how to use such a regulator.
Table of Contents
The best Battery for the ESP32
The best battery power supply for the ESP32 is the LiFePO4 battery or the LiPo battery pack
- LiFePO4 battery if your main goal is to reach a maximum battery lifetime because you do not need any extra voltage regulator between the ESP32 and the battery. Also LiFePO4 batteries are rechargeable and have a capacity up to 6,000mAh, similar to LiPo and Li-ion batteries that gives your project a long lifetime in combination with a power mode that reduces the power consumption to a minimum.
- LiPo battery pack if you want to charge your battery while the circuit is running. The easiest solution because of the plug-and-play connection is to use an ESP32 microcontroller board that has a JST connector as well as an onboard LiPo charger like the Adafruit HUZZAH32, Sparkfun ESP32 Thing Plus or FireBeetle ESP32
Different Voltage Levels of the ESP32 Microcontroller Board
Before we can analyze different batteries in combination with the ESP32 microcontroller, we have to understand, that there are different voltage levels on the ESP32 NodeMCU board. The following picture shows a simplified schema of the voltage levels and the important components.
From the picture you see that the 5V USB connection and the VIN pin are connected to a 3.3V voltage regulator, that transforms the input voltage between 5V and 12V to a constant 3.3V output voltage for the ESP32 microprocessor. Also the 3.3V pin is connected to the output of the voltage regulator and therefore also connected to the ESP32.
If you want to know how to operate ESP32 in general, visit the ESP32 tutorial.
The following table shows the technical limits for the ESP32 and the voltage regulator.
|Microcontroller||Minimum Voltage||Typical Voltage||Maximum Voltage|
The ESP32 has a nominal voltage of 3.3V but is able to operate between 2.3V and 3.6V. Voltages higher than 3.6V can damage the microcontroller.
|Voltage Regulator||Output Voltage||Maximum Input Voltage||Maximum Output Current|
The AMS1117 voltage regulator has an output voltage of 3.3V matching the nominal voltage of the ESP32. The maximum input voltage is 15V but for a continuous operation a maximum voltage of 12V is recommended. The maximum output current is 1A leaving a good reserve because the data sheet of the ESP32 advises an output current of 500mA for a voltage regulator.
After we know the parameters of the microcontroller, we review the most used battery types and if it is reasonable to use the battery in combination with the ESP32 NodeMCU microcontroller.
Microcontroller Datasheet eBook
The 35 pages Microcontroller Datasheet Playbook contains the most useful information of 14 Arduino, ESP8266 and ESP32 microcontroller boards.
AA Alkaline Batterie for ESP32
|AA Alkaline Batteries Criteria||Specification|
|Minimum discharge voltage||1V|
|Maximum charge voltage||1.65V|
|Number of recharges||500|
|Energy density||80 Wh/kg|
AA alkaline batteries have a nominal voltage of 1.5V and if you connect two of them in series you get a nominal voltage of 3V. You can connect two AA alkaline batteries directly to the 3.3V pin of the NodeMCU, but the current that is provided by the AA alkaline batteries is only 50 mA per battery. Connected in series you still get an overall current of 50 mA.
Unfortunately the ESP32 NodeMCU can draw up to 300 mA while booting. When the ESP32 starts up, it pulls so much current out of the AA alkaline batteries that the voltage drops entirely to zero, resetting/crashing the ESP32.
In summary, I can not power the ESP32 NodeMCU with 2 AA batteries.
LiFePO4 Battery for ESP32
|LiFePO4 Battery Criteria||Specification|
|Minimum discharge voltage||2.5V|
|Maximum charge voltage||3.65V|
|Number of recharges||5000|
|Energy density||90 Wh/kg … 160 Wh/kg|
The lithium iron phosphate battery (LiFePO4 battery) has a nominal voltage of 3.2V and a maximum voltage of 3.65V. The main advantage of a LiFePO4 battery is the very flat discharging curve so that the voltage drops very slowly during the discharging process. Because the maximum voltage of the lithium iron phosphate battery is with 3.65V only slightly higher than the maximum operation voltage of the ESP32 with 3.6V, you can connect this type of battery directly with the 3.3V pin of the microcontroller.
In summary a LiFePO4 battery is very suitable for the ESP32 and especially when your main goal is to power your circuit for a maximum time. If this is the case, I recommend to power the ESP32 with a LiFePO4 on the 3.3V pin.
The downside is, that it is very complicated to charge the battery while in use. Currently I have no solution for this problem. The easiest solution would be to have two LiFePO4 batteries that you can quickly change and en external battery charger.
LiPo Battery and Li-ion Battery for ESP32
|LiPo and Li-ion Battery Criteria||Specification|
|Minimum discharge voltage||2.7V...3.0V|
|Maximum charge voltage||4.2V|
|Number of recharges||5000|
|Energy density||100 Wh/kg … 265 Wh/kg|
AAA NiMH Batteries for ESP32
|AAA NiMH Batteries Criteria||Specification|
|Minimum discharge voltage||0.8V|
|Maximum charge voltage||1.4V|
|Number of recharges||1000|
|Energy density||60 Wh/kg … 120 Wh/kg|
If you want to buy AAA batteries, make sure you buy NiMH batteries, because they are rechargeable and have the highest capacity and a nominal voltage of 1.2V…1.25V per battery. The combination with four AAA NiMH batteries result in an operation voltage of 4.8V…5V which is higher than the maximum operation voltage of the ESP32 with 3.6V.
Just like LiPo and Li-ion batteries you can use four AAA NiMH batteries in combination with a LDO regulator that reduces the input voltage to 3.3V. With the reduced voltage, you can connect the power supply to the 3.3V pin of the ESP32.
Compared to the LiPo and Li-ion batteries, NiMH batteries needs the same connection to the microcontroller but have a lower energy density and therefore I do not recommend to use the NiMH batteries.
9V Alkaline Block Battery for ESP32
|9V Alkaline Block Battery Criteria||Specification|
|Minimum discharge voltage||6V|
|Maximum charge voltage||9.9V|
|Number of recharges||500|
|Energy density||80 Wh/kg|
With a 9V block battery, you can use the VIN pin of the NodeMCU, that is internal connected with the 3.3V AMS1117 voltage regulator. Therefore you need no external components. But because the ESP32 only needs 3.3V, you are overpowered regarding the voltage. Because a 9V Alkaline block battery is nothing else than 6 AA Alkaline Batteries connected in series, you have the same step discharging curve resulting in a short lifespan of your battery powered system.
Therefore I do not recommend to use a 9V Alkaline block battery.
Low-dropout Voltage Regulator for ESP32
The MCP1725T-3302E/MC fits perfect to the ESP32 in combination with batteries has have a maximum voltage higher than 3.6V. The following tables shows the fundamentals of the LDO datasheet and explains why these fundamentals match perfect to the ESP32.
|Output voltage||3.3V||The regulator needs an output voltage equal to the operating voltage of the ESP32 that is 3.3V.|
|Output current||500mA||It is also important that the LDO has an output current of 500mA because the ESP32 needs around 450mA during the WiFi communication and in the datasheet of the ESP32 an output current of 500mA is recommend.
|Maximum input voltage||6V||With a maximum input voltage of 6V, we are able to combine the LDO with the 3.7V LiPo and Li-ion batteries as well as the 5V AAA NiMH batteries.
|Minimum input voltage||2.3V||The minimum input voltage should match the minimum operation voltage of the ESP32 which is 2.3V.|
If you have any questions about the different batteries and how to use them, please use the comment section below to ask your questions. I will answer then as soon as possible.