Main Content

ESP8266 - 1+ Year 18650 battery lifetime

Around 1.5 year ago I started developing small sensors that could be placed around the house measuring temperature and humidity. The first few version did not last very long on their batteries (2xAA), around 1-3 months. So I spend some extra effort reducing average power consumption.

It has now been more then a year ago that I placed the first two sensors. Below is the reported battery level over the past year: (there is a slight offset between the readouts, the values are not calibrated).

The sensors are build from the following components:

ESP12-F or Wemos D1 mini
BME280
XC6206 3.3V ldo.
TrustFire 18650 cell with protection.

The sensor takes the following steps:

Wakeup
Enable and configure Sensor
Setup WiFi and connect
Take measurement
Connect to MQTT server
Push message
DeepSleep for 15 minutes
Lowering power consumption
The most critical thing for this sensor is to lower the average power consumption as much as possible.

Bypass Wemos D1 mini LDO
By feeding the wemos D1 3.3V directly we bypass the internal LDO. I later switched some over to using a ESP12-F modules to get rid of the serial to usb converter (and they are cheaper). However switching to ESP12-s, to save on external parts, failed as they have problem resetting themself. (Anybody in need for 10 ESP12-S modules that need two reset pulses to reset?)

Power off the BME280
Between samples, I make sure to fully poweroff the BME280. I do this by feeding it from one of the ESP8266 GPIO pins, so it can be powerdown. Some BME280 board you can buy (and in the above screenshot) have a build-in LDO to drop 5V to 3.3V . While it is unneeded it does not seem to make a lot of difference, given the short time powered on.

Store and restore Wifi settings
This is a tip I found on the internet. It used to work well with my old WiFi router. However with my new Unify accespoints I don’t think this tricks still works. Quick connect fails most of the time. But with the unify setup, connecting seems to be a lot quicker.

I followed the information presented here;

Disable DHCP, use static ip
This is a big time saver, using a static IP reduces a lot of on time. It removes around 40% of the on time.

Results
All these changes resulted in an idle current of around 26 µA (including ldo). The on time is harder to determine, as it varies between 1 and 3 seconds depending on variables.

The battery I bought is a TrustFire 3400mAh. Unexpected, doing a few charge/discharge cycles seem to confirm the 3400mAh. Lets assume a 1% discharge per month then it holds around 3000mAh after a year (no idea if this assumption is correct). If we want get a year of battery lifetime we can have a maximum average consumption of 342 µA. This means that during on time we can consume a maximum average of 95 mA. This seems to be well within the capability of a ESP8266. The results seem to confirm that we manage to stay within this power budget.”

Link to article

Related Content