Read button state from deep sleep

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
tuxmartin
Normal user
Posts: 34
Joined: 10 Sep 2017, 13:07

Read button state from deep sleep

#1 Post by tuxmartin » 21 Jan 2018, 23:25

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?

wim16
Normal user
Posts: 88
Joined: 01 May 2017, 20:35

Re: Read button state from deep sleep

#2 Post by wim16 » 22 Jan 2018, 08:46

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

papperone
Normal user
Posts: 497
Joined: 04 Oct 2016, 23:16

Re: Read button state from deep sleep

#3 Post by papperone » 22 Jan 2018, 10:22

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

kimot
Normal user
Posts: 190
Joined: 12 Oct 2017, 20:46

Re: Read button state from deep sleep

#4 Post by kimot » 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.

tuxmartin
Normal user
Posts: 34
Joined: 10 Sep 2017, 13:07

Re: Read button state from deep sleep

#5 Post by tuxmartin » 26 Jan 2018, 01:09

kimot wrote: 25 Jan 2018, 09:53 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.
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.

papperone
Normal user
Posts: 497
Joined: 04 Oct 2016, 23:16

Re: Read button state from deep sleep

#6 Post by papperone » 26 Jan 2018, 11:50

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.
I wish ESPEasy can boot, connect to wifi e send message in "one or two seconds"...
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

kimot
Normal user
Posts: 190
Joined: 12 Oct 2017, 20:46

Re: Read button state from deep sleep

#7 Post by kimot » 26 Jan 2018, 21:22

@tuxmartin

Look at my link in this thread:
viewtopic.php?f=2&t=3717&p=21358#p21358

tuxmartin
Normal user
Posts: 34
Joined: 10 Sep 2017, 13:07

Re: Read button state from deep sleep

#8 Post by tuxmartin » 27 Jan 2018, 02:18

kimot wrote: 26 Jan 2018, 21:22 @tuxmartin
Look at my link in this thread:
viewtopic.php?f=2&t=3717&p=21358#p21358
Do you mean link from viewtopic.php?f=2&t=3717&start=20#p21320 ?
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?

kimot
Normal user
Posts: 190
Joined: 12 Oct 2017, 20:46

Re: Read button state from deep sleep

#9 Post by kimot » 29 Jan 2018, 15:21

kimot wrote: 26 Jan 2018, 21:22 @tuxmartin
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:
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.

papperone
Normal user
Posts: 497
Joined: 04 Oct 2016, 23:16

Re: Read button state from deep sleep

#10 Post by papperone » 29 Jan 2018, 19:11

kimot wrote: 29 Jan 2018, 15:21
kimot wrote: 26 Jan 2018, 21:22 @tuxmartin
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:
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.
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

kimot
Normal user
Posts: 190
Joined: 12 Oct 2017, 20:46

Re: Read button state from deep sleep

#11 Post by kimot » 29 Jan 2018, 22:51

I believe to datasheet.
Without LDA, USB and some settings ....

https://tinker.yeoman.com.au/2016/05/29 ... revisited/

Post Reply

Who is online

Users browsing this forum: No registered users and 17 guests