Run ESP with Batteries – and Style

Run ESP with batteries + best battery holder ever!

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.

VmAhSelf discharge / MonatProConPrice / Battery
in €
Price / Ah
in €
Price / Ah 
at min. 2.5 V in €
Powerbank520100ca. 4%easy installationhigh energy waste due to multiple level shifting of the voltage (internal 3.7 V -> 5V -> 3.3 V in ESP), switches off, large form factor35.991.791.79
Batteries (Primary-Cells)
Alkaline
AA
1.52000ca. 6%cheapearly onset of voltage drop, approx. 50-70 % of the energy remains unused, current peaks of the ESP too large with WiFi, not rechargeable0.240.120.24
Lithium
CR123
316001-2%only well working variant for non-rechargeable batteriesnot rechargeable2.191.531.53
Lithium
CR2
38801-2%like CR123like CR123, but less capacity2.192.482.48
Accumulators (Secondary Cells)
NiMH
AA
1.22000ca. 25% (!)cheaphigh self-discharge, memory effect,
too close to the voltage limit
1.600.802.40
LSD-NiMH
AA
1.220001-3%no memory effect, low self-dischargetoo close to the voltage limit,
expensive
4.982.497.47
Lithium
AA
1.52200ca. 4%no memory effect, low self-discharge, much capacitymore expensive6.252.845.68
LiFePo
AA
3.2600ca. 3-5%no memory effect, low self-discharge, much capacitymost expensive, low capacity4.607.667.66
LiFePo
ANR26650M1B
3.22500ca. 3-5%no memory effect, low self-discharge, much capacityexpensive, large form factor10.904.364.36
Status: 18. Februar 2021

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!

Image

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.

Multiple level shifting when operating with a powerbank

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.

Batteries connected in series
Batteries connected in parallel

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 ... 😍


... the two of us! Then I will also write you a personal mail when there is news – for example new downloads, projects or videos. Just enter your email and you will receive the RAYDIY newsletter full of info, moderate sending frequency and Nutri-Score A.

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

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

3D Model & Infos