Chat freely about anything...

User avatar
By Stoney
#22066
Paul Miller wrote:I posted a resolution using 4 resistors and an Op Amp here:
http://www.esp8266.com/viewtopic.php?f=13&t=3786

I just realized, though, that you need to be logged in to see the circuit image.


still no good, a PIR could be high or low at boot time.
what is required is an OR function with a time delay.
like this ..
Image

at power up the cap is discharged, so gpio2 is pulled high through the diode.
if the input is low, the diode to it is turned off, so gpio is still high, as the cap discharges then after a short time it will no longer affect the gpio and the input controls gpio2 alone.
values are just what i think shoukd work ok, i have no idea how long gpio2 needs to be high for, i assume not long ..
User avatar
By lethe
#22078 All of the solutions have one problem though: they only work on initial power up.
If the ESP is restarted at a later time (due to a watchdog reset, crash or intended manual restart), you will still have have the same problem.
The only solution I can see, is to use another GPIO (e.g. UART RX) to enable inputs on GPIO0/2 (a 74HC125 should work for example, if you connect the nOE pins to a GPIO).