-->
Page 1 of 4

deep sleep button bad idear??

PostPosted: Mon Jul 18, 2016 9:21 am
by simondid
hey

so i need my esp to be in deepsleep until a button is press this can be don bay setting a crasy amount off deepsleep time and connecting gpio 16 to a button witch is normaly closed and when pressed connection gpio 16 to ground this works but is it a realy bad idear ? shut i use a resistor in seris with the connection to ground ore what is the bedst solution? to also safe gourd aginst long press's ?

Re: deep sleep button bad idear??

PostPosted: Wed Jul 20, 2016 10:51 am
by Jep
simondid wrote:this can be don bay setting a crasy amount off deepsleep time

Instead of setting a "crazy amount of time" as you said you can just put 0 value to sleep indefinitely as below:
Code: Select allESP.deepSleep(0);

Re: deep sleep button bad idear??

PostPosted: Thu Jul 21, 2016 4:39 am
by simondid
ahh nice i was not aware off that :P

Re: deep sleep button bad idear??

PostPosted: Thu Jul 21, 2016 8:01 am
by schufti
if you don't need periodic (auto) wake-up, you don't need anything with gpio16, just a button for reset.
If you additionally wan't periodic wake up, a resistor (value depending on your pull-up on rst-pin) or schotky-diode between gpio16 and rst is recommended.
(Might also work with small cap 0.1uF, not tested yet)