Microcontroller Design: Optimising Power Consumption in 12 Easy Steps
Long battery lifetime is a frequent requirement in embedded product design – particularly in microcontroller design.
For instance, we designed an animal tracking product that could run for four years using a 1/3 of an AA cell. Microcontrollers are getting ever more meagre in their power demands.
However, consumers’ expectations of features are growing in equal measure, frequently cancelling out the gains. This can best be seen in the battery life of mobile phones, which, currently, appears to be on the decline.
The unsuspecting engineer faces traps and pitfalls aplenty when designing a low power circuit. Must-have tips to remember are always useful – read on for our design team’s top twelve…
1. Optimise Pull-Up Resistors
When reducing the quiescent current in a circuit, one of the quickest wins is to go through optimising resistor values to the highest possible value. But how do you know what that is? There is no panacea for this in microcontroller design, so you’ll need to consider the following factors:
- Is the pull-up on a dynamically changing signal, such as an open-collector net, where a given slew-rate is required?
- What current is needed to feed into the signal that is being pulled? Examine the current requirement on the device data sheet, for example.
- Are you pulling against an internal pull-up resistor inside the microcontroller? Whilst internal pull-ups are convenient, using external pull-ups is often better, in order to specify the value and that value can be higher.
Use spare I/O pins to power pull-up resistors, if possible, rather than attaching the resistors directly to the power rails. Then, micro can enable and disable the pull-up as required.
Goodbye quiescent power…
2. Back Powering Devices
Turning off your Ethernet controller – yet it still appears to be on and drawing current? The biggest gotcha in low power design is most likely to be that of switching one of the power domains off and forgetting to zero any connected I/O signals. This not only burns power in the system, but it also violates the connected device’s absolute maximum input voltage rating – potentially damaging the device. If you don’t have control of the output levels of the signals to the connected device, use buffers to split up the power domains. But, choose wisely – remember these also use quiescent power!
3. Decrease the Voltage
When it comes to microcontroller design, as a general rule, the lower the voltage you can run your circuit at, the better. Power is relative to the square of the voltage; decreasing the voltage by even a small amount can produce a significant saving.
Take a look at what voltage your devices can actually run at. 3.3V doesn’t have to mean that – perhaps it could be reduced to 3.1V or even 2.7V? Again, with a bit of research this is a simple victory and can be something done after you get your prototypes back. Just remember tolerances of components and think worst case – dust off that spreadsheet.
4. Modify the Clock Frequency
Your power consumption, roughly speaking, will increase proportionally to your clock frequency in a synchronous circuit, so curtailing the clock to a minimum if often a good plan. However, this is dependent on the application in your microcontroller design.
If the device is asleep for a long period of time and wakes up occasionally, it could be that running at full speed for a short period is better; not because you are saving power in your micro, but because the rest of the circuit is burning power waiting for the micro to finish. Reduce the time the micro is on and save all that quiescent power.
5. Stop the Clocks and Go To Sleep
This is the extreme version of the above step. If you can actually stop clocks completely even better. You may, for example, be able to stop all of the oscillators in your circuit other than a low power RTC timer that wakes everything up periodically, and put your micro into its deep sleep mode.
6. Choose Your Oscillator With Care
Oscillators come in many varieties and a poorly chosen one can burn through more power than the rest of your circuit put together.
In general, the lower the capacitance required around a crystal the better, as those capacitors get charged and discharged each cycle. For that reason, low frequency crystals targeted at real time clocks typically exhibit very low capacitance. If you are using an oscillator, read the data sheet and check that quiescent and operating power carefully! You may be surprised at how much variation there is between brands.
7. Avoid Regulators
Each time you step a voltage up and down you suffer a loss. Your regulator may be 90% efficient (Really? – see step 8 below!) but that is still 10% of your power heating the room. You need to trade off the cost of switching voltage against the benefit of running as low as possible (3). Spreadsheet time again….
8. Use Caution When Selecting Your Switched Mode Regulator
There’s a huge selection of regulators available for all sorts of applications. Recently, the trend has been for increasingly higher switching speeds resulting in reduced inductor and capacitor sizes – which, in turn, allows for ever decreasing circuit footprints.
From the perspective of low power design, the main thing to be aware of in choosing a regulator is the efficiency curve point at the current at which you are operating.
So, if your circuit is running at 5mA, for the period which is draining your battery the most, then remember to pick a regulator that is efficient at that level of current. It might be that your circuit has many operating modes, at various power levels; but by using a spreadsheet to calculate the power typically dissipated over a typical usage scenario, you can detect which modes are most critical to efficiency and target these. Occasionally, this can even mean using two regulators and switching between them.
Don’t forget that some microcontrollers have internal linear regulators for the core voltage. Occasionally, it’s possible to save power by using a tiny switched mode instead of this core regulator and disabling the internal regulator.
And always be sure to optimise the passive components around the regulator circuit, remove stray capacitance, reduce diode voltage drops and maximise the resistor values on any feedback chain.
9. Diode Leakage and Voltage Drops
Look out for leakage in components that should know better. Schottky diodes are great when you need a low voltage drop – but upon closer inspection, at their reverse leakage current and in a low power design they may not be so attractive.
For instance – when using a diode to drip feed current to a backup battery or memory backup capacitor for a RTC; when the circuit does power down, some of your valuable stored energy is going to leak back through that diode. Make certain it is a minimal amount.
Other sources of lost power include diode voltage drops. See if you can replace a diode with a FET (or back-back FETs), so that the drop is virtually zero when it is switched on. A typical case would be that of a reverse protection diode. Remember the FET body-diode when it is off. This can be helpful – or render your circuit junk.
10. Turn It Off!
Now to, perhaps, the most obvious point; it is generally better to turn off a circuit or device completely, rather than to put it into its low power mode (assuming it has one), but be mindful of the perils of back-powering devices.
11. I/O Pins
Reducing the power to very low levels can be a painful process of diminishing returns. A crucial step sometimes overlooked in microcontroller design is sorting out the I/O pins on the microcontroller; this can escape attention until you are down to your last few milliamps. So take note of internal pull-ups or pull-downs, outputs driving devices that are turned off and floating pins – these can oscillate and burn power away.
12. Choose Your Battery Chemistry With Care
Again, battery chemistry is a subject in itself (which we will examine, in a future post!). There are several elements to take account of – voltage, capacity, internal resistance, temperature performance, to name a few.
Internal leakage is a key parameter in low power design. Lithium Ion and Lithium Polymer are often used due to their energy density, but they suffer poor internal leakage, rendering them unsuitable for many really low power designs. Among the better choices are quality alkaline batteries and other Lithium chemistries such as Lithium Thionyl Chloride – the standard cell type used where very long standby life is required, such as in electricity and water meters.
We hope these tips are useful when it comes to your next microcontroller design. Do you have any strategies for optimising power in microcontroller design? Let us know via our social media channels!
*image credit: Micah Elizabeth Scott/Flickr
How can ByteSnap help you today?
From start-ups to blue chips, ByteSnap’s electronic design engineers are enabling companies to stay a step ahead by providing them with bespoke solutions. Maintain your competitive edge – contact us today and let your business be among them!