• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

Struggling with RST concept

Q&A Forum › Struggling with RST concept
0 Vote Up Vote Down
Larry asked 4 years ago

     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. 

Question Tags: ESP8266
7 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 4 years ago

Hi Larry.
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/?
 
Regards,
Sara

0 Vote Up Vote Down
Larry answered 4 years ago

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? 

0 Vote Up Vote Down
Sara Santos Staff answered 4 years ago

Hi.
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.
 
Regards,
Sara

0 Vote Up Vote Down
Larry answered 4 years ago

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.

0 Vote Up Vote Down
Sara Santos Staff answered 4 years ago

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):

  • https://randomnerdtutorials.com/esp8266-deep-sleep-with-arduino-ide/#external

Regards,
Sara
 
 

0 Vote Up Vote Down
Larry answered 4 years ago

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

0 Vote Up Vote Down
Sara Santos Staff answered 4 years ago

And it has to be placed at the end of the code. So that it can run the task you want, and then, goes to sleep.

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [eBook Updated] Learn Raspberry Pi Pico/Pico W with MicroPython eBook – Version 1.2 May 26, 2025
  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.