A previous article about optimizing power efficiency in microcontrollers concentrated on optimizing code and using low power MCUs from manufacturers. A closer look at power saving techniques in hardware is in order, however, if you need to squeeze every drop out of an MCU that can’t be traded in for a lower-power model.
Components:
Many projects start with a development board, but these come with extra components that can burn power. Some voltage regulators are not as efficient as others, and dev boards are rarely optimized for power efficiency. If a voltage regulator is required, replace the dev board model with a voltage regulator that has low quiescent current. (Quiescent current is the current drawn when there’s no load.) Replace any necessary LEDs with lower power LEDs and set them to flash for 8 – 10 ms, which is still detectable.
Try purchasing a proto board (perf board) and mirror only the essential components on to the bare board. Take a look at all the components you need and avoid using components like indicator LEDs or displays that consume unnecessary power. External components that draw power can be turned off, as well. For external devices that draw higher power, use a MOSFET to kill all power to those devices when they aren’t being used. Temperature sensors that run a constant low current will consume more power in the long run since it’s like leaving a light bulb on all the time so you don’t have to turn on the switch to see what’s in the room. It takes a bit more effort and time to turn the MOSFET on to tap the temperature sensor reading, but if you take the temperature once a day you could lengthen the life of the batter by reducing the constant draw.
Power modes:
The obvious power savings is in various sleep modes. Put low power modes to maximum use by putting the processor to sleep as often as possible and for as long as possible, even if it’s for one second at a time. Or you can also use an interrupt pin, if present, to wake the processor based on an external event. A low power stand-by mode will keep a clock running so the MCU can wake up faster, but running clocks consume power. Turn off clocks that you don’t need.
Processor modes:
In addition to selective operation via low power modes, your MCU might run at a lower voltage or a lower frequency, which will save power during operation. Keep in mind that if you run at a lower frequency, you might have issues programming the MCU, so check the user guide for what to expect.
Software Tweaks:
The previous article discusses optimizing code. Some operations are less cycle intensive. If accomplishing a task can be done in two MCU clock instruction cycles or four cycles, you will want to exercise as few cycles as possible, of course, and therefore go with the code that can do the task in two cycles. However, you can also shave additional energy consumption by turning off any software modules that you don’t need. For example, if you don’t need SPI or the Analog-to-Digital converter (ADC), then disable them. If you’re not worried about the board hanging, you can even turn off the watchdog timer.
I/O:
Backlit displays can use a lot of energy, but as long as you’re shaving microamps off the total power consumption, you might as well save what you can from I/O pins. If you have unused pins, configure them as inputs and set them to low (i.e., disable internal pull-up resistors).
Note that batteries will self-discharge, as well. This means that with nothing connected to them, they will still lose a certain amount of energy related to the chemical composition of the battery. Batteries have different discharge rates and you can select a battery with a better self-discharge rate.
“Cheating”:
Sometimes it’s easier to provide local energy to recharge batteries. Trickle charging can be accomplished with energy harvesting devices. Solar panels are well-known, but other (and sometimes rather expensive) energy harvesting methods are available that can snatch energy from RF signals, thermal gradients on nearby plumbing, wind power, or piezoelectric energy harvesters that harvest energy from vibration.
After all of the above, that ultra-low power MSP430 is probably looking pretty good.
Leave a Reply