I have been trying to implement the same solution for my application. I have a PCB which is PIC controlled and need a soft on/off switch. The mechanical switch I use is a toggle switch. I have had to change the pnp (Q1) with a P-fet due to the current required from the Vin line. The voltage at the input is 12V and the maximum current drawn can be around 2A.
In the implementation I have, when the toggle switch is turned off, the PIC will detect this and send a '0' to Q2. This initiates the circuit to turn off. However, the P-Fet output voltage reaches around 4V and then suddenly turns back on again. I tried to tie the gate of Q1 to ground using a resistor to make sure that the gate is turned off. But still no joy.
Can anyone tell me what I might be doing wrong please...
Have you solved the issue? I am currently testing the mentioned circuits and hope to get back with a helpful answer for you. However I will try this other circuit instead: