Left for archival purposes.

User avatar
By kleetus
#47631 I used Andrei's very cool picture of his pulse circuit and it worked fantastically! thanks :D

I now need some advice on how to NOT pulse the RST pin while the ESP8266 is running. Here is what I mean:

A bit of ground:

My use case is very much like the OP's but I have a reed switch connected to the capacitor that controls the gate pin of my BS170. I am using this to detect when a door is open or closed essentially. When the switch is together, the cap to the gate has 0v, when the switch is apart, the cap has 3.3v and thus the gate is pulled open and the RST pin is grounded for a millisecond or so and the mcu wakes and queues the door open event. All this works marvelously.

The problem:

The problem comes in when the door is shut and then re-opened BEFORE I can get booted, get an IP address and fire off the event. This whole process takes 8-9 seconds, so I could miss events.

What I seeking to do:

I would like still go into deep sleep mode since most of the time, the doors are shut and there is no need to run the mcu. On the other hand, when the mcu is operating, I want to prevent the door switch from pulling the RST low resulting in a reboot at the same time performing a RST only after I issue a node.dsleep(0) command.

Things I've tried:

I tried to use the same principles that you guys taught me with respect to using a mosfet as a switch between the reed switch NC terminal and the capacitor that feeds the gate. I don't have a P-channel mosfet so I experimented with a n5461 JFET. This did not work. I also tried switching at the RST pin connection to the drain of the bs170 with the JFET. No dice. I don't think my knowledge of Vgs values on the datasheets are there yet.


How would you handle this situation? Am I over-complicating this circuit?

this is my current setup:

http://imgur.com/gallery/v8iRpkC
User avatar
By kleetus
#47665
martinayotte wrote:The ground of the mosfet could be control by another mosfet which is control by another GPIO and a pullup.
This way, when ESP apply a LOW on this GPIO, it would deactivate the GND of the Reset mosfet.


I am going to try this when I receive my p-channel mosfets. I will connect the drain of the new p-channel mosfet to the source of the n-channel (the one currently handling the pulse). Then, connect the source of the p-channel to ground. Then connect a GPIO pin on the ESP to the gate of the p-channel mosfet. I will pulldown the GPIO to ground using a resistor, so when the ESP is sleeping, the p-channel should allow current to pass from source-drain and allow the pulse. When the ESP is running, I will output high on this GPIO pin and it should be enough voltage to prevent most current flowing through the p-channel. When I experimented with the JFET, this scheme did not work. I guess I could not pull the gate to 0v through this pull down resistor -or- something else that I don't understand about how JFET's work. Yes, I've read the datasheet for the JET, but in practice I messed something up.

thanks for reading my plans here.