Powering an ESP with batteries: which batteries and rechargeable batteries are best suited to power ESPs or similar microcontrollers?
In this article, I'm focusing on efficiency and effort. I often get feedback that you could just as well use battery type XY. Yes, of course that works too, but only with extra effort, such as voltage converters and energy losses. What I wanted to know was:
Which battery or rechargeable battery can power an ESP directly, without additional components and without voltage conversion?
I'll also show you one of the best ways to mount batteries in your project case and how to build a tidy power supply: with the Flex Battery Holder from the 3D printer!
Which Batteries Work Best for an ESP32
- For rechargeable batteries, LiFePO4 cells are the best fit, because their voltage matches exactly what the ESP32 needs. No conversion required.
- For non-rechargeable batteries, the CR123 or the smaller CR2 batteries are the best fit. Here, too, the voltage matches the ESP32's requirements best.
- Other battery types, such as Li-Ion, may supply too much voltage. In that case, the voltage may have to be reduced, e.g. with a step-down converter.
- To keep batteries from rattling around in your project case, you can print a battery holder such as the Flex Battery Holder.

Subscribe now
and get a free eBook!What Voltage Does an ESP32 or ESP8266 Need
Running an ESP32 project on batteries is really handy. But which batteries should you use? Or rather rechargeable batteries? Or maybe a power bank? Let's get to the bottom of it.
I've put together an overview of the most common types of batteries and rechargeable batteries. Let's go through them together and sort out what's out of the question.
But first we need to answer an important question: what voltage do we need to run an ESP?
A quick look at the data sheets of the ESP8266 and ESP32 clears this up: the ESP32 needs a voltage of at least 2.3 and at most 3.6 volts. The ESP8266 needs at least 2.5 and at most 3.6 volts.
Recommended voltage: 3.3 volts.
That's settled. Now let's take a look at the battery table.
Overview Table: Batteries & Rechargeables
About the Table
mAh
The capacity in mAh depends on the manufacturer and the type of battery. I picked battery and rechargeable battery models that I already use or that showed up first when I searched online.
Price per battery
Batteries often come in multipacks. So for a better comparison, I calculated the price of a single battery.
Price per Ah
Then I calculated the price per ampere-hour. After all, what good is a cheap single battery if it only lasts a third as long by comparison?
Price per Ah at min. 2.5 V
And in the last column, I calculated the price per ampere-hour taking into account the minimum supply voltage of the ESP. Depending on a battery's nominal voltage, you need two or three batteries or rechargeables to run the ESP. For this, I used the ESP8266's minimum voltage of 2.5 volts as the basis. That way, the ESP32, which needs at least 2.3 volts, is covered as well.
Power Bank
Let's start with the power bank. Two things bother me here: power banks are usually built from 3.7 volt lithium cells. That means internally, 3.7 volts are stepped up to 5 volts, because the USB standard calls for a 5 volt output voltage.
Power banks, like all lithium-ion cells, don't make the cut in this case, because the voltage ESPs need can only be reached through voltage conversion.
Conversions like these always cause losses.
If you then feed these 5V into the ESP via the USB port, the 5 volts are stepped back down to 3.3 volts on the ESP. So yet another voltage conversion.
Another problem: all the power banks I tried with the ESP32 shut themselves off automatically, at the latest once the ESP was in DeepSleep mode. At that point, the ESP draws so little current that the power bank thinks nothing is connected anymore.
Power banks are technically possible, but not ideal, so they're out.
Alkaline Batteries
Let's move on to the so-called primary cells, i.e. non-rechargeable batteries.
First up is the standard AA battery, based on alkaline manganese.
AA describes the form factor of batteries or rechargeables (see also the table of size designations). Alkaline refers to the chemical composition inside the battery.
These have a nominal voltage of 1.5 volts. We can connect two of them in series so that the voltage adds up to 3 volts.
With batteries connected in series, i.e. opposite poles connected to each other, the voltage adds up and the capacity stays the same.
With batteries connected in parallel, i.e. like poles connected to each other, the capacity adds up and the voltage stays the same.
You'd think the voltage (volts) of a battery always stays the same and only the stored charge (mAh) decreases as the battery is used. Unfortunately, that's not the case.
All battery and rechargeable battery types have a voltage drop effect. And this voltage drop increases the emptier the battery gets. How strong this effect is also depends on the battery or rechargeable type.
With alkaline batteries, this effect is quite strong. So you may only be able to use 30, 40 or maybe 50% of the battery before the voltage gets too low.
By the way, the effect also works the other way around: freshly charged rechargeables initially have a higher voltage than their actual nominal voltage.
Common Battery Size Designations
What Happens When a Microcontroller Gets Too Little Voltage?
When the voltage is too low, so-called brownouts set in first. The microcontroller doesn't simply turn off; instead, components gradually fail or become unreliable. The microcontroller then "goes haywire".
Another problem: when the ESP uses WiFi, current spikes of up to 400 mA can occur. Alkaline batteries can't handle that.
Alkaline batteries are technically possible, but not ideal, so they're out.
CR123A & CR2 Lithium
CR123 or CR123A batteries are often used in cameras. They supply 3 volts.
You can sometimes find them as rechargeable batteries too. But then they often have 3.7 volts, which unfortunately is too much voltage for our purposes.
With lithium batteries, the voltage drop effect is very small, so you can use a large part of the battery's capacity. And precisely because these batteries can also handle camera flashes with their short but high current demand, the ESP's WiFi-related current spikes are no problem.
The CR2 has a smaller form factor than the CR123 and less capacity, but is otherwise the same.
From a technical point of view, and in terms of the requirements of this article, these batteries are a good choice for powering ESPs from batteries.
NiMH Rechargeable Batteries
Now let's move on to rechargeable batteries, the so-called secondary cells.
A nightmare! What's the first thing that comes to mind when I think of regular nickel-metal hydride batteries? The immense self-discharge. I've barely charged the empty batteries and put them away in the cupboard, and a month later they're empty again, just from sitting around.
Apart from self-discharge, we're also scraping the limit when it comes to voltage.
These batteries have a nominal voltage of 1.2 volts. If we connect two in series, we get 2.4 volts. That's only 0.1 volts away from the absolute minimum the ESP needs. If the voltage drop effect mentioned above then kicks in as well, we can again only use a fraction of the capacity.
If we connect three in series, we're at 3.6 volts. Fully charged batteries can have more than their nominal voltage before the voltage drop effect sets in after a short while.
Nickel-metal hydride batteries are technically possible, but not ideal, so they're out.
NiMH Batteries with Low Self-Discharge
Nickel-metal hydride batteries on LSD? Yes, but a different kind of LSD.
There are nickel-metal hydride batteries with low self-discharge, so-called LSD nickel-metal hydride batteries. In this case, LSD stands for low self-discharge.
Examples include the well-known eneloops, Ikea LADDA or Aktiv Energy from Aldi, just to name three. On Wikipedia you'll find a list of probably 40 different brands.
With the LSD variant, self-discharge really has been optimized very well and is even said to be better than that of regular alkaline batteries. In my research, only the CR123 batteries had better self-discharge figures according to the manufacturers' specifications. I haven't measured this myself, though.
For standard devices that are meant to run on rechargeable batteries, I would always use these.
For use with the ESP8266 or ESP32, however, the same limitations apply as with classic nickel-metal hydride batteries: the voltage sits too close to the upper and lower limits.
Nickel-metal hydride batteries are technically possible, but not ideal, so they're out.
Lithium-Ion and Lithium-Polymer Batteries
Finally, let's look at the more expensive lithium-ion and lithium-polymer batteries.
We can rule out all 3.7 volt lithium-ion batteries right away: they have too much voltage, or you have to step it down again, which is exactly what we want to avoid. I already mentioned this with the power banks.
In terms of their current and voltage specs, lithium-polymer batteries are the same as lithium-ion batteries. Their only advantage is that lithium-polymer batteries are more flexible in shape. So if a battery needs a specific shape because it wouldn't otherwise fit into a slim laptop case, lithium-polymer batteries are usually used, since they give device designers more freedom.
Lithium-ion and lithium-polymer batteries are technically possible, but not ideal, so they're out.
LiFePO4 Rechargeable Batteries
A better fit, and also available in AA format, are so-called lithium ferrophosphate batteries (lithium iron phosphate, usually abbreviated as LiFePO4). These LiFePO4 batteries supply a voltage of 3.2 volts, exactly the voltage we need!
Quick tip: LiFePO4 cells are often found in those small solar garden lights that try to light our way at night. Before you throw them in the trash, check whether there are still usable LiFePO4 cells (and solar cells) inside, because they aren't exactly cheap.
Compared to lithium-ion, LiFePO4 has a somewhat lower energy density. That means a bit less energy fits into the same form factor.
In addition to the safety aspect (see below), LiFePO4 batteries match the voltage of ESPs well and are therefore my first choice when it comes to rechargeable batteries for the ESP32 and ESP8266.
The Safety Aspect of LiFePO4 Batteries
LiFePO4 batteries are considerably more expensive, but I'm happy to pay the extra, because I have a huge amount of respect for lithium-ion batteries. They can quickly burst into flames as soon as air or water gets to them.
If you, like me, enjoy opening up old devices to take a closer look or salvage parts, be careful: I once pried a smartphone open a bit too forcefully with a spudger and damaged the battery. Within seconds, the battery caught fire.
Lithium-ion batteries also often swell up over time. This can rupture the protective casing and let air in.
None of this happens with LiFePO4, which lets me sleep more soundly.
How to Charge LiFePO4 Batteries
A word about chargers: for LiFePO4 batteries, you need a special charger that can handle them. Don't use the charger you use for your nickel-metal hydride batteries! Those charge with different voltage and current curves, which will make LiFePO4 batteries boil (I unfortunately had to learn that the hard way).
By the way, lithium-ion batteries also need a special charger, since they use yet another voltage curve.
There are, however, switchable chargers that can charge nickel-metal hydride, lithium-ion, LiFePO4 and nickel-cadmium batteries. I've picked out one of these chargers for you, shown alongside.
Flex Battery Holder: Mounting Batteries in the Case
To keep the batteries from rattling around in your project case, I'll show you a really good way to mount them. Whenever I use batteries in my projects, I always use this wonderful set of holders that I discovered on Thingiverse.
On Thingiverse, the author is listed under the username enif. Elsewhere I found the name Heinz Spiess, and I think it's the same person. My thanks for this excellent design!
The brilliant thing about this holder: the designer built in a 3D-printed spring system that clamps the batteries in place.
The Thingiverse download includes 10 different battery formats, each in several variants, some of which hold up to six batteries.
There's also a SCAD file you can use to create your own variants if you know your way around OpenSCAD. I haven't tried that yet, though.
For the contacts, you'll also need some silver wire and insulated stranded wire to connect the holder to your project.
Conclusion
If it needs to be rechargeable, LiFePO4 batteries are the best choice. The voltage matches and nothing needs to be converted.
For non-rechargeable batteries, only the CR123 or the smaller CR2 batteries come into question, because their voltage is just right.
If you don't mind an additional voltage conversion and the losses that come with it, you of course have a much larger selection. In that case, though, you need to make sure to integrate a suitable voltage converter into your circuit.
Links & Product Recommendations
Links on Power Supply
Subscribe now
and get a free eBook!





