I want to create a auto power off circuit for a battery powered sensor to preserve the battery. The switch will be a reed type and the trigger pulse will be brief (~70 ms is my guess, shorter than boot up time required that is 125 ms).
I've came across few circuits to achieve that, but all of them rely on human holding the switch for boot time of MCU, where in my case is ESP8266 (with approximate boot time of 125 ms) has longer boot time than the expected pulse duration, so it can't activate the GPIO in time to hold the transistor. Ralph Bacon has a video about the topic, but again with implied human holding the switch.
I've created a schematic from the video with added resistor on PMOS gate and a HT7333 LDO to convert the 4.2 V of li-ion to 3.3 V that ESP tolerates, it's switched on after the pulse (3.5 µA is 3.5 µA) to further lower the current consumption. I've also created a simulation on CircuitJS-Falstad.
My question is how to modify the circuit so that a pulse shorter than boot up time can turn on the MCU for longer than boot time – 125 ms?
In the simulation, when adding a capacitor in between drain of PMOS and gate of NMOS there is big reverse voltage spike on the capacitor after the voltage falls below Vgsth of NMOS.