Investigating the power consumption of your embedded design
01 April 2022
Mouser_ Qoitech Otii Arc_application shot
There is an increasing emphasis on understanding the power consumption profile of an embedded design. For example, IoT/IIoT sensors in the field may need to operate on batteries for years, so knowing how long a device can be in sleep mode, yet still able to respond quickly to an interrupt, is essential.
This article was originally featured in the April 2022 issue of EPDT magazine [read the digital issue]. And sign up to receive your own copy each month.
Here, Mark Patrick, Technical Marketing Manager at component distributor, Mouser Electronics investigates the energy demands of a typical wireless connected device, and the challenges electronics design engineers face when measuring power consumption and accurately predicting battery life…
As the IoT/IIoT (internet of things/industrial IoT) extends its reach, both in diversity of applications and deployment in remote locations, using batteries to power edge devices has become the norm. From an engineering perspective, using a battery is a convenient way to power a system. However, the challenge is knowing how much battery capacity is required to power the device for a given duration. Single coin cells provide enough energy to power an ultra-low power sensor for many years; however, ultimately, they will need replacing. The labour and travel costs are often out of proportion to the battery cost and managing hundreds of devices becomes untenable. Using a rechargeable battery and energy harvesting techniques, such as a solar PV (photovoltaic) panel, assist considerably – but impact the device’s physical size.
How much power is my embedded system using?
Figure 1. The compact & portable Qoitech Otii Arc (source_Qoitech)
Understanding the device’s power consumption profile becomes the critical metric to predicting battery life and capacity requirements. The profile is a dynamic measure, with power peaks and lows, rather than purely an ambient reading. The chemistry of some batteries makes them less able to quickly recover from peak power demands than others, so finding out what is causing these peaks is crucial.
Once the cause of the power peaks and the quiescent background current are identified, steps to lower them include software techniques, such as putting the microcontroller into a sleep mode and changing the timing of tasks.
Measuring the energy consumption of your embedded design
Attempting to measure a wireless connected IIoT sensor during operation with a digital multimeter indicates an average current consumption, but does not give an accurate picture. Look at the datasheet of a typical low power wireless microcontroller you might find in an IoT device for some insight into the current ranges involved. Comprising two major functional blocks, the microcontroller (MCU) and the wireless transceiver, most vendors provide the ability to turn the radio functions off separate from the MCU. Take the Silicon Labs EFR32BG22 Series 2 Bluetooth Wireless SoC (system on chip), for example. The highest current consumption is 8.2 mA and occurs when the transmitter is providing a 6dBm output. When the SoC is in EM4 deep sleep mode, the consumption drops to just 0.17 µA. Such a wide dynamic range of current consumption, approximately 50:1 that can occur within microseconds, indicates the extent of the challenge. Peripheral interfaces and GPIO (general-purpose input/output) will also consume power in use, along with the associated functions of the IoT device, so it is necessary to take a holistic viewpoint.
Figure 2. Using UART debug messages to sync with the Otii Arc’s real-time current measurements (source_Qoitech)
Measuring the current consumed by any device typically involves placing a shunt resistor with a low ohmic value and high tolerance, typically 1%, in the supply rail to the embedded system. Measuring the voltage across the shunt resistor enables the calculation of the current flowing through it. There is an optimal value for the resistor to be effective. It will impose a high burden voltage and lower the supply voltage to the microcontroller if too high. Too low will make it difficult to measure very low currents.
The concept of power debugging first appeared in the embedded design industry over ten years ago. Standard J-TAG debugging probes are now available with a current measurement feature. Many popular embedded toolchains and IDEs (integrated development environments) support them, but typically they do not offer the dynamic range or granularity of measurement required for today’s embedded systems.
Meeting the demand for accurate real-time measurement of a device’s energy consumption is a unit such as the Qoitech Otii Arc.
High dynamic range real-time embedded current measurement
Figure 3. A CR2032 battery attached to the Otii Arc to profile the coin cell (source_Qoitech)
The Qoitech Otii Arc (see Figure 1) features a programmable power supply and analyser in a single compact and portable unit. A comprehensive software application provides the user interface for the Otii Arc and is available for all popular operating systems. The Otii Arc can display and record current in real-time with nanoamp accuracy and has a maximum sampling rate of 4 ks/sec. Its high dynamic range of current measurement from tens of nanoamps to 5 Amps is industry-leading and makes it ideal for use with any embedded system design.
Supply power for the Otii Arc can either come from a USB supply or an external DC power adapter. The output voltage to the device under test (DUT) is programmable from 0.5 to 5 VDC in 1 mV steps. The Otii offers a continuous output current of 2.5 A and up to a 5 A peak. An external power supply is required to deliver currents higher than that available from a USB port.
The Otii Arc features a UART interface, two GPIO inputs, two GPIO outputs and two voltage sense pins. Using the UART interface, debug messages from the DUT are displayed alongside the real-time current measurements. This UART feature permits the embedded developer to highlight tasks or watchpoints in their code to signify specific application functions. UART messages allow syncing of the application code to the real-time current measurement. See an example in Figure 2.
The Otii Arc software permits the recording and storing of real-time sessions. This feature is particularly handy to compare the impact of code improvements or hardware enhancements during the prototyping stages of embedded development. The GPIO pins allow status pins from the DUT to appear on the Arc’s display in real-time, further assisting the debug process.
Figure 4. The battery profiler settings for the CR2032 coin cell battery (source_Qoitech)
The sense pins permit measurement of other DUT power rails or facilitate four-wire monitoring of the primary power supply voltage at the DUT. The Otii Arc also features a programmable current sink to facilitate discharging a battery and recording its profile. Otii can then emulate the stored battery profile with its primary output voltage. An optional Otii battery toolbox software licence is needed to use these features.
Figure 3 illustrates a CR2032 coin cell connected to the Otii Arc to profile the battery’s discharge. The profile settings for testing the battery appear in Figure 4. Note you can set the current load and the duration in a high and low setting. You can also set the iterations a cycle repeat.
The high current setting, illustrated in Figure 4, is 40 mA, and the low value is 100 µA. The time in each current zone and cycle time represents a 30-day discharge period.
Figure 5. A comparison of how data protocol influences energy consumption (source_Qoitech)
Equipped with an Otii Arc, an embedded developer can quickly delve into how their prototype consumes power and when. Not only does this provide insight to manipulate a microcontroller’s sleep modes and turn off peripheral functions, but it also allows investigation into other power-saving ideas. An example is deciding which wireless protocol to use. Most edge based wireless IoT sensors only need to forward minimal data, such as temperature and humidity readings, every 15 minutes. The nature of some wireless protocols, networking routing and data security methods is that a 40-byte message can quickly become several Kbytes.
A recent technical paper from Qoitech (available at: www.qoitech.com/blog/how-do-iot-protocols-affect-a-devices-energy-consumption) highlights how the choice of the wireless protocol influences energy consumption. Figure 5 illustrates the summary results of a series of tests performed using an NB-IoT (NarrowBand-Internet of Things) wireless module with different protocols and security settings.
Analysing the power consumption of an IoT device in minutes
Determining the battery life of an embedded IoT system is fraught with difficulties. Without accurately measuring the energy consumed, the predicted battery life is an estimate at best. Wireless SoC datasheets give a good indication, but do not take into account the dynamic nature of, for example, establishing a wireless link and sending data. Peaks of power consumption also impact long term battery performance, so the ability to model likely behaviour becomes essential.
With the ability to control power delivery, perform real-time consumption analysis and sync up debug code in a single compact unit, the Qoitech Otii Arc, now available at Mouser, quickly becomes an indispensable item on any developer’s bench.
Contact Details and Archive...