Hello
I'm using this circuit to soft toggle an arduino on and off. It works fine. The P mosfet turns on when the button is pressed, which turns on the N mosfet, which then latches the P mosfet on even after the button is released. A subsequent long press on the button brings the gate of the N mosfet low, once the 10uF capacitor has discharged.
I would like to be able to notify the arduino that the button has been pressed the second time, so that it can display a momentary "turning off" message. If I originally thought to set a pin as input_pullup and attach it to the button switch, so that it's pulled low when the button is pressed. However, this has the effect of keeping the circuit on permanently. The alternative is to configure it as a simple input, but i can't see anywhere on the circuit that is going to go momentarily high when the button gets the second press. What's the best way to achieve what I want please?
I'm using this circuit to soft toggle an arduino on and off. It works fine. The P mosfet turns on when the button is pressed, which turns on the N mosfet, which then latches the P mosfet on even after the button is released. A subsequent long press on the button brings the gate of the N mosfet low, once the 10uF capacitor has discharged.
I would like to be able to notify the arduino that the button has been pressed the second time, so that it can display a momentary "turning off" message. If I originally thought to set a pin as input_pullup and attach it to the button switch, so that it's pulled low when the button is pressed. However, this has the effect of keeping the circuit on permanently. The alternative is to configure it as a simple input, but i can't see anywhere on the circuit that is going to go momentarily high when the button gets the second press. What's the best way to achieve what I want please?