This Design Idea describes an enhancement to a previous one (Reference 1). The circuit in Figure 1 uses a normally open SPST pushbutton switch, S1, instead of the SPDT switch that the original design required. You can use a membrane switch to significantly simplify the industrial design of the device and enhance its ergonomics. In addition, this circuit slightly reduces the current drain in active mode by eliminating current flow through the unactuated switch.
|Figure 1.||One switch can provide power control and user inputs to a microcontroller-based system.|
In standby mode, MOSFET Q1 remains off and consumes less than 1 µA of leakage current from the battery. Pressing switch S1 turns on Q1 by pulling its gate to ground through diode D1. Voltage regulator IC1 turns on and supplies power to microcontroller IC2. The microcontroller boots up and asserts its P1.1 output high, turning on transistor Q2 and latching on the system's power to allow release of S1. Meanwhile, resistor R3 pulls the microcontroller's input, P1.2, to VCC. Pressing the switch a second time pulls the microcontroller's P1.2 input low through diode D2 and signals the button-pressed event to the firmware. After completing its program, the microcontroller asserts its output P1.1 low to turn off Q2 and, consequently, Q1, removing power from the system until the user presses S1 and restarts the process.
When selecting components, ensure that Q1’s gate-source breakdown voltage exceeds the highest possible input voltage; otherwise, use a zener diode to limit Q1’s applied gate-source voltage. You can omit Q1 if voltage regulator IC1 includes an on/off-control pin. To replace Q1 with a different power-switching device, such as an NPN bipolar transistor or a relay, specify Q2 to provide the control current that the switching device requires. To further reduce the circuit's component count, replace diodes D1 and D2 with a suitable common-cathode dual-diode array, such as the BAV70. Omit resistor R3 if IC2 includes built-in pullup resistors, as do many modern microcontrollers.