The simulation demonstrates that the capacitor remains charged without discharging (when the switch is open). The voltage across the capacitor remains a constant 3.06V. As a result, the gate voltage of the N-MOSFET remains low, preventing it from turning on. Consequently, the gate voltage of the P-MOSFET remains high, causing it to remain off. This ultimately leads to the ESP being turned off when the switch is open.The normally closed switch will work but not in your simulation as Q22 is not the correct mosfet for this circuit


This implies that the ESP will remain powered on only when the switch is closed or if the KEEP_ALIVE signal is high. However, we need to power it when the switch is open.That circuit is not designed for a normally open switch. For a normally open switch just connect Vcc from the switch to the ESP power pin.

I gave a link to a NO & NC switch back several post ago. You should have no problem finding one which has NO & NC contacts.YES, this is exactly what I'm looking for. As mentioned in the previous thread, the circuit already fulfills the function you described. However, the issue lies in the usage of a normally closed switch, whereas I would prefer to utilize a normally open switch as it is readily available to me.
So would opening the door long enough for anyone to enter, most likely.Both circuits provide 2 second ON times which should be plenty of time for the ESP
Which AA cells can provide for 11 years.The sleep mode of ESP consumes 20uA of power
Is it feasible to substitute the CPC1002N chip with a P-MOSFET because I cannot find the CPC1002N in either the simulation or the market?New twist using a CPC1002 SSR for either a NO or NC reed switch. Both circuits provide 2 second ON times which should be plenty of time for the ESP to power up and provide the KEEP_ALIVE signal.
View attachment 298715
Digikey has 34,748 in stock. The TP2104N3 is a logic level P channel mosfet.Is it feasible to substitute the CPC1002N chip with a P-MOSFET because I cannot find the CPC1002N in either the simulation or the market?
Can we just use the BS250 instead?Digikey has 34,748 in stock. The TP2104N3 is a logic level P channel mosfet.
The BS250 datasheet indicates a maximum drain current of 250mA. However, I'm wondering why the ESP cannot draw more than 1.5mA. Could there be other components in the circuit that are limiting the current?You can as long as the current required for the ESP is no more then 1.5ma. But it probably won't sim correctly.

Hi sghioto,Actually I got better results using a common 2N3906 for Q2.
View attachment 298727

There is some confusion here.The circuit I simulated utilizes a normally closed switch, while your schematic indicates a normally open switch, which is inaccurate.
Yes, this is essentially identical to a normally open switch. When the door is closed, the magnet causes the contacts on the reed switch to close (so you call this normally closed). You are considering its functionality, while I am examining the inherent characteristics of the switch regardless of its function.There is some confusion here.
Normally closed to me means the door is closed and the magnet is shorting the contacts on the reed switch, that is the arrangement I show in post #75
So what type of switching arrangement do you want to use?
Yes, I have just simulated the first part of your circuit successfully. This part utilizes a normally closed switch (the normal case when the door is open), giving very good results. I will conduct tests on the other part in a few hours.Quoting from post #1:
"The reed switch available to me is a normally open switch, meaning that when the door is closed, the switch will be closed due to the presence of a magnet."
Is this still the type of switch you want to use?