The heart of our Weather Station is an ESP8266 SOC which is a power-hungry chip. When your project is powered by a plug-in the wall, you tend not to care too much about power consumption. But if you are going to power your project with batteries, every mA counts.
Our objective is to run the device by using a 18650 Li-Ion battery. To run the ESP32 by using a battery, we have to lower the power consumption. To do that, we’ll use the Deep Sleep Mode which is the most power-efficient option for the ESP chip. It allows to put the ESP32 into hibernation and saves the battery. You can wake up the ESP at regular intervals to make measurements and publish them.
Calculating Battery Life:
The ESP32 consumes around 75mA in normal operation and hits about 150mA while transmitting data over WiFi. and in Deep Sleep about 10uA. The ESP32 takes ~ 30secs to upload data.
Battery Life calculations:
Battery Used: 3400mAh / 3.7V 18650 Li-Ion
Publish Interval = 10mins ( ON Time: 30 sec and Sleep Time: 9 mins 30 sec )
Total number of Readings / Hour = 60/10 = 6
Power consumption per hour (ON time) = 6 x 150 mA * 30 / 3600 = 7.5mA
Sleep time = 6 x 10uA * 570 / 3600 = 0.0095 mA
Total time in hours on battery = 3400 / (7.5+0.0095) = 452.76Hrs
Total days on battery = 452.76/24 = 18.86 Days
I have prepared an excel sheet for calculating the battery life. It is attached below, you can use it.
Image Credit: lastminuteengineers.com