Here we discuss a few techniques that are useful in low power designs. As an example, we design a remotely operated switch which upon detecting a button push transmits a RF signal to turn on or off a remote device. This switch is powered directly off a small 110mAh lithium ion battery, whose discharging characteristics is shown in a previous post. We use the 8-pin PIC16F17115 microcontroller, which can operate over the voltage range of a single cell lithium ion battery, no voltage regulator is needed.
The switch is inactive most of the time, so the microcontroller is placed in the sleep mode, drawing less than 1uA. The microntroller is waken up on an I/O change interrupt. The peripherals that operate on the system clock which is stopped during are not drawing much power, but it is necessary to explicitly disable some of the peripherals, such as the fixed voltage reference, brown-out reset, comparators, which have significant current draw.
The battery voltage needs to be monitored. To minimize part counts and reduce power consumption, we use the battery voltage as the voltage reference for the ADC and do the analog to digital conversion on the reference voltage, to back calculate the battery voltage; no external connection is needed and no power is wasted on a resistor divider. When the battery is low (around 3.6V), a warning is issued with a low duty cycle LED blink or a piezo buzzer beep.
We can eliminate the quiescent power consumption of the RF transmitter by powering the transmitter with an I/O pin (saving a power switch). Note that the output drive is stronger when driving low. So we set the I/O pin to open-drain and power up the transmitter by driving the output low. This works for 10s mA; for larger current, a power switch is needed.
For the button press detection, we use an external pull-up resistor of 1MOhms, instead of the internal pull-up which is about 30KOhms. Pressing the switch on triggers a negative edge, which wakes up the microcontroller to transmit a turn-on RF signal. And pressing the switch off triggers a positive edge, which powers up the RF transmitter to send a turn-off signal. Here 4uA current is consumed. The leakage current is 125nA (85C); the pull-up resistor can be increased to 4MOhms, reducing the current to 1uA, which would be. We must be mindful of the slow rise time (with pin capacitance of 5-10pF), and use the Schmitt trigger input.
In the awake state, after the microcontroller sets up the ADC to check the battery voltage, drives an output pin high to turn on the transmitter and drives another open-drain output low to transmit. Here to save power, we put the microcontroller in the IDLE mode, so the microntroller CPU is halted but the peripherals continue to run. We set up the timer to interrupt in 200ms, which would bring the microcontroller out of the IDLE state to turn off the transmitter. Then the microcontroller goes into the sleep mode
If it is necessary to wake up from sleep periodically, the watchdog timer can be used. Here it may be necessary to wake up periodically to check the battery and beep when the battery is low as reminder to charge the battery.