I wanted to use a single rotary encoder with a button to turn on, and interface with, my battery powered microcontroller (uC) project. After a set amount of time the project should turn itself off.
Objectives were to use parts I had lying around, use one button for both turning on power and as a uC input, and have a low quiescent current for long standby battery life.
The relay and switch represent the microcontroller.
The pushbutton on the left provides initial power to the uC by turning on the transistor.
Once the uC has power, one of the first things it does is to provide voltage through one of its I/O pins to the transistor base to keep itself alive (the relay in this schematic).
When power down is requested, the uC turns off the pin on the transistor base (the NC switch), and by doing so the uC kills its own power.
The diode and pull down resistor enable the button to also be used as an input on the uC.
|