What is the best Battery for the ESP32

What is the best battery for the EPS32?

In this article you learn what is the best battery for the ESP32 microcontroller.

First I describe the different voltage levels on the NodeMCU board to avoid magic smoke and a damage of the ESP32. The researched batteries are:

  • AA Alkaline batteries
  • LiFePO4 battery
  • LiPo and Li-ion Battery
  • AAA NiMH batteries
  • 9V Alkaline block battery

On top of all this content, you learn which batteries need a voltage regulator and how to use such a regulator.

Battery Thumbnail

IThe 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

Table of Contents

ESP32 Voltage Levels

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.

ESP32 voltage overview

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
ESP32 2.3V 3.3V 3.6V

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
AMS1117 3.3V 15V 1A

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.

AA Alkaline Batteries

Minimum discharge voltage 1V
Working voltage 1.5V
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

Minimum discharge voltage 2.5V
Working voltage 3.0V...3.2V
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

Minimum discharge voltage 2.7V...3.0V
Working voltage 3.7V
Maximum charge voltage 4.2V
Number of recharges 5000
Energy density 100 Wh/kg … 265 Wh/kg
The maximum voltage of LiPo and Li-ion batteries are around 4.2V and too high to connect directly to the 3.3V pin. Therefore you need a low-dropout or LDO regulator that reduces the battery voltage to 3.3V. The MCP1725T-3302E/MC LDO fits perfect to the ESP32 in combination with a LiPo or Li-ion battery. In the last chapter of this article you find a detailed explanation how to use the LDO regulator in combination with a battery and the ESP32. LiPo and Li-ion batteries in combination with a low-dropout voltage regulator are a good fit to power your ESP32. Especially if you want to charge the battery while your circuit is running, LiPo battery packs are my favorite choice because there are special EPS32 boards with a JST connector where you connect the LiPo battery directly to your ESP32 board. If you want to charge the battery, you only have to plug the micro USB cable into the EPS32. The USB connection not only powers the EPS32 but also charges the LiPo battery pack. The following boards have the JST connector as well as a LiPo charger onboard:

AAA NiMH Batteries

Minimum discharge voltage 0.8V
Working voltage 1.2V...1.25V
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

Minimum discharge voltage 6V
Working voltage 9.0V
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

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.

MCP1725T-3302E/MC Explanation
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.

16 Responses

Leave A Comment