Not really understanding this function, I have a circuit running (NodeMcu motion sensor w/telegram). With meter tied in series to 3.3 pin I can see Ma reading is .1 and when tripped it reads .48 Ma. So as long as I am not tripping the sensor , I am at .1Ma . So if I jumper rst to gpio16 , with no motion i am reading .04 Ma and with motion I read .48 .So am I correct the difference at rest is only .06Ma ? That would be tying rst to gpio 16 with no software code written, how would writing code to do this make any difference?
I am really trying to understand this so i can apply this to other battery controlled circuits. I was very unsuccessful in writing the code and would like to understand this. Looking for code for dummies , maybe that is what I need.
I’m not sure that I understood your question.
Have you taken a look at this section “#2 ESP8266 Deep Sleep with External Wake Up” on this tutorial: https://randomnerdtutorials.com/esp8266-deep-sleep-with-arduino-ide/?
Not sure if I am getting this right, if gpio is connected to rst(hardwired ) and the motion sensor sees motion ,then it resets after . In this case, there is no code to be implemented to make this occur other than the motion sensor to send out message to telegram?
Yes, you don’t need to do anything in the code to handle the PIR motion sensor.
In this case, in the code you just need to put the ESP8266 in deep sleep for an indefinite period of time after running the task that you want.
Then, if the RST button senses a LOW signal (it doesn’t matter what sends the signal (pushbutton, PIR, reed switch, etc…), the ESP8266 will restart and run the code from the start. As soon as it finds the command to sleep, it goes into deep sleep again.
Thanks Sara, I guess I am reading this two different ways,
1)”In this case, in the code you just need to put the ESP8266 in deep sleep for an indefinite period of time after running the task that you want.”
2)”Yes, you don’t need to do anything in the code to handle the PIR motion sensor.”
Not sure exactly here.
The PIR should wake up the ESP8266 externally. You don’t need to add anything in the code to read the PIR motion sensor.
As in the example that I’ve sent you before, there is nothing to handle the pushbutton in the code (in your case, instead of a button, it will be a PIR sensor):
Thanks, that’s what I thought, kept over thinking this, thinking that I would still need to put that “ESP.derpSleep(0));
at the end of the code.
I understood it had to be somewhere in the code for it to work properly. Thanks plea mark this as solved