Read button state from deep sleep
Moderators: grovkillen, Stuntteam, TD-er
Read button state from deep sleep
Hi, I'm trying to build door bell using ESP8266 and ESP Easy firmware.
I would like to deep sleep for maximum of possible time (1h + 11m). After that ESP8266 wake up, connect to wifi and send message - button not pushed for last hour.
But I don't know how to wake up and read value of pushed button. I connect push button input to ESP8266 input.
Someone push button for 1 seconds. After ESP8266 wake up, button will be on off state, so I read bad value.
How can I connect push button to ESP8266, that can wake up wifi module and allow wifi module to read value?
I would like to deep sleep for maximum of possible time (1h + 11m). After that ESP8266 wake up, connect to wifi and send message - button not pushed for last hour.
But I don't know how to wake up and read value of pushed button. I connect push button input to ESP8266 input.
Someone push button for 1 seconds. After ESP8266 wake up, button will be on off state, so I read bad value.
How can I connect push button to ESP8266, that can wake up wifi module and allow wifi module to read value?
Re: Read button state from deep sleep
You can use the buttonpress itself to wake up the ESP, somewhat like the mail notifier on wiki:
https://www.letscontrolit.com/wiki/inde ... fications
https://www.letscontrolit.com/wiki/inde ... fications
Re: Read button state from deep sleep
I do not think it's a good idea to use a door bell function with deepsleep, as by the time you push the bell button to when ESP8266 will wake up, connect to WiFi and be ready to send out the event it will take several seconds, and for me a door bell should ring and alert as soon as the button is pressed.
My TINDIE Store where you can find all ESP8266 boards I manufacture --> https://www.tindie.com/stores/GiovanniCas/
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone
Re: Read button state from deep sleep
I think that better way then using deepsleep is completely battery off state.
When someone press button, it will power up ESP, on "on System#Boot do" hold power through gpio with transistor or relay, send event and then, after some time switch ESP itself off.
You can run years with one battery set.
I think one or two second delay on message " somebody is coming to me" is not so important here.
When someone press button, it will power up ESP, on "on System#Boot do" hold power through gpio with transistor or relay, send event and then, after some time switch ESP itself off.
You can run years with one battery set.
I think one or two second delay on message " somebody is coming to me" is not so important here.
Re: Read button state from deep sleep
It sounds great.
How can I send state about 3-4 times per day (for check if esp still alive) and when button pressed? And how determine button pressed / alive check? Maybe esp alive check will switch two inputs and button only one?
5-10 seconds not problem for me.
Do you have any example schema? I'm eletronic begginer.
Re: Read button state from deep sleep
I wish ESPEasy can boot, connect to wifi e send message in "one or two seconds"...kimot wrote: ↑25 Jan 2018, 09:53 I think that better way then using deepsleep is completely battery off state.
When someone press button, it will power up ESP, on "on System#Boot do" hold power through gpio with transistor or relay, send event and then, after some time switch ESP itself off.
You can run years with one battery set.
I think one or two second delay on message " somebody is coming to me" is not so important here.
My TINDIE Store where you can find all ESP8266 boards I manufacture --> https://www.tindie.com/stores/GiovanniCas/
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone
Re: Read button state from deep sleep
Do you mean link from viewtopic.php?f=2&t=3717&start=20#p21320 ?kimot wrote: ↑26 Jan 2018, 21:22 @tuxmartin
Look at my link in this thread:
viewtopic.php?f=2&t=3717&p=21358#p21358
It's broken http://www.kevindarrah.com/wiki/index.php?title=Pusher
I read your idea of use RTC DS3231 alarm. It sound good.
My current idea is use Arduino pro mini at 8MHz for connect power to esp8266 every 4 hours or when button pushed.
Arduino need only 23uA: http://www.home-automation-community.co ... l-battery/
If I wake up esp8266 every 1h11m (max time), but do not enable wifi and get IP what power consumption do?
Re: Read button state from deep sleep
But 23uA for arduino is more than 20uA with only ESP2866 in deep sleep.
So only benefit is wakeup not cca per one hour but per 4 hours.
Re: Read button state from deep sleep
In real life/environment I've never seen an ESP8266 (considerin all minimum circuit) to consume just 20uA in deep-sleep!
My TINDIE Store where you can find all ESP8266 boards I manufacture --> https://www.tindie.com/stores/GiovanniCas/
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone
Re: Read button state from deep sleep
I believe to datasheet.
Without LDA, USB and some settings ....
https://tinker.yeoman.com.au/2016/05/29 ... revisited/
Without LDA, USB and some settings ....
https://tinker.yeoman.com.au/2016/05/29 ... revisited/
Who is online
Users browsing this forum: No registered users and 12 guests