ESP8266 (esp-07) powered by battary(s) for at least 1 year - Page 1
Forum section: electronics / projects

author: Stealthrt
author_rank: Regular Contributor
timestamp: July 31, 2018, 06:07:25 pm
content: Hey all I am trying to see how long I can possibly have a ESP8266 ESP-07 operate with only 1 or 2 of theLithium Ion Battery 18650 Cellwhich claims to have2600mAh.I am making a window alarm sensor and I'm looking to incorporate a window reed switch in order to check it's status via the ESP8266 and if its opened (meaning the window is not closed) then send something via WIFI to a REST service. Likewise, if the reed switch is not opened (meaning the window is fully shut) then sleep.The flow with only ESP-07 would look something like this:1: Power up for the first time.2: Send Date/Time, window closed or opened, etc.. via ESP-07 WIFI to the REST service.3: Have the ESP-07 go intodeep sleepmode.4: Wake up from sleep after 1 minute.5: Check window reed switch.6: If reed switch is open then send REST service via ESP-07 WIFI.7: Goes back intodeep sleepmode.8: Loop back to #4.The flow with ESP-07 & ATTiny85 would look something like this:1: Power up ESP-07/ATTiny85 for the first time.2: Send Date/Time, window closed or opened, etc.. via ESP-07 WIFI to the REST service.3: Have the ESP-07 go intodeep sleepmode.4: Have ATTiny85 check every 30 seconds for window reed switch status.5: If reed switch is open then send REST service via ESP-07 WIFI.6: ESP-07 goes back intodeep sleepmode.7: Loop back to #4.It would seem that using the ESP8266 along side an ATTiny85 would make it last longer since I could check the status of the reed switch via the ATTiny85 and if it see the window closed then pause and check it again in 1 minute. If the ATTiny85 does see the reed switch opened then start up the ESP8266 and send the info via WIFI then go back into deep sleep. However, I am not sure how this would be on the battery side of things - if it would be less or same or more.I'm looking to see how long 1 and/or 2 of the Lithium Ion Battery's would last (in days) with using just the ESP-07 and also using both the ESP-07 and the ATTiny85 as explained above.I've done some googling and found a few websites that show how to put the ESP-07 intodeep sleepmode but really wouldn't say how long it would take with my setup above. Most were using standard AA or AAA batteries.The overall goal is: Have the window alarm power last at least 1 year.The items:The battery ESP-07 consumption chart I found:

author: latonita
author_rank: Newbie
timestamp: July 31, 2018, 08:07:59 pm
content: for this comprehensive task i can recommend you attiny10 checking whether door/window is opened, sending wake up signal, and going back to sleep.it is 0.1 micro Amperes in sleep mode. and nice small SOT package.anyways, most power consuming will be esp8266.if you want to extend battery life - make sure you desoldered LED and use static IP instead of DHCP to minimize connection time.

author: TJ232
author_rank: Frequent Contributor
timestamp: August 01, 2018, 04:47:15 am
content: Better than Attiny85 is to use a proper RTC ic.Done it few years ago for a outdoor environmental monitoring device and is still working OK.The RTC IC is switching full ON/OFF all the bits and pieces including the ESP8266, the power consumption in sleep stage (few uA) is hard to beat by any other solution. Combine it also with a small solar panel and a Li-ion charger IC and will run forever.

author: Nusa
author_rank: Super Contributor
timestamp: August 01, 2018, 06:07:39 am
content: Have you considered connecting the sensor switch to a pin-change interrupt as the primary wake-up method? You could still do a polling cycle on a much longer period just to prove the unit is alive. And on power up or reset, of course.When the unit does report, have it include battery voltage as well as sensor status. Then you'd have plenty of warning before it fails for lack of power.

author: Stealthrt
author_rank: Regular Contributor
timestamp: August 01, 2018, 12:36:10 pm
content: Ah just found this youtube video(s). Seems just what I am looking to do. Thoughts?Original video:Feedback (updates) from the above original video:So if his setup lasts a long time on CR2032 with 240uA batteries then I'm guessing a 1000uA+ would last even longer than that?

author: Rerouter
author_rank: Super Contributor
timestamp: August 01, 2018, 12:53:30 pm
content: I would caution 1 minute polling, as currently if you opened and closed the window in less than a minute, you may get by un-noticed,2600mAh is utterly insane amounts of power for 1 year, I'm currently working on sensor networks that runs 2 years off 140mAh.For clarity, you can sit there burning about 300uA and meet your mark.To use pin change interrupts, you have the reed switch across 2 pins, 1 pin has a 1M Resistor to ground, to detect the contacts closing you would have the 1M pulldown pin set as an output low, and the other pin as a input with pullup, when the contact closes the input falls low, and detects it.To detect an open, you would set the pulldown pin as an input, when the contact opens it would fall low, and trigger an ISR.Otherwise just up your polling rate. if you need the polling to be accurate you can use a cheap SPI RTC, there alarm IRQ output is particually handy,I would also caution you to pick your decoupling capacitors well, avoid electrolytic like the plague. they can leak 10's to 100's of uA

author: 0xFE
author_rank: Newbie
timestamp: August 01, 2018, 08:25:14 pm
content: Hi,I don't know, maybe this is exactly what you want? "Wireless ESP based sensor with 2 AAA batteries". Page is in russian but you can translate it with google.https://habr.com/post/130421/Codehttps://github.com/zaharenkov/LoF

author: bitseeker
author_rank: Super Contributor
timestamp: August 02, 2018, 01:07:13 am
content: Quote from: Stealthrt on August 01, 2018, 12:36:10 pmLooks neat. He gets really long standby because power is completely disconnected when the window is closed. The drawback is that the esp is running as long as the window is open. Of course, he could put it to sleep if the window is open for an extended period of time.Regarding your battery, also take into account the self-discharge rate if the cell will not be recharged for a long time. If longevity without intervention is an important feature, TJ232's idea of adding solar charging is a good thing to check into.