Electrical Engineering Asked on February 7, 2021
Hey all I am trying to see how long I can possibly have a ESP8266 ESP-07 operate with only 1 or 2 of the Lithium-ion Battery 18650 Cell which claims to have 2600mAh.
I am making a window alarm sensor and I’m looking to incorporate a window reed switch in order to check its status via the ESP8266 and if it’s 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 into deep sleep mode.
4: Wake up from sleep after 1 minute.
5: Check window reed switch.
5: If reed switch is open then send REST service via ESP-07 WiFi.
7: Goes back into deep sleep mode.
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 into deep sleep mode.
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 into deep sleep mode.
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 sees 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 batteries 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 into deep sleep mode 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:
Datasheets:
Lithium Ion Battery 18650 Cell
Window Reed Switch (Generic) or Mouser (Generic)
The battery ESP-07 consumption chart I found:
Adding my answer since I have had a similar problem. I have found some answers but not any complete with all parts and that have been tested.
This is a working prototype that I made. You can see more details about parts, modify and order your own if you want.
Here is a link to my project on jlcpcb: https://easyeda.com/jakibsgaard/low-powered-rising-and-falling-power-on-circuit
I have also a open question where I want to improve the circuit I have made. But that is not required. This has much more information about the circuit I made. Improving edge detector with latching circuit for esp8266
Answered by John-Arvid on February 7, 2021
If you are using ATTiny then you don't need to put ESP to sleep mode. You can disconnect power from it altogether using MOSFET or power management IC.
Now, ATTiny85 is not the best choice for low-power application. ATMega328P can run on button cell for a year.
Also the rechargeable lithium battery is really bad choice for this application too. You'd need voltage sensing circuit and cut-off to avoid damaging the battery. And if it is activated then you have no alarm at all. The better choice would be either alkaline or non-rechargeable lithium.
UPDATE
Finally, what's to stop hypothetical robbers from closing the window/door behind? If you only check once a minute there is a possibility that alarm won't be triggered at all.
Better option is to use NC reed switch. Then the voltage on the line can be used as wake up interrupt, so your MCU can sleep indefinitely, or wake up once a week (if you can find suitable ultra low power timer) to check battery voltage. I suspect with this setup battery can last for many years.
Furthermore, if you use timer chip with manual input you can connect your sensors to that input and connect power switch to timer output. Then you wouldn't need second MCU at all.
Answered by Maple on February 7, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP