Power ESP with batteries! Plus: the best battery holder ever! Which batteries and accumulators are best suited to supply ESPs or similar microcontrollers with power? We’ll clarify that in this article. I’ll also show you one of the best ways to mount batteries in your project case and how to create a tidy power supply: with the Flex Battery Holder from the 3D printer!
Hey!
Runing your ESP based project on batteries is quite nice, because … well … it’s wireless! But which batteries should you use? Or rather rechargeable batteries? Or maybe a powerbank? We go to the bottom of the matter.
I’ve created an overview of the most common types of batteries and rechargeable batteries. We’ll fly through it right away and sort out what’s out of the question.
But first of all: what voltage do we actually need? A quick look at the data sheet of ESP8266 and ESP32 clarifies – the ESP32 needs a voltage of at least 2.3 to a maximum of 3.6 volts. The ESP8266 needs a minimum of 2.5 and a maximum of 3.6 volts. Recommended voltage: 3.3 volts.
That’s cleared up. Let’s have a look at the battery table.
V | mAh | Self discharge / Monat | Pro | Con | Price / Battery in € | Price / Ah in € | Price / Ah at min. 2.5 V in € | |
---|---|---|---|---|---|---|---|---|
Powerbank | 5 | 20100 | ca. 4% | easy installation | high energy waste due to multiple level shifting of the voltage (internal 3.7 V -> 5V -> 3.3 V in ESP), switches off, large form factor | 35.99 | 1.79 | 1.79 |
Batteries (Primary-Cells) | ||||||||
Alkaline AA | 1.5 | 2000 | ca. 6% | cheap | early onset of voltage drop, approx. 50-70 % of the energy remains unused, current peaks of the ESP too large with WiFi, not rechargeable | 0.24 | 0.12 | 0.24 |
Lithium CR123 | 3 | 1600 | 1-2% | only well working variant for non-rechargeable batteries | not rechargeable | 2.19 | 1.53 | 1.53 |
Lithium CR2 | 3 | 880 | 1-2% | like CR123 | like CR123, but less capacity | 2.19 | 2.48 | 2.48 |
Accumulators (Secondary Cells) | ||||||||
NiMH AA | 1.2 | 2000 | ca. 25% (!) | cheap | high self-discharge, memory effect, too close to the voltage limit | 1.60 | 0.80 | 2.40 |
LSD-NiMH AA | 1.2 | 2000 | 1-3% | no memory effect, low self-discharge | too close to the voltage limit, expensive | 4.98 | 2.49 | 7.47 |
Lithium AA | 1.5 | 2200 | ca. 4% | no memory effect, low self-discharge, much capacity | more expensive | 6.25 | 2.84 | 5.68 |
LiFePo AA | 3.2 | 600 | ca. 3-5% | no memory effect, low self-discharge, much capacity | most expensive, low capacity | 4.60 | 7.66 | 7.66 |
LiFePo ANR26650M1B | 3.2 | 2500 | ca. 3-5% | no memory effect, low self-discharge, much capacity | expensive, large form factor | 10.90 | 4.36 | 4.36 |
Tables Explanation
Briefly about the data in the table. The capacity in mAh depends of course on the manufacturer and model. I just picked out battery and accumulator models here that I already use or were shown first on the internet. Welcome to my bubble ?
Price per battery: often they come in a multi-pack, then I have calculated the price of the single battery here for better comparison.
Then I calculated the price for an amp hour. Because what does it help if the single battery is cheap, but only a third as long holds out until they are empty.
And in the last column I calculated the price per ampere-hour considering the minimum supply voltage of the ESP. Depending on the nominal voltage of a battery, you may need two or three batteries or accumulators to get the ESP running. For this I used the minimum voltage of the ESP8266 of 2.5 volts. So the ESP32 is also covered with a minimum of 2.3 volts.
Affiliate Links Notice
In this article I use so-called affiliate links. If you use these links, I get a small commission from the linked merchant.
This has no influence on your purchase price - the price stays the same for you!
Powerbank
First we come to the powerbank: two things bother me here – powerbanks are usually built from 3.7 volt lithium cells. I.e. internally 3.7 volts are converted to 5 volts, because the USB standard wants 5 volts.
Such conversions always cause energy losses.
If you then feed this 5V via the USB port into the ESP, the 5 volts are converted back down to 3.3 volts on the ESP. Losses again. In the truest sense – not cool.
But the biggest problem: all the powerbanks I tried on the ESP automatically shut down, at the latest when the ESP is running in DeepSleep mode. Then the ESP consumes so little power that the powerbank thinks there is no consumer connected anymore.
Powerbank is therefore out.
Mignon Alkali
Now we come to the primary cells, the non-rechargeable batteries.
First we have the standard AA or Mignon battery, which is based on alkaline manganese. They have a nominal voltage of 1.5 volts. Of these, we can connect two in series so that the voltage adds up to 3 volts.
For batteries that are connected in series, that is, the opposite poles are connected, the voltage adds up and the capacity remains the same.
For batteries connected in parallel, that is, when the same poles are connected, the capacity adds up and the voltage remains the same.
However, all types of batteries and accumulators have a voltage drop effect. And this voltage drop increases the emptier the battery is. The strength of this effect also depends on the battery or accumulator type. With alkaline batteries this effect is quite strong. So it can happen that you can only use 30, 40 or only 50% of the battery, because then the voltage becomes too low.
Brownouts
What actually happens when the voltage is too low?
Then so-called brownouts set in. The microcontroller does not simply go out, but components gradually fail or become unreliable. The microcontroller then “goes crazy”.
Another problem: if the ESP uses WiFi, current peaks of up to 400 mA can occur. Alkaline batteries cannot cope with this.
Ok, alkaline batteries are out too. What else do we have …
CR123A & CR2 Lithium
CR123 or CR123A batteries are often used in camera applications. These provide 3 volts.
They can sometimes be found as rechargeable batteries. However, then often with 3.7 volts – unfortunately too much voltage for our purposes.
With lithium batteries, the voltage drop effect is very low, so you can use much of the battery capacity. Especially because these batteries can also handle camera flashes and their short but high current demand, the WiFi related current peaks of the ESP are no problem.
The CR2 is more or less the small diverse sibling. Slightly smaller form factor and less capacity but otherwise the same.
From a technical standpoint, these batteries are a good choice for supplying battery power to ESPs.
Now we come to the rechargeable batteries or secondary cells.
NiMH batteries
A horror! What do I think of first when I think of the usual nickel-metal hydride batteries? Exactly, the immense self-discharge effect. Nicely charged the empty batteries and packed them in the cupboard. A month later I took them out again to feed the flashlight – the battery was empty. Great sausage.
But aside from self-discharge, we’re scraping the edge here with voltage.
These batteries are rated at 1.2 volts. If we take two in series, we get 2.4 volts. That’s only 0.1 volts away from the absolute minimum that the ESP needs. If now the voltage drop effect mentioned above kicks in, we can again only use a fraction of the capacity.
If we take three batteries, we are at 3.6 volts. 100% charged batteries can also have a little more voltage before the voltage drop effect sets in after a short time. Three nickel-metal hydride batteries I therefore do not recommend – is me personally “too hot”.
NiMH batteries with low self-discharge
Hah, nickel metal hydride batteries on LSD! There are also these fast nickel-metal hydride batteries with low self-discharge or LSD nickel-metal hydride batteries. LSD stands, in this case, for low self-discharge.
There are for example the well known enerloops or Ikea LADDA or Aktiv Energy from Aldi, just to name three. Below I have added a link, there you will find 40 different providers.
In the LSD variant is actually the self-discharge has been optimized excellent and should even be better than the usual alkaline batteries. In my research, the self-discharge values in the manufacturer’s specifications were better only with the CR123 batteries. However, I have not measured this.
For standard device applications, which should be operated with rechargeable batteries, I would always take such batteries.
For the use on the ESP8266 or ESP32, however, the same restrictions apply as with the classic nickel-metal hydride batteries: the voltage is too much at the upper and lower limit.
Lithium batteries
Now we come to the more expensive lithium based batteries. All lithium batteries with 3.7 volts we can already leave out – too much voltage or you have to convert back down, which we want to avoid.
But I found Lithium batteries in Mignon format with 1,5 Volt nominal voltage. So here you would have to connect two in series to get to 3 volts.
And then there are Lithium Ferrum Polymer batteries (LiFePo) with 3.2 volts, also in mignon format. By the way, these are often found in the solar lamps that try to light our way at night.
Last but not least, I found a more exotic form factor. Also LiFePo with 3.3 volts and decent capacity whammy, as Olaf Scholz would say.
Wait, why do they have so much capacity? Don’t let the picture fool you. They’re pretty big. You should first check whether they fit into the project case – and into your charger.
Speaking of chargers: with lithium-based batteries you need a charger that can handle lithium batteries. Very important – don’t use the charger that you use to charge your nickel-metal hydride batteries.
Technically, there is nothing wrong with these three lithium variants. Only the price is of course higher. But they are rechargeable.
Conclusion
Lithium based batteries are obviously the best.
If it should be rechargeable, then all three presented lithium batteries come into question. Then you just have to weigh how much capacity you want or how many batteries you can fit in the case.
For the non-rechargeable ones, only the CR123 or the smaller CR2 batteries come into question.
Hey! How about ...
Battery Flex Holder
So now I’m going to show you another really gnarly thing to mount batteries in a project case. When batteries are used in my projects, I always use this wonderful set of holders that I discovered on Thingiverse.
What we need
- 3D Printer
- Flex Battery Holder on Thingiverse
- Silver wire
- Insulated wire (stranded wire)
- LiFePo Accumulators or CR123 Batteries
On Thingiverse it says the author has the username enif. Elsewhere I found the name Heinz Spiess. I think it is the same person. My thanks for this excellent design.
The fantastic thing about this mount is that the designer has included a 3D printed spring system, which clamps the batteries in place.
In the download from Thingiverse, 10 different battery formats come with it. And these then also in different quantity variants, with which one can accommodate partly up to six batteries.
In addition, there is also a SCAD file, with which you can probably create your own variants, if you can handle SCAD. But I haven’t tried it yet.
I will now show you how I use and prepare the holders. Because with the contacts for the batteries you have to tinker a bit.
Therefore we print out one of the holders for two CR123 batteries.
Conclusion
Ok, now you know which batteries I would use and how I mount them in the housing. All links, batteries and tools used in this article are listed below.
If you liked the article, check out my YouTube channel. Subscribe and don’t forget the bell.
Keep tinkering, stay healthy and make sure you have the right voltage – in every aspect.
Bye 😉
Links
Batteries & Accumulators from this article
- Anker Powerbank, 5V, 20100 mAh
- Amazon Basics AA Alkali Batterie, 1,5V, 2000 mAh
- Varta CR123A Lithium Batterie, 3V, 1600 mAh
- Varta CR2 Lithium Batterie, 3V, 880 mAh
- Amazon Basics AA NiMh Akkus, 1,2V, 2000 mAh
- LSD-NiMh AA eneloop XX Pro, 1,2V, 2000 mAh
- Lithium AA Akku, 1,5V, 2200 mAh
- LiFePo AA Akkus, 3,2V, 600 mAh
- LiFePo ANR26650M1B Akkus, 3,3V, 2500 mAh