Take Simple Steps Toward Extreme Low-Power Design
Practicing engineers are always learning and perfecting their craft. With the demand for more portable, battery-powered devices and energy harvesting on the horizon, the requirements for even lower-power designs have gotten more challenging.
At first, designers wrestled with saving milliamps, then microamps. Today, it is all about saving nanoamps. As a result, designers have to elevate their thinking to another level. Extreme low-power embedded design requires a tool cache of careful component selection, circuit design, and smart use of microcontroller extreme low-power features.
COMPONENT SELECTION
Let’s begin by taking a closer look at component selection, particularly the capacitor. Figure 1 shows a model of a real capacitor. This seemingly simple device is actually complex.
Value C is the capacitor value. RESR is the equivalent-series resistance (ESR) from the capacitor leads, plates, and dielectric. LESL is the equivalent-series inductance from the capacitor leads and plates. RDA and CDA model the capacitor’s dielectric absorption. RL is the capacitor leakage resistance. Each of these values differs by capacitor type (ceramic, electrolytic, tantalum, poly) and value.
Designers should be aware of where the capacitors are used in the circuit and investigate ways to minimize current consumption. While designers normally don’t look toward capacitors when designing an extreme low-power circuit, these devices can dramatically impact power consumption.
One of the first implications for this real model is the ubiquitous bypass capacitor. In digital circuits, we sprinkle them throughout the printed-circuit board (PCB) with abandon. Each one contributes a few nanoamps of current draw, even in static operation. To combat this, we must reduce the number of bypass caps to a minimum. Great care must be afforded the PCB design by creating power planes and bypassing areas of circuitry.
CIRCUIT DESIGN
The next step is circuit design. Figure 2a shows a common pushbutton circuit used in an embedded device. Resistor R1 provides a pull-up to +V. R1 values range from 10 to 100 kΩ. Capacitor C1 provides filtering and aids in switch debouncing.
In the circuit’s inactive state (pushbutton not pressed), inserting the real capacitor model in place of C1 creates a resistive circuit to ground through R1, C1’s RESR, LESL, and RL (Fig. 2b). This circuit, if left unchecked, will be a constant draw on the voltage supply.
For extreme low-power circuits, there’s little recourse other than removing the capacitor. It will cause more switch bounce, which the microcontroller software algorithm can easily handle. Figure 2c shows the current path of the circuit in its active state (pushbutton pressed). Let’s say +V is 3.3 V and R1 is 10 kΩ. While the pushbutton is pressed, this circuit draws 330 µA—quite a lot for a simple input device! The duration of the button press isn’t known. It can last anywhere from a fraction of a second to many seconds. What can be done to reduce the current draw?
One solution is to control +V. In Figure 2d, a microcontroller digital output pin replaces +V, and R1 is raised to 100 kΩ. The increased resistance lowers the current draw tenfold to 33 µA. The digital output I/O from a microcontroller is used to apply a voltage to the circuit. Its main advantage is that once the pushbutton press is detected, the voltage can be removed and cease any further current draw. This limits the amount of power consumed by lengthy or frequent pushbutton presses.
Many microcontrollers have internal weak pull-ups on digital input pins. (Refer to the “Electrical Characteristics” section of the datasheet to find the current consumption.) For instance, in Microchip’s PIC24F16KA family of 16-bit microcontrollers with nanoWatt XLP Technology, each CNx pull-up consumes 250 µA typical at 3.3 V.
This tells us that the weak pull-up resistor value is approximately 15 kΩ. It also indicates that internal weak pull-ups consume the same amount of power as an external pull-up resistor. Internal weak pull-up resistors are configurable in firmware, and the same idea can be applied. The added benefit is that resistor R1 can be removed, reducing cost.
Another possible extreme low-power switch solution has three capacitors paralleled in circuit, according to one of three switches (Fig. 3). There are eight possible selections, and each provides a different capacitance reading. The choice of the three capacitor values (C1, C2, and C3) needs to be undertaken carefully so there’s a sufficient delta reading to distinguish between each switch selection.
Figure 3 shows one set of capacitor values that result in a minimum delta of 22 pF. The beauty of this circuit is that, when a switch setting is read, the capacitance reading has a much lower current draw than conventional switches with pull-up resistors.
Controlling voltages of loads to minimize current consumption can go one step further to include external peripheral devices and loads. Figure 4 shows an analog temperature sensor controlled by a digital output, in place of +V. Microcontroller digital output pins can typically source and sink 20 to 25 mA. Again, refer to the microcontroller datasheet’s Electrical Characteristics for an individual pin’s current source and sink, and the maximum current source or sink by all ports, collectively.
Microchip’s MCP9700 analog temperature sensor typically draws 6 µA while operating. By placing a ground on the digital output pin, we effectively turn the circuit off, saving 6 µA. When powering on a device, read the datasheet to see whether there’s a turn-on time before making a reading. Again, as an example, the MCP9700 turn-on time is 800 µs. Thus, to make one temperature reading, the circuit will draw 6 µA, plus the analog-to-digital converter’s (ADC’s) reading current for 800 µs, plus the ADC acquisition time.
If the load is greater than the source or sink current of a microcontroller’s digital pin, then a FET switch can be employed (Fig. 5). Transistor Q1 is a P-channel MOSFET. We desire a very low drain-source resistance (RDS), and we often find these in P-channel MOSFETs. One challenge this type of MOSFET offers, though, is that the gate voltage must be low to turn on the FET.
Resistor R1 is placed in the circuit to prevent any glitches when powering on the circuit. The value of R1 was chosen to be 1 MΩ to minimize the current draw when the digital output is at a low (ground). It’s expected that the load controlled by the MOSFET is only on for a relatively short time, compared to its off time.
MICROCONTROLLERS AND LOW-POWER DESIGN
Careful selection of components and circuit design can take you to the next level in extreme low-power design. However, a microcontroller lies at the heart of many embedded designs. The microcontroller normally is there to run a program, making the device operate as intended. Not to be overlooked, though, microcontroller manufacturers have added many features that aid in low power consumption.
When powering circuits, set the system voltage as low as possible for lower power consumption. For example, a microcontroller running at 1 MIPS at 3.3 V can draw 700 µA. Lower the voltage to 1.8 V while keeping the same speed, and the current draw becomes 370 µA—almost a 50% savings.
System clock speeds can be changed on the fly. In the not-so-distant past, you were only allowed to set one clock speed. Today, you can select on-the-fly speeds from 31 kHz to 32 MHz.
Digital CMOS circuitry consumes less current if the switching speed is reduced. By all means, run the microcontroller at the lowest speed possible. Today, you don’t have to settle for one or two speeds. You now can have as many as 16 different speeds to choose from. With so many options, there’s a speed for every subroutine.
In the past, system clocks ran from an oscillator circuit using an external ceramic or crystal resonator. Today, microcontrollers sport multiple internal oscillators. The internal oscillator accuracy ranges from 1% at 25ºC to 3% to 5% over temperature. If the application demands greater accuracy, the external oscillator circuit can be turned on in software and switched off (over to the internal oscillator) when accuracy isn’t in demand. As a result, the microcontroller slows down, saving power.
Modern microcontrollers are chock full of peripherals. You have a variety of choices in timers, asynchronous and synchronous serial communications (USART, SPI, I2C), comparators, ADCs, real-time clock and calendars, and charge time measurement units (CTMUs). Keep in mind that each peripheral adds to the overall current draw by the microcontroller, but each peripheral can be switched on and off from software. The switching of internal weak pull-ups has already been mentioned. Maintain power only to those peripherals needed to minimize power consumption.
Modern microcontrollers also have many more choices in power-saving features. Today, microcontrollers run, doze, idle, sleep, and deep sleep. These modes ultimately give the designer more options in managing the power consumption beyond simply changing system clock speed. These modes also control certain peripherals.
Doze mode is for circumstances where the system clock to the CPU is slowed (prescaled) so the CPU runs at a lower speed than the peripherals. This mode is particularly useful when there’s low demand on CPU resources, but the peripheral needs to continue to run at full speed. This may be necessary for an application to maintain uninterrupted synchronous communications.
Idle mode will stop executing CPU instructions, but the system clock continues running peripheral modules. To exit idle mode, any enabled interrupt, device reset, or watchdog timer time-out will begin CPU instruction execution.
Sleep mode shuts down the system clock, which stops the clocking of the CPU or peripherals, yet RAM is retained. Certain purposed clocks and timers can be enabled during sleep mode, such as the real-time clock and calendar, and watchdog timers. These enable the microcontroller to time functions while in the sleep mode, adding great flexibility and variety to power-saving schemes in the application design.
Deep sleep provides the lowest level of power consumption. Power is removed from significant areas of the microcontroller. Sleep currents in the tens of nanoamps are achievable in deepsleep mode.
Depending on the feature set of the microcontroller, certain peripherals are dedicated to the deep-sleep mode, such as deepsleep brownout reset and a dedicated deep-sleep watchdog timer. These peripherals are independent of the standard brownout reset and watchdog timer so they can monitor voltage and time-out events while in deep sleep. Be aware that waking from deep sleep takes longer than waking from a traditional sleep mode, since RAM isn’t generally retained and must be restored.
Prior to sleeping, be aware of I/O pin states. During sleep and deep-sleep, I/O pins will retain their previous state. Also, be careful of digital input pins that are left floating. Input-voltage levels can drift between logic 0 and 1 and can enter a midpoint voltage where the digital input buffer will bias in a linear region. This will cause significant current consumption. Best practice is to configure the pins as analog inputs, as they are high-impedance and will draw very little current. This should be done prior to entering sleep modes.
Digital outputs generally don’t need any additional configuration. The current consumed will be the pin’s input or output leakage current. Attention must be paid to what’s being powered by the digital output pin. The optimal state should be determined prior to entering a sleep mode. If the external circuit is powered on and off by the microcontroller, be careful that the circuit isn’t back-powered by digital output pins supplying a logic 1. The digital outputs must be set to logic 0 (ground) prior to powering the circuit off.
Unused I/O pins are best configured as digital output pins driving either high or low. Or, they may be configured as an input with an external pull-up or pull-down resistor. However, the pin will draw its input leakage current.
Powering up circuits using these methods and waking up from deep sleep have their implications. When a circuit is powered off for a time, all charges will be drained away. Powering on a circuit will create a short current burst while the circuit comes alive. To mitigate the surge, storage capacitors should be placed on the supply side of the switch.
However, with our knowledge of capacitor leakage, we have to take care in the selection of the capacitor type. Electrolytics are generally known to have high leakage current. Tantalum also has high leakage current, but to a lesser extent than electrolytics. Ceramics provide a good cost-per-performance compromise, delivering both low RESR and low leakage.
Many of these circuit ideas may seem incredibly simple and obvious. But designers can enter a mode of thought that’s necessary to grab back all of those nanoamps that have slowly drifted away without doing any useful work. In the end, extreme low-power design raises the bar in terms of both design concept and mindset.