Tutorial: How to improve the battery life of your embedded system
01 September 2022
As consumers, when we consider buying a battery-powered device, a key metric we typically check first is how long it lasts on a single charge. Battery life is a critical selling point for many wearable devices, but is also a significant consideration for the growing number of industrial IoT sensors & other similar applications. And prolonging battery life is not simply a case of using a bigger battery; physical form factors & dimensions impose practical & stylistic limitations.
This tutorial was originally featured in the September 2022 issue of EPDT magazine [read the digital issue]. And sign up to receive your own copy each month.
Embedded design engineers need to delve into the detail of their application’s power consumption profile to fully understand its power demands in real-time – and the factors that influence it. In this tutorial, Mark Patrick, Technical Marketing Manager at component distributor, Mouser Electronics highlights how to measure the power consumption profile of an embedded IIoT sensor and some practical steps engineers can take to help reduce it…
In our increasingly predominantly wireless, battery-powered ‘smart’ world, we may consider the occasional need to replace the battery in a wireless connected thermostat or security sensor used in our home a minor inconvenience. It takes just a few minutes and costs very little. In most cases, the device alerts us via a smartphone app when the battery needs replacing. For devices that protect us, a smoke alarm, for example, its notifications help us maintain the sensor’s operation and prevent fatalities.
However, consider if you were confronted with managing the battery replacement of hundreds of industrial sensors located across multiple remote sites. Although the task of the battery replacement takes just a few minutes, driving to each location, finding individual sensors, before moving to the next sensor can become an expensive full-time task. The ‘truck roll’ challenge, as it is known, has become a hidden and costly aspect of any IIoT (industrial internet of things) deployment.
Figure 1. The simplified functional architecture of a typical IoT/IIoT sensor [source: Mouser]
To mitigate the impact of frequent battery changes, manufacturers of battery-powered devices need to know how their product consumes power during operation. With this information, an indication of the likely battery life can be calculated. This approach is also a vital first step towards replacing the battery with an alternative energy source.
An example is implementing energy harvesting techniques to store energy in a supercapacitor. Potential energy sources include vibration, solar and heat. An in-depth examination of the device’s power consumption profile and duty cycle will determine if sufficient energy can be harvested and stored to permit regular operation.
The architecture of a typical battery-powered sensor
Figure 1 illustrates the functional architecture of an example wireless connected battery-powered temperature and humidity sensor. The architecture is typical of many IoT/IIoT devices used to measure and report on various environmental parameters.
Figure 2. The Nordic nRF9160 highly integrated cellular wireless transceiver microcontroller SiP [source: Nordic Semiconductor]
The sensor’s operation involves the microcontroller (MCU) sequencing through the following steps:
• waking up from sleep
• requesting temperature and humidity readings from the sensor elements
• packaging the sensor data into a messaging protocol format
• the wireless transceiver instigating a link to a wireless access point
• transferring the data to the host system
Figure 3. Current consumption of the Nordic nRF9160 MCU in different sleep modes [source: Nordic Semiconductor]
• placing the whole device back into sleep
Power regulation and conversion of the battery supply is achieved using a PMIC (power management IC, or integrated circuit), and additional circuitry provides voltage and current measurement. This data can be packaged together with the sensor data to the host application.
Highly integrated system-on-chip (SoC) wireless microcontrollers typically incorporate most of the functions highlighted in Figure 1. An example is the Nordic Semiconductor nRF9160 cellular system-in-package (SiP) shown in Figure 2.
Only the sensors and associated signal conditioning components are required to complete a design. The device’s datasheet highlights the individual power consumption parameters of the microcontroller and the wireless transceiver across different sleep modes. Figure 3 illustrates the typical current consumption of the MCU in different states, with values ranging from 0.1 µA to 600 µA.
The wireless transceiver is independently controlled, providing scope to manage its consumption profile. For example, the embedded firmware could ensure the wireless transceiver is enabled only when required. Some of the MCU’s peripherals can be placed in sleep during that operation, thereby lowering the overall consumption profile.
Power consumption measurement challenges & resources
Estimating the battery life of a sensor requires careful analysis of a device’s current consumption. Once an average consumption benchmark has been established, the development team can try various methods to improve the predicted battery life. Techniques may involve:
• Carefully sequencing the MCU and wireless transceiver.
• Turning off peripherals when not required.
• Changing the device duty cycle.
• Experimenting with different sleep modes.
• Slowing down the MCU clock when not processing data.
However, accurately measuring the current with such a high dynamic range is complex and beyond the scope of a typical bench digital multimeter (DMM).
Current is typically calculated with Ohm’s law, by measuring the voltage drop across a shunt resistor. The voltage drop across the shunt resistor – termed the burden voltage – reduces the voltage supplied by the load. For discernible, accurate low µA current measurements, the burden voltage needs to be sufficiently high for the DMM to measure, yet not reduce the supply to the extent that it causes erratic behaviour of the device-under-test (DUT). This is further complicated by the dynamic nature of the DUT operation, instantly changing from low µA to mA values. With typical SoC supply rails of 1.8 V or 3.3 V, the dynamic change of burden voltage would result in brown-out resets of the DUT during operation.
Figure 4. The Nordic Semiconductor Power Profiler 2 [source: Nordic Semiconductor]
Some precision DMMs are available to cater for this specific requirement. However, these costly units use relay switching to change the shunt resistor values during operation, but the time involved, even with solid-state switches, results in a loss of measurement detail and accuracy.
To solve the high dynamic current range measurement challenge, manufacturers have developed power profiling tools to measure and record consumption in real-time accurately. Examples include the Nordic Power Profiler Kit 2 (PPK) and the Qoitech Otti Arc.
Power Profiler 2
The USB-powered Nordic Semiconductor Power Profiler Kit 2’s measurement capability ranges from 200 nA to 1 A, with a range-dependent resolution between 100 nA and 1 mA. It can operate in a source mode, where it supplies the DUT voltage, or an ampere meter mode, where it purely measures the current. The PPK provides a software configurable output from 0.8 VDC to 5 V, up to a maximum of 1 A.
Figure 5. A screen capture of the Power Profiler application performing real-time current measurement [source: Nordic Semiconductor]
The real-time current measurement capability is 100 kS/s, and it automatically switches between five current measurement ranges to maintain the optimal resolution.
The PC-based Nordic Power Profiler app connects to the PPK and provides the interface to configure the PPK and record measurement data. Figure 5 illustrates an example real-time screen capture.
Reducing the sampling resolution from 100 kS/s to 1 S/s extends the maximum logging period from 7 minutes to 500 days.
Figure 6. The Qoitech Otti Arc precision low current measurement unit [source: Qoitech]
The PPK2 also features a set of digital GPIO (general-purpose input/output) pins suitable for connecting to the DUT to sequence control features or to a logic analyser to synchronise current measurements in step with the DUT application code.
The Qoitech Otti Arc (see Figure 6) is a compact, portable and versatile power analyser capable of measuring eight orders of magnitude, with 50 nA resolution upwards, from tens of nanoamps to 5 A.
The Otti Arc can be configured as a constant voltage or current source and a current sink. The current sink offers a method of emulating and profiling different batteries and application scenarios up to a maximum of 2.5 A. The Arc’s sampling rate is 4 kS/s. It can be powered from the host computer’s USB port or an external power supply.
Figure 7. The Otti Arc desktop software is available for Ubuntu Linux, Microsoft Windows & Apple macOS [source: Qoitech]
The Otti Arc software includes all the features to configure the current measurement source and sink operation and record the DUT current consumption. Figure 7 illustrates an example screen capture. The timeline permits increasing the granularity of the current readings, and the average current profile value is displayed at the top of the screen.
GPIO pins are available from the front panel to track logical states and control the DUT operation for analysis purposes.
Power profiling your design
To maximise battery life, you need to fully understand your device’s power consumption profile. The average current it consumes helps estimate battery life, but peaks heavily influence the average during regular operation. Before you can start to optimise the device’s firmware, you need to establish a profile of the current consumption through complete cycles of device behaviour. The two units highlighted in this tutorial can accurately measure extremely low current values that exhibit a high dynamic range. They can record and plot measured data against a synchronised timeline to the device’s firmware. Armed with this detailed information, the embedded developer and the hardware engineer can begin examining the code to undercover opportunities to lower current peaks.
Contact Details and Archive...