This page was machine-translated and may differ from the original. View original

[Technical Contribution] How to Optimize Battery Runtime for MCUs

Google 우선 소스Published2017.06.12 14:22
After selecting a microcontroller (MCU), there are a few simple steps to optimize battery runtime. We would also like to discuss how to develop an optimal IoT device configuration by properly configuring and testing the hardware and firmware.
Text by Brad Jolly / Keysight

Power budget
First, calculate the theoretical power budget for the device. Refer to the MCU datasheet and manual to review the entire cycle of events, such as waking the device from sleep mode, data collection, data processing, turning on wireless functions, transmitting data, turning off wireless functions, and returning to sleep mode. Multiply the current by the time of each step and add the values to calculate the estimated total for a typical operating cycle.


The power consumed by the device during prolonged power-saving modes must also be included, as even a current of nanoamperes (nA) can amount to a significant sum over an extended period. MCU manufacturers may provide software capable of measuring current drains related to various operational variables, and the accuracy of the expected values can be ensured by using a DC power analyzer, a digital multimeter (DMM), or a device current waveform analyzer.

Hardware configuration
We begin by optimizing the clock speed at which the MCU operates. The current consumption of many MCUs is expressed in µA/MHz, which indicates that processors with lower clock speeds consume less current than those with higher clock speeds. However, a processor operating at 100% performance consumes the same amount of energy at 10 MHz as it does at 20 MHz, because a 20 MHz processor consumes twice the current during that half-time period. Consequently, current can be saved by making the MCU operate more slowly during code segments, when the processor is primarily in an idle state.

The next step is to optimize the settings related to data sampling. These settings include the frequency at which the sensor wakes up to collect data, the number of selected samples, and the ADC sampling rate. Since there is often a trade-off between measurement accuracy and these sampling variables, accuracy must be ensured while setting the sampling variables to minimize current drain. Similarly, the frequency at which the MCU updates the device's display, requests data from the sensor, and turns on LEDs or wireless functions can also be changed.

Finally, we will examine in detail the various idle states, snooze, and power-saving modes supported by the MCU. For example, some MCUs have the ability to disable the Real-Time Clock (RTC), and disabling the RTC can reduce current consumption in power-saving mode to less than 1/6. Of course, if you do this, some settings may be required to restore the date and time, for example, through a base station.



Firmware options
Design the program to quickly complete each step so that the MCU returns to sleep mode. Configure sensors and other peripherals to be powered only when necessary. When powering sensors, remember the power-on stabilization time to ensure that measurement accuracy is not affected. For ultra-low power modes, especially when powering the MCU at multiple voltage levels, it is recommended to use a sophisticated Source Measure Unit (SMU) to perform highly accurate current measurements.

We are reviewing the use of relatively low-power integrated peripheral modules to replace software functions performed by the MCU. For example, timer peripherals can automatically generate Pulse Width Modulation (PWM) and receive external timing signals.

In addition, appropriate programming settings are performed, such as setting constants outside of loops, excluding unnecessary variable declarations, unrolling small loops, and replacing some integer operations with bit shifts.

Test and learning
Finally, while writing MCU code, actual current consumption is frequently analyzed using instrument software tools. These tools include Complementary Cumulative Distribution Functions (CCDF) or automatic current profiles, which provide information for calculating more accurate power budgets. Observe and record the impact of coding decisions on power consumption to optimize current programs and get a head start on future projects.

Keysight Solutions for IoT Test Tasks – Download Application Note
본 기사에 대한 정정·반론·추후보도 청구는 보도 청구 안내를, 그간 게재된 보도문은 정정·반론보도 모아보기를 참고해 주세요.
신윤오 기자