ESP8266 + bme280 battery life: 120 days and counting

The sensor

I have an outside battery powered temperature/humidity/pressure sensor, here is the list of what it is based on:

  • ESP8266 (esp12f), according to espressif
    • from 120 to 170mAh for Tx
    • 10µAh in deep sleep mode
  • bme280
    • 3.6µAh at 1Hz when measuring the 3 parameters
  • MCP1700-3302E LDO
    • 1.6µAh quiescent current
  • Panasonic NCR18650B
    • 3400 mAh

It looks like this:


Active time

When writing the code for this device, I added some debug to time how long it needed to go from deep sleep, connect to wifi, read values, send them to MQTT and go back to deep sleep mode. That was a tiny bit over 4s, and without print, a tiny bit below 4s. So for the final version, I built it without any print, which means even less than what was in my test, as I still need to initialize the serial, and do at least one print to show the time. I guess we can use 4s as a basis here, and assume that it actually is lower than that.

Deep sleep is set to last 10 minutes every time, so:

  • 4 seconds active
  • 596 seconds deep sleep
  • OR 24 seconds active and 3576 seconds of deep sleep in an hour

Theorical estimations

Once again, it is lilkely below that, but let's assume the esp module is using 170mAh when active:

(170 / 3600) * 24 = 1.1333333333333333

And 10µAh for 3576 seconds:

((10 / 1000) / 3600) * 3576 = 0.009933333333333334

The bme280 will only be powered when the esp module is asking for it, so let's round it to the 24 seconds an hour, which is probably a bit more than real world usage as it will likely only be active when doing the reading

((3.6 / 1000) / 3600) * 24 = 2.4e-05

And finally, 0.0016mAh for the LDO:

1.1333333333333333 + 0.009933333333333334 + 2.4e-05 + 0.0016 = 1.1448906666666667

So in a day:

1.1448906666666667 * 24 = 27.477376

Which sums up to 27.477376mA a day.

The Panasonic batteries are apparently measured pretty often around 3280mAh, so

3280 / 27.477376 = 119.37093265383129

We can round that down to 119 days.

If considering 120mAh this figure goes up to 168.4 days.

Also note the actual code goes:

  • wake up
  • connect to wifi
  • connect to MQTT broker
  • read sensor values
  • send values to MQTT broker
  • go back to sleep

I would venture that this probaly mean we are not in Tx mode all the time, so the actual esp module consumption during these ~4 seconds is likely shorter, therefore we can hope for even longer battery life.

Dream mode on: If Tx is at about 120mAh and is actually half the awake time, and the rest is Rx, at about 56mAh, that would bring us to 228 days!

Trying to be more serious, it seems likely that Tx is not using the higher current, and that it only is using part of the awake time, so I would be pretty happy with 6 months battery life.

Real life

At first I wanted to write this once I had depleted an 18650 cell completely.

Knowing I estimated it at first with about the same as today, so 119 days. That being theorical, I was actually expecting 90 days, maybe a 100. Espcially as there was quite some time below freezing point since it was put up, and that this has bad impact on batteries as far as I know.

It now has been 4 months, since november 25th, or 120days and it still is running, Vcc measurement doesn't seem to get any lower, but the only measures I hava is from the ESP.getVcc(), which is what the ESP gets, and not what the battery actually deliver.

The readings jittters between 3.14 and 3.33v knowing the MCP1700-3302E has a dropout voltage of 0.178v, we can assume that at worst, the battery still delivers 3.318v. I got an alarm set when this goes below 3.1v, so if the real battery gets below 3.278v, so the battery is safe.

I'll likely do a new post when the battery is finally depleted.

25 mars 2017 10:53:22 -- tags [ esp28266 , bme280 , 18650 , battery , temperature , sensor ]

8 avril 2017 22:24:18 - lắp điều hòa hay sử dụng máy làm mát

Do you mind if I quote a few of your posts as long as I provide credit and sources back to your webpage? My website is in the exact same area of interest as yours and my visitors would truly benefit from some of the information you present here. Please let me know if this okay with you. Thank you!

30 avril 2017 07:40:40 - Charlotte

First of all I would like to say great blog! I had a quick question which I'd like to ask if you do not mind. I was curious to find out how you center yourself and clear your head prior to writing. I have had trouble clearing my mind in getting my thoughts out. I truly do take pleasure in writing however it just seems like the first 10 to 15 minutes are usually wasted just trying to figure out how to begin. Any recommendations or hints? Thank you!

8 juin 2017 13:16:01 - expensive wine

We look for some eclectic and affordable glassware at thrift stores and yard sales.

23 juin 2017 14:26:35 - vinhomes vincity

phân phối сhung cư vinhomes vincity

7 janvier 2018 04:59:45 - JustLolo

Buy 5mg Daily Cialis Cheap [url=]cialis[/url] Cialis Prices Canada Viagra Rezeptpflichtig Apotheke isotretinoin worldwide no rx by money order Propecia Buy Cheap Kamagra Erfahrungsberichte <a href=>cialis online</a> Viagra Naturale Cialis Plus Efficace Que Viagra Cialis Generico 5mg Prix Viagra Belgique - buy cialis Buying Online Cialis

7 janvier 2018 17:00:54 - JustLolo

Misoprostol 200 Mg Buy [url=]generic cialis[/url] Kamagra Soft Chews Non Prescription Viagra Reviews Dosage Dog Uti Keflex Cephalexin And Depression <a href=>cialis</a> Depression Pills Online Tadalis Sx Acheter Where To Buy Levitra Online - generic cialis On Line Direct Doryx Cheapeast Internet Cialis Pfizer Levitra