My very simple response to this behaviour was to add a capacitor to the line between the PIR output and the transistor base. Holding the Reset pin to ground does not actually trigger the ESP-01 from deep sleep but the moment the voltage rises to the HIGH signal, then the reset happens. What I determined from this behaviour is that the ESP-01 actually triggers on the rising edge of the signal. I wanted the trigger to happen as soon as motion was sensed. This would mean that the email would not be sent, nor would the buzzer be activated until AFTER the PIR stopped sensing motion. The Reset of the ESP-01 only happened after the PIR stopped sensing motion and returned to a low signal turning off the transistor and returning the Reset pin to HIGH because of the pullup resistor. The output from the PIR is minimal but it provides enough base current turn the transistor on.Īs you will see in the circuit diagram below, the ESP-01 was awakened from deep sleep every time the PIR sensed motion.īut there was another problem. So to keep this short, after trying some different circuits I settled on using an NPN transistor with a pull-up resistor to keep the RESET pin HIGH during boot. Reset also needs to be HIGH or floating on boot. The first difficulty you will surmise is that Reset is triggered on a LOW signal and the PIR sends a HIGH signal when triggered. We can ignore this PIN, which is good because it is not available on the ESP-01.īasically, all we need is to get the signal from the PIR to trigger the ESP-01 Reset pin. This is true, but it is the wake signal from timed sleep. You will see many circuits that use GPIO16 connected to the ESP8266 Reset because GPIO16 is the wake signal. If there is no motion sensed for hours or days, the ESP-01 stays asleep using minimal battery power. I wanted the ESP-01 to waken only when triggered by motion sensed by the PIR. Elapsed time is pointless when using a PIR. If you want the module to wake after a set amount of elapsed time, The ESP-01 is not the module to use. The ESP-01 does deep sleep as well as any other ESP8266 module as long as you don't require timed sleep. You keep learning until something works and then you don't have to learn any more. Needless to say, there were some interesting hurdles or perhaps more relevant, a better understanding of the electronics that I required. Many paths until there was one that worked. I had the same issue getting the PIR sensor to work at triggering the ESP-01 deep sleep. So I say thanks to all those who have contributed to my success and are yet unknown. Funny thing is, once a path proves fruitful, you stop looking for more paths. Getting deep sleep to work led me on many paths that often proved fruitless. The idea of sending emails via gmail came from an instructable and other sources and the final code is an amalgam from those sources. The code and eventual circuit layout has been gathered from numerous sources across the web and I don't think I can identify them specifically. The ESP-01 is very functional and has all the capabilities required so why not use the minimum and least expensive necessary? Added to the mix was another separate and remote ESP-01 module that triggered a buzzer when the motion sensor was triggered. I recently needed to do this with a battery operated PIR motion sensor and an ESP-01. There are many example instructables and other examples of doing this. I have been working on making homemade motion sensors that send an email message when triggered.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |