Turn- off button

Thread Starter

andrew24

Joined Aug 20, 2008
76
Hello, i need a single push button to turn microcontroller- based device on and off. For example holding the button for 3 sec. turns the device on, and holding the button 3 sec again turns the device off. Any ideas how to do it?
 

kubeek

Joined Sep 20, 2005
5,795
I saw a nice way to do it, but don´t have any schematic:
p-channel mosfet switching the power to the micro, gate controlled by the micro.
One half of the pushbutton bypasses the mosfet (or pulls the gate low), so after pushing it the micro gets power, counts 3sec and then starts holding the gate low to keep it running.
The other half of the switch simply goes into the micro, which after pushing it starts the count down, and then makes the gate go high, thus switching off the micro.
Depending on the type of outputs of from the micro you could need a resistor between supply voltage and gate to keep the mosfet off.

Should have absolute zero consumption until switched on, so it is suitable for batery powered operation.
 

Thread Starter

andrew24

Joined Aug 20, 2008
76
I saw a nice way to do it, but don´t have any schematic:
p-channel mosfet switching the power to the micro, gate controlled by the micro.
One half of the pushbutton bypasses the mosfet (or pulls the gate low), so after pushing it the micro gets power, counts 3sec and then starts holding the gate low to keep it running.
The other half of the switch simply goes into the micro, which after pushing it starts the count down, and then makes the gate go high, thus switching off the micro.
Depending on the type of outputs of from the micro you could need a resistor between supply voltage and gate to keep the mosfet off.

Should have absolute zero consumption until switched on, so it is suitable for batery powered operation.
Thanks a lot! The low power consumption is actually very important in this device. Tomorrow i'll try to draw a schematic based on your explanation.
 
Top