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:

homie-esp8266-bme280

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=http://costofcial.com]cialis[/url] Cialis Prices Canada Viagra Rezeptpflichtig Apotheke isotretinoin worldwide no rx by money order Propecia Buy Cheap Kamagra Erfahrungsberichte <a href=http://costofcial.com>cialis online</a> Viagra Naturale Cialis Plus Efficace Que Viagra Cialis Generico 5mg Prix Viagra Belgique http://costofcial.com - buy cialis Buying Online Cialis

7 janvier 2018 17:00:54 - JustLolo

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

31 janvier 2018 18:32:00 - Ivanbef

canadianpharmaciesbnt.com onlinecanadianpharmacy.com

7 février 2018 04:09:31 - WinnerAmeks

If you’re interested in winning millions, then I’m here to help! At [url=skyliteboom.com]Casino[/url] you can play over 450 world-class games and I’m giving you an exclusive Welcome Bonus to get you stuck into winning. Use it today to increase your chances of hitting our jackpots. All you have to do is [url=skyliteboom.com]sign up today[/url] and watch the rewards come rolling in. skyliteboom.com [url=skyliteboom.com]Prepare to hit the big time[/url] [url=skyliteboom.com]Hacer giros para ganar millones[/url] [url=skyliteboom.com]Holen Sie sich spinnen, um Millionen zu gewinnen[/url] [IMG]http://i63.tinypic.com/ofdmds.jpg[/IMG]

12 mars 2018 18:02:55 - Josephmub

Amazing many of beneficial information. levitra and cialis comparison <a href="http://cialisfidel.com/">cialis generic</a> se necesita receta medica para el cialis [url=http://cialisfidel.com/]cialis generic[/url]

13 mars 2018 11:32:11 - Josephmub

Terrific tips. Appreciate it! costo confezioni cialis <a href="http://cialisfidel.com/">cialis low cost</a> cuanto dura una cialis [url=http://cialisfidel.com/]buy cialis online[/url]

29 mars 2018 14:42:10 - Hydebrstdum

cialis samples for healthcare providers follow link buy now cialis vente medicament cialis google cialis cialis baratos uk se comparan can 40mg of cialis be taken buy cheap generic cialis 50mg us pharmacy 20 mg cialis <a href="http://cialiscoupon2018.com/#cialis-30-day-sample">$200 cialis coupon</a> low dose cialis and bph <a href="http://cialiscoupon2018.com/#cialis-coupons">coupon for cialis by manufacturer</a> acquista cialis cialis erfahrungsberichte the best choice cialis pfizer cialis kaufen online in kanada acheter cialis bretagn cialis generico e originale cialis uk approved generic cialis canada cheapest cialis soft tabs review acheter cialis sur paris cialis and buy discount cialis 20 mg cialis generic tabs <a href="http://cialiscoupon2018.com/#cialis-30-day-sample">goodrx cialis coupon</a> cialis dosagem minima <a href="http://cialiscoupon2018.com/#cialis-5mg-daily-use-cost">what is the cost of cialis</a> achat cialis original franc cialis super aktiv uk cialis price india cialis 20 mg 8 compresse cialis y otros medicamentos generisches cialis en ligne http://cialiscoupon2018.com/

1 avril 2018 21:36:33 - mezo

І havе read sߋ many cοntent гegarding the blogger lovers h᧐wever thіs post is genuinely a gⲟod paragraph, keеp іt սp.

19 avril 2018 15:19:23 - JugeCed

cialis 20 mgpurchasing cialis on the internetcialis genericcialis for sale <a href=http://jvrimages.com/#cialis+from+india>viagra vs cialis vs levitra</a> cialis purchasingside effects for cialis http://jvrimages.com/#side+effects+of+cialis

22 avril 2018 03:38:36 - IkdrgeTat

fast cialis online buy cialis cheap 10 mg <a href="http://cialisxxss.com/#cialis-side-effects">cialis coupons printable</a> buy cialis online legal cialis 20 mg cost http://shandatea.com/#cialis-generika cialis daily dose generic acquistare cialis internet <a href="http://chineseteacrafts.com/#cialis-coupons-printable">cialis generique</a> generico cialis mexico enter site 20 mg cialis cost http://chineseteacrafts.com/#sialis cialis prezzo al pubblico does cialis cause gout <a href="http://cialisxxss.com/#cialis-side-effects">cialis pills</a> generic cialis pill online venta cialis en espaa http://cialisxxss.com/#cialis-without-a-doctors-prescription

1 mai 2018 11:00:11 - IktrdrgeTat

<a href="http://chineseteacrafts.com/">Cialis Without Prescription</a> cialis baratos compran uk cialis kamagra levitra cialis professional yohimbe 40 mg cialis what if i take cialis prices in england enter site natural cialis <a href="http://chineseteacrafts.com/#">Buy Cialis Without Prescription</a>

23 juillet 2018 20:47:10 - Thorstein

WOW just what I was looking for. Came here by searching for n

25 juillet 2018 22:44:28 - Gustaf

Hey there! I realize this is kind of off-topic but I needed to ask. Does operating a well-established website like yours take a lot of work? I'm completely new to writing a blog however I do write in my journal everyday. I'd like to start a blog so I can share my own experience and views online. Please let me know if you have any suggestions or tips for brand new aspiring blog owners. Appreciate it!

6 septembre 2018 02:55:38 - K SA

I jսst cοuld not leave ү᧐ur site beffore suggesting tһat І extremely loved tһe usual іnformation a person supply fоr yоur visitors? Ιs goіng to be Ьack ߋften to check ᧐ut new posts

7 septembre 2018 22:42:29 - KSA

I visited multipke sites butt thе audio quality for audio songs existing aat thgis website іѕ in fаct marvelous.