Minimizing Power Consumption
Microcontrollers are often a great solution when power consumption is a consideration. Even running at full speed without any real effort to minimize power consumption, it is possible to run an AVR-based device like the Arduino for hours, or days, using AA batteries. Power consumption can be lowered even further using a combination of ideas and techniques as appropriate for your situation.
Here are some tests that were performed using an Arduino with and without an XBee wireless module to get an idea of relative runtime when performing different tasks with different types of power sources (9 volt, AA rechargeable, AA alkaline, etc.) This is the first question to ask: do you even need to look at optimizing power consumption?
Even at the default levels of power consumption, it becomes possible to run some applications nearly indefinitely with a combination of rechargeable batteries and a periodic source of charging power such as a small solar panel. With a little more effort, power consumption can be further reduced.
When I find myself needing to minimize the power consumption of a project, here are some things I look at:
- Eliminate as many external components as possible. This one seems obvious but I keep seeing questions posted about lowering power consumption when simple things, like getting rid of unnecessary LEDs, hasn't been done. If a component is not absolutely necessary, get rid of it.
- Lowering the operating voltage will lower the overall power consumption of the AVR. However, this will also limit the maximum operating clock speed the device is capable of and you will need to consider voltages required to power other components in your circuit.
- Lower the clock speed. Fewer operations per second reduces power consumed and, if you don't need the extra performance, don't waste the power to get it and then not use it.
- Set all unused digital I/O lines to inputs with pullups enabled, or if they are unconnected you can also configure them to be outputs and set to low. Whatever you do, don't let them float. There was some discussion about default Arduino behavior and these alternatives.
- Turn off portions of the microcontroller not being used. For example, if you're not using the ADC, turn it off.
- Take advantage of standby and sleep modes. Think about whether your application requires the device to be 'mostly on' or 'mostly off'. There are a number of situations where the device can be off most of the time and wake up for periodic measurements, communications, etc. and then go back to sleep mode almost immediately.
- Improve the efficiency of your code. An active microcontroller consumes more power than an idle one. Here is one example of how you might improve the efficiency of your code for I/O intensive programs. Usually, looking at the overall approach you are taking for a task such as polling (less efficient) vs. interrupt driven (more efficient), rather than trying to eliminate a few lines of code here and there, will provide the greatest improvement.
While each of these ideas should help reduce power consumption, a couple of good general principles are:
- Do not prematurely optimize... get things working the way you want first, then look for opportunities to reduce power usage. Think at each step and decision if the overall approach is still the right one or if another approach entirely would make more sense.
- Only optimize for where there will be a meaningful savings. For example, if your project needs to be on and active 95% of the time, immediately looking into spending the remaining 5% of the time in sleep mode would probably not provide a significant benefit relative to other possible optimizations.
Shop at Amazon and support this site
Copyright © 2006-2013 Quantoa LLC.
All rights reserved.