ESP32/ESP8266 Reduce Battery Consumption and Battery Selection

(Last Updated On: July 18, 2021)


Reduce the ESP32 and ESP8266 Battery Consumption- In this article, we will discuss the various techniques to reduce the battery load of the ESP32 and ESP8266. If you run your projects on battery power there are some techniques that you can employ to reduce the total power consumption. So these hints and tips are really aimed at a CPU that’s spends a lot of its time in wake and sleep cycles and the longer its awake the more power it consumes. So reducing the on time is critical. In my previous article I explained how to save or reduce power for the Arduino board using Sleep Modes, the same thing I also explained for the ESP32 and I explained different deep sleep modes.

Turn WiFi ON and OFF when needed:

So the first technique is to only turn on the Wi-Fi when you need it so do not routinely set it on when you go through the setup routine turn it on just before it’s needed and then when you finish turn it off that makes a significant difference in power consumption and there are some examples for the esp8266 and the ESP32 which are broadly the same.

Now let us consider the first code in which the WiFi remain ON for all the time.

While in the second case the wifi will be turned on when needed and this what you need to do if you seriously want to reduce the battery consumption for power.

Remove or reduce all delays:

The second technique  is to reduce delay times to zero or remove them completely but just making them shorter reduces the amount of CPU time consumed on battery and in most cases they are not required they are for diagnostic purposes for but not for general operation unless you are interacting with some external hardware.

For example this code will cause extra power consumption because we have given delays in the code.

Now when we remove or reduce the delay, the power consumption of the module will also be reduced. We reduce the delay to 100 which is equal to 0.1s

Increase the Resistance:

The next tip is to increase your resistance values if you have got a voltage divider to monitor battery voltage don’t use very low value.

esp32 esp8266 reduce battery consumption

So, on the left-hand side I’ve used 1k resistors to divide the voltage into but that puts a permanent load on the battery of two milliamps whereas if you use two larger values again giving you the same voltage division the current consumption is dramatically reduced.

In the left hand circuit the battery load current is 2.1mA while in the right hand side circuit the battery load current is 0.01 mA.

So if you are into getting every last milliamp per hour reduction or improvement uses high values as practicable and in both cases I have  assumed there is no current flow into the ADC input but in practice there is but it’s usually very small.

Set the Serial.Println to Maximum speed:

In this tip just changing the serial speed the baud rate of the serial port can make a big difference in time consumed by the program. So, for example, we have written simple programs, print hello world and temperature whatever in which we set the baud rate to 9600 and that takes approximately 30 milliseconds to complete, each serial character takes the baud rate times 10 bits to complete.

While on the other hand if you improve this bit of serial speed for this case I have used 15200 baud exactly the same function takes a fraction of the time approximately 0.002 seconds.

So it’s 30 milliseconds saved but it’s 30 milliseconds of battery power that you have saved when again when you are trying to get there absolute maximum from your battery life.

Use the IDE to Monitor ON timing:

In the Arduino IDE there is a function called show time stamp there so switch it on and monitor the time is that what’s displayed is the time of arrival of any characters from the serial port and that’s a useful function to monitor program progress and where if you put diagnostic prints in where each part of the program is taking time and if you are on battery power your aim is to reduce that down to a shorter possible time.

esp32 esp8266 reduce battery consumption

In summary then some fairly basic simple common-sense tips hints and to reduce battery power or consumption:

  • when on battery turning that Wi-Fi ON only just before you need to get some time or send data to a web server or receive data from a web server or a cloud service and turn it off as soon as you finish with it.
  • Remove or reduce all of your delays, increase resistor values across your whole design to as high as is practicable only.
  • Switch your GPIO pins to output when needed or when your loads require
  • Don’t use slow serial port speeds that just consumes time doing nothing and use the IDE facilities to assess program runtime and optimize that for the shortest possible time
  • most of these hints and tips can all be done in software it’s just a different way of approaching the problem

 Ideal Battery Technology to Power 3.3V Devices like the ESP8266 and ESP32:

Now days most of the devices and sensors run on 3.3 volt there are many possibilities to power these modules. Today I want to concentrate on the five possibilities to power these modules for mobile applications and find out which is the best because we all love esp8266 I use this chip as an example according the datasheet, esp8266 modules have an operating voltage of 3 to 3.6 volt which is about 3.3 volt plus and minus 10% what kind of technologies do we have to fulfill these needs.

Alkaline batteries:

The first technology is alkaline these batteries have a nominal voltage of 1.5 volt in reality they start at 1.5 and end at about 1 volt. We can use either 2 or 3 cells with 2 cells we are at the low side of the specifications this works with some modules but if we stop operation at 2.5volts we only used about 50% of the energy of the battery, the capacity of an AA battery is about 3300milli ampere hours but if we only can use half this is quite expensive because alkaline batteries are not rechargeable.

esp32 esp8266 reduce battery consumption

If we use three batteries we get 4.5 volt and are definitely way above specs. Therefore we need a 3.3 volt low dropout or LDO regulator which kills more than 10% of the capacity and at the end of the life the regulator shortens the useful voltage range because it always needs the dropout voltage so the overall loss capacity is in the range of 20 %.

esp32 esp8266 reduce battery consumption

Nickel Cadmium battery:

The second technology is nickel cadmium it’s voltage starts at 1.4 volt and ends at about one volt. Most of the time it is about 1.2 to 1.3 volt, with two cells we get only about 2.5 volts which is not enough with three cells. We get 3.6 volt average which is okay but if we look at the discharge curve.

esp32 esp8266 reduce battery consumption

We see that the voltage begins at about 1.38 volts, three times 1.38 V is 4.14 volt, this is too high for the specifications of many modules especially the esp8266. So this configuration should not be connected directly to 3.3volt chips and we need an LDO regulator to with a 20% waste the capacity of anickel cadmium AAA battery is less than1000 milliamp per hour and they are rechargeable.

Nickel metal hydride batteries:

Their voltage curve is very similar to the nickel cadmium batteries, the capacity however is more than the double and they are also rechargeable.

esp32 esp8266 reduce battery consumption

Lipo batteries:

The technology number four is well known to most of us it is lipo this technology does not come in AA or AAA packages because their voltage is three times higher and many devices would be roasted if consumer would take them for 1.5 volt types. We need an LDO voltage regulator to protect our devices also here twenty percent of the capacityis used by the regulator. One advantage of this technology is that we get many different packages and sizes especially the rectangular sizes fit often very good into project boxes.

esp32 esp8266 reduce battery consumption

LIFePO4 battery:

You get them in a in 18650 and also inrectangular packs the danger of mixing them with 1.5 volt batteries is that their voltage starts at 3.3 volt and ends at 2 volt. Most of the time it is around 3.2 volt if you do not need high currents then it fits our needs ideally no voltage regulator is necessary. Their capacity is smaller than the capacity of the lipo but because we do not need a regulator we also do not lose energy.

esp32 esp8266 reduce battery consumption

Recommended For You

About the Author: Engr Fahad

My name is Shahzada Fahad and I am an Electrical Engineer. I have been doing Job in UAE as a site engineer in an Electrical Construction Company. Currently, I am running my own YouTube channel "Electronic Clinic", and managing this Website. My Hobbies are * Watching Movies * Music * Martial Arts * Photography * Travelling * Make Sketches and so on...

Leave a Reply

%d bloggers like this: