A place users can post their projects. If you have a small project and would like your own dedicated place to post and have others chat about it then this is your spot.

User avatar
By Barnabybear
#26977
DaniloFix wrote:I read a few places that the SW18020P conductive / contact time was 2 ms, so pretty far from the needed 325 ms. So the million dollar question is, how to keep the pin high, long enough to wake up the ESP from power off state?

Perhaps one or more small capacitors in parallel could do the trick? That is, if they can charge fast enough


Try a FET as a switch, the more capacitive the gate the better. Then use the sensor to charge the gate. At the end of the day it only needs to hold for 500ms.
User avatar
By DaniloFix
#26981
Barnabybear wrote:
DaniloFix wrote:I read a few places that the SW18020P conductive / contact time was 2 ms, so pretty far from the needed 325 ms. So the million dollar question is, how to keep the pin high, long enough to wake up the ESP from power off state?

Perhaps one or more small capacitors in parallel could do the trick? That is, if they can charge fast enough


Try a FET as a switch, the more capacitive the gate the better. Then use the sensor to charge the gate. At the end of the day it only needs to hold for 500ms.


Thanks for the suggestion - you think using a MOSFET as a switch will add a "delay", keeping the CH_PD high long enough? I plan driving the setup from 3.3v regulated battery source, so both gate and source will be 3.3v - you know any MOSFET's that will be useful ?
User avatar
By Barnabybear
#27038 Hi, working away at the moment so I can't do any testing. I will do & update the first post as soon as I can.
DaniloFix wrote:Thanks for the suggestion - you think using a MOSFET as a switch will add a "delay", keeping the CH_PD high long enough? I plan driving the setup from 3.3v regulated battery source, so both gate and source will be 3.3v - you know any MOSFET's that will be useful ?

Hi, it depends on the MOSFET & the circuit (it could even be a problem turning it off, but easier to fix), but we only need 500ms (to be on the safe side). Only testing will tell & you may still need a capacitor on the gate.

As for the MOSFETs, using the second circuit where a switch replaces the PIR, I see two simple options:
1. Use an N channel MOSFET in place of the switch. You wil need a cell of some sort to drive the gate, a CR2032 should be fine & last for ages. Connect
gate -> cell +ve
cell -ve -> sensor
sensor -> source
2. The option I favour. Use an P channel MOSFET in place of the switch. Connect the sensor between gate & ground.

With both the above options I would start buy using a 10K resistor in series with the gate to limit possable currents & slowly reducing the value if it doesn't work.