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.

Battery Thumbnail

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.

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.

MicrocontrollerMinimum VoltageTypical VoltageMaximum 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 RegulatorOutput VoltageMaximum Input VoltageMaximum 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 CriteriaSpecification
Minimum discharge voltage1V
Working voltage1.5V
Maximum charge voltage1.65V
Number of recharges500
Energy density80 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​ CriteriaSpecification
Minimum discharge voltage2.5V
Working voltage3.0V...3.2V
Maximum charge voltage3.65V
Number of recharges5000
Energy density90 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​ CriteriaSpecification
Minimum discharge voltage2.7V...3.0V
Working voltage3.7V
Maximum charge voltage4.2V
Number of recharges5000
Energy density100 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 for ESP32

AAA NiMH Batteries​ CriteriaSpecification
Minimum discharge voltage0.8V
Working voltage1.2V...1.25V
Maximum charge voltage1.4V
Number of recharges1000
Energy density60 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​ CriteriaSpecification
Minimum discharge voltage6V
Working voltage9.0V
Maximum charge voltage9.9V
Number of recharges500
Energy density80 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 voltage3.3VThe regulator needs an output voltage equal to the operating voltage of the ESP32 that is 3.3V.
Output current500mAIt 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 voltage6VWith 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 voltage2.3VThe 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 thoughts on “What is the best Battery for the ESP32”

    • Hi, 2x 1.5V Alkaline Batteries do not provide enough current for the ESP32. My recommendation would be to use a LiFePO4 battery that you can connect to the 3.3V pin and ground.

  1. Hi, you better read again Kirchhoffs law: Regards AA Alkaline Batteries:
    once the max-current was 50 mA a single-cell, then the current for 2 cells in series is still 50 mA and Voltage is 3V(nominal). For AA Alkaline, connecting them in parallel, the drawable current was 50mA*2 for a short time, since AA-Alkaline swing and eat up current from each other. Aditionally: NEVER suggest ALKALINE-Cells being charged with external current !!! You may reenergise Alkaline (Zn-C) reducing gas in the dielectric through forcing that process with temp-change for 40°C for 30 Minutes and cooling again before use (this way the travel of ions in the dielectric is supported for a short time).
    Your suggestion for a recharable Lithium batterie is for the very use of continuous WiFi quite OK. But realy: The best power source is defined by the Use-case. In an article like yours, where I appreciate your attempt, the use and dimension of buffer-capacitors and with expectance of sharp peaks (power-on / Pwr-Switch) the use of filter-configurations (L/C L/R C/R) on special use shall be at least mentioned.

    • Hi Wolf,
      thx for your input. You are totally right with the 2 AA Alkaline Batteries in series: The draw-able current is still 50 mA.
      In my opinion I do not suggest to recharge Alkaline Batteries. The Maximum charge voltage is only the information that if the battery is new, the voltage is higher than the nominal voltage and can hurt the ESP32.
      The suggestion of the batteries is only my personal opinion and of course depends on the use case.
      The missing part of buffer-capacitors is a good point. I will take a look at this topic and include this part in the article.

  2. Hello,

    Okay, now we know the LiFePO4 is the best battery for ESP32, but how to install and charge it?

    My goal is to build a permanent enclosure so the battery is permanently installed and connected to a simple battery power indicator and female USB input (both built into the side of the enclosure). That way, when the battery is low, I can take a USB charger and plug it in overnight to charge it up.

    Does anyone have experience with this?


Leave a Comment