Hey guys,
I need to build up the circuit that :
1/ when main power 5V is connected for the first time, MCU gets 5V (first time autostart).
2/ MCU starts and drive the PMOS switching on by active high signal via BJT.
3/ When you push momentary switch - it sends the pulse to MCU input signal which drive MCU to switch the power off via BJT.
4/ Another pushing momentary switch will again starts to MCU power on it drives it using BJT etc ....
So for the first time autostart, then switching off and on using output signal (active high) from MCU.
Would the below work?
Thanks.

I need to build up the circuit that :
1/ when main power 5V is connected for the first time, MCU gets 5V (first time autostart).
2/ MCU starts and drive the PMOS switching on by active high signal via BJT.
3/ When you push momentary switch - it sends the pulse to MCU input signal which drive MCU to switch the power off via BJT.
4/ Another pushing momentary switch will again starts to MCU power on it drives it using BJT etc ....
So for the first time autostart, then switching off and on using output signal (active high) from MCU.
Would the below work?
Thanks.



