Wednesday, April 11, 2018

Intro to low power design

April 11, 2018 Posted by Akalanka , No comments

Low power system design is a black art in electronics which is not for the faint of heart. It requires deep understanding on how digital circuits behave at the transistor level. However with embedded devices, in depth electronic knowledge is not the only requirement. Firmware development practices and overall solution design plays a major role in how long your device would last on 2xAA cells. It is very important to note that every microampere counts when you are designing a device that runs of a battery that you expect to last a couple of years. For in depth analysis on how low power systems work take a look at which is a very elaborate and valuable resource. For those of you who are impatient, read on.

1. Hardware design

1.1 Design:
The hardware design of the development board plays a key role in deciding the power consumption. Following proper design practices and carefully selecting relevant components is key in keeping the power consumption to a minimum. 
Selecting the resistor for a simple pull down or pull up could decide how low you can go in the power department. Try to avoid connecting resistors such as the ones below as much as possible where there can be quiescent currents no matter how small. If unavoidable always use highest possible resistor values which will not impact your maximum operable frequency. 

Be careful about resistor dividers as well, especially what you find in power supplies to get the reference voltage. Those can be the culprits that draw several millamperes at standby even though they look innocent

Try to avoid using LED indicators such as power indicators as well, no matter how small. A typical surface mount LED consumes around 500 microamperes which works out to a staggering 4380mAh energy consumption for operating 1 year! If you want to have an indication on the operational status of the device, connect the LED to a microcontroller pin and blink it with a low duty cycle. 100ms ON and 10s OFF would reduce the previous 4380mAh annual requirement down to 43.8mAh!

1.2 Components:
Selecting the right components for the right job is obviously important. Common components/sub circuits that you might get wrong are

  • Power supplies- Never user linear regulators (I know that one is pretty obvious). They have a far lower efficiency than a typical SMPS converter. Another little known fact is most linear regulators have a operating quiescent current in the 1-5mA range which is HUGE when doing a low power design. This means that the regulator will gulp down that 3mA or whatever even when all your microcontrollers, modems are switched off which is nothing short of robbery. Therefore its best to stay away for linear power supplies. Even selecting a SMPS can also be challenging and try to avoid over-provisioning as much as possible.
  • Leaks and drains- Capacitors are another culprit that should be checked for leakage currents. If you do not operate at fast switching frequencies parasitic effects can be ignored. But a capacitor can have a insulation resistance which is sadly less than infinity as shown below which means that there can be a leakage current which is not zero. This is specially true for large electrolytic capacitors.

1.3 Microcontroller:
The microcontroller is a major power consumer. It is after all where all the stuff happens. The power consumption of the microcontroller can be minimized by following the below steps:
  • Go for a low power microcontroller whenever possible
  • Figure out the lowest clock speed that you can run your microcontroller. If you are not doing anything intensive, reducing the clock speed as much as possible with save you few tens of millamps. However if you are processing some data (eg: running a fast Fourier transform or a Kalman filter) you will need to strike a balance between running fast and completing the task quickly and going to sleep or running slow for a longer time.
  • Shutdown or disable unused peripherals in the microcontroller. Don't need ADC? disable the module. USB not needed? shut down that too. This will simply reduce the power consumption at the silicon level
  • Adjust I/O toggle frequency to a minimum possible value. Toggling I/Os fast is similar to running your processor at a high speed. All of this finally boils down to the switching loss in FETs. Check out the link to see how the switching loss increases with clock speed.
  • Run your little micro at low voltage when possible. When the operating clock speed is reduced, the processor will run stably at low voltages which is a big win in the power department.
1.4 Modem:
The modem is usually THE biggest consumer of power in an IoT application. A modem has the following circuitry
  • RF transmit (Tx) and receive (Rx) components including the power amplifier for the Tx and the low noise amplifier for the Rx
  • RF baseband processor (usually a DSP) - this is where the nitty gritties related the radio layer will be handled
  • Application/ interface handling and command processing- This will be a processor which runs what we normally call the 'modem firmware'. 
As seen above there can be several DSPs (Digital Signal Processor) and co-processors inside a little modem which makes it eat power. But modern network technologies and modern chipsets are designed to be as efficient as possible when transmitting and consume almost no power at all during sleep modes which is a big win.

2. Firmware design

Writing the firmware should be done with the low power approach as a main focus. Few important points to remember are
  • Make sure that your code runs satisfactorily at low clock speeds. Compile your code in lower clock speeds and see how things go.
  • Try to finish the task as soon as possible and let the processor go to a low power mode. This can be stop, sleep or standby and these modes vary based on the microcontroller (this ones a no brainer!) Selecting the best mode can be tricky. If you plan to wake up in few seconds, the stop/suspend modes will be best while sleep or standby will be great if you plan to sleep for minutes or hours
  • Avoid restarting the modem unnecessarily. During each restart, the modem has to register on the network which takes a significant amount of Tx power for the radio. Newer network technologies like NB-IoT have optimized ways of keeping the modem connected to the network over long periods while conserving power. We will see how NB-IoT improves battery life in a later post.
We will see in our next post how Banana Pi can be hacked to minimize power consumption.


Post a Comment