Chat freely about anything...

User avatar
By Barnabybear
#37571
shoelessone wrote:
Barnabybear wrote:Hi, I'm guessing it was taken from this post viewtopic.php?f=11&t=4458
If the PIR no longer detected movement the output would return low. If the output was able to sink current it could pull the CH_PD pin low before the ESP had completed its task. The diode prevents this.


I suppose this makes sense, but if you take the PIR sensor out of the equation and are totally controlling GPIO4 in software, would the diode still be necessary?

Hi - sorry didn't finish the post - no the diode is not needed.
User avatar
By shoelessone
#37662 Ha, that's awesome. Thank you!

I'm going to try to bread board up a simple circuit to test this out. I appreciate it! My goal is to have a simple "IFTTT" type button with a rechargeable battery circuit also on the board so I can build a few of these for presents for friends and so forth.

Anyway, thank you!
User avatar
By shoelessone
#37970
Barnabybear wrote:Check this out https://www.hackster.io/iboboc/smartbutton-pro-06ce5d , sounds like you doing something simlar.


Thanks for this Barnabybear! Yes, this is very similar to what I want to do, although I'll add that I don't fully understand why some of the circuit in this example is setup as it is.. Two questions come to mind:

1. it seems that the person is treating GPIO0 the same way as CH_PD in this sketch. Couldn't they just permanently have GPIO0 pulled HIGH? It's not using power as long as CH_PD is low, correct?

2. This is more of a (very) basic EE question, but one concept I don't fully understand is how, despite the CH_PD being connected to GND through a resistor, CH_PD is pulled HIGH when connected to VCC. In other words, and at the risk of sounding really stupid, I don't quite understand how to figure out why CH_PD isn't pulled low even when the button is pressed, because it is still connected to ground (albeit through a resistor!). And, for example, could a resistor be used between VCC and CH_PD? In the past I've used 4k7 (thanks to Martin's) to pull up/down GPIO pins as needed, including CH_PD, but in the schematic shown the person us connecting directly to vcc. I imagine there is a "fight" between GND and VCC, and the resistor causes GND to "loose" and the CH_PD pin to be pulled high, and perhaps adding a resistor between VCC and CH_PD would cause a less certain outcome?


Anyway, thank you!!