Discover the art of crafting energy-efficient IoT devices in this comprehensive guide, where we delve into optimizing Bluetooth connectivity for extended battery life, innovative voltage drop mitigation techniques, precise battery life calculation methods, and strategies for enhancing button and switch energy efficiency. As the digital world evolves towards more connected yet power-conscious solutions, understanding these key aspects becomes crucial for developers.
While the specific examples and calculations you will encounter in this article are based on data from one of our real-world projects, the general principles and approaches underpinning our reasoning and conclusions can be applied to the majority of low-power device projects. Specifically, in our project, a smart medical device employed the Nordic Semiconductor nRF52840 SoC with BLE support. Also, when discussing some topics related to power elements, we consider the CR2032 battery as a specific example, which was used in the smart medical device.
Whether you are a seasoned engineer or an enthusiast in the field of IoT, join us on this journey to unlock the secrets of low-power device design.
Efficient Bluetooth Advertising for Enhanced Battery Life
In the world of low-power devices, Bluetooth connectivity is a fundamental feature that enables seamless communication between gadgets. Yet, this invisible thread of data exchange is tethered to the finite resource of battery power. Our exploration delves into crafting the most effective Bluetooth advertisement strategies to conserve this valuable energy.
The quest begins in a state of quiescence, with peripherals in repose and General-Purpose Input/Output (GPIO) ports holding their default stances. One pin, a designated contact point on the microcontroller configured to detect and respond to external signals, remains alert, acting as a solitary sentinel awaiting events. The power mode selected is NRF_POWER_MODE_LOWPWR, eschewing the energy demands of constant latency for a more measured consumption. In this initial state, the current draw stands close to 500 uA (microamps).
As we tune the transmission power, we find it acts much like the volume knob on a radio; as we dial down from 0dB to -40dB, the power drain decreases correspondingly, offering a clear path to energy savings. The same principle applies to the rhythm of Bluetooth advertisements. By spacing out the intervals from brisk 20ms to more relaxed units or even dozens of seconds, we observe a dramatic drop in energy usage, descending to just uAmps.
Subtle attributes like the appearance of the device and the length of its name play their parts in this energy expenditure. A device that announces its appearance consumes slightly more power while shortening the device name from 17 bytes to a single byte can shave off a portion of the power budget.
After the intricacies of advertisement configurations are addressed, the device retreats into a deep ‘Power OFF’ mode, with the debug port inactive and the current draw at an almost imperceptible 1-2uA. It’s a stark contrast to the active state, highlighting the efficiency of the power-saving measures.
Temperature too weaves into the narrative, with the device drawing more current as the ambient warmth rises. This environmental sensitivity underscores the need for thermal considerations in design and deployment.
The narrative of Bluetooth advertisement is one of balance and precision. The optimal strategy that surfaces is not one of absolutes but of context-dependent choices. By attenuating the transmission output level, extending advertising intervals, and simplifying the digital identity, devices can maintain their communicative roles while extending their operational lifespans on a single charge or battery life.
Mitigating Voltage Drops in Low-Power Device Design
In the realm of low-power connected devices, managing power consumption is as critical as the functionality of the device itself. A common strategy for conserving energy is the dynamic switching on and off of electronic circuits. While this method is effective for minimizing idle current draw, it introduces the challenge of voltage drops.
A voltage drop is a reduction in electric potential across a component or circuit. It is particularly pertinent in battery-powered devices because the voltage isn’t constant and decreases as the battery discharges. This relationship between battery life and voltage is represented by a discharge characteristic, often denoted as U=f(work time), where ‘U’ stands for voltage. This equation is a fundamental principle in power management, as it relates the operational time (‘work time’) directly to the battery’s voltage output (‘U’). For a fresh look at this, refer to Figure 1, showing the voltage of a brand new CR2032 battery, and Figure 2, illustrating the voltage drop in a 50% discharged battery.
Figure 1: Brand New CR2032 Battery
Figure 2: 50% Discharged Battery
When a device switches on, a sudden increase in power demand can lead to a temporary voltage drop. This phenomenon is akin to the flicker you might notice when high-power appliances are turned on at home. In our devices, such voltage drops can inadvertently trigger a Power Fail Comparator (POF), a safeguarding component recommended by leaders in the industry like Nordic Semiconductor. The POF is designed to monitor the battery voltage and signal when it falls below a certain threshold, indicative of a low battery state.
Software Strategies
To counteract these unwanted voltage drops, our firmware engineers employ a series of software strategies. A sequential switching mechanism is one such strategy, where different parts of the circuit are powered on at staggered intervals. This disperses the transient processes over time, reducing the magnitude of any single voltage spike, as demonstrated in Figure 3.
Figure 3: Voltage Level After Implementing Sequential Switching
We also tailor the sleep modes of peripheral Integrated Circuits (ICs) to a ‘low-power slumber’, ensuring they wake with minimal energy waste. This nuanced approach keeps the device’s power draw in check, aligning with our energy-efficient ethos.
Hardware Solutions and Their Impact
The unsung heroes in our battle against voltage drops are capacitors and resistors. Upon switching, a transient power demand occurs, prompting the main capacitor to share its charge with the peripheral decoupling capacitor. This dance of charge is a delicate one, as seen in Figure 4, where the main capacitor experiences a voltage loss, momentarily destabilizing the system.
Two hardware remedies stand at our disposal:
Elevating the Protection Resistor’s Value: This method is akin to adding a buffer, slowing the energy transfer to cushion the voltage drop. It’s a balancing act, as too high a value can starve the peripherals of power in a steady state.
Boosting the Main Capacitor’s Value: A larger capacitor can store more energy, offering a bulwark against voltage dips. However, as capacitance grows, so does the physical size and leakage current.
As shown in Figure 4, the power comes from a battery, which has an internal resistance labeled “Ri.” A switch controls the power flow. There’s a protection resistor to limit the current and safeguard the circuit. The main capacitor stabilizes the voltage supply. Close to the peripheral unit, there’s a decoupling capacitor to filter out noise from the power supply. Lastly, the peripheral unit is the end device powered by the circuit.
Figure 4: Power Supply Circuit with Decoupling and Protection Components
One of the possible solutions that stands out is the utilization of separate batteries for power-sensitive parts of the circuitry, such as microcontrollers, and another distinct battery for less sensitive peripheral ICs. This method is depicted in Figure 5. By isolating the power sources, we create a steadfast environment for the most critical components, ensuring they are insulated from any voltage instability that could otherwise compromise their operation.
Figure 5: Dual Battery Configuration for Sensitive Components
Enhancing Button and Switch Reading in Low-Power Designs
In the cutting-edge field of low-power design, every microampere counts. The mission is clear: to read user inputs like buttons and switches with an eagle eye on energy efficiency. In one of our projects, we tackled the challenge of current leakage—a common issue where electricity slips away, akin to a dripping faucet. Our goal was to transform this trickle into a drop, reducing the current leakage from a substantial 300µA per GPIO to a mere 7µA for all GPIOs (General-Purpose Input/Output) combined.
Traditional Approach vs. Innovative Solution: In traditional GPIO design, buttons are wired to create a direct path to the ground, triggering a response when pressed, similar to ringing a doorbell. The microcontroller from the Nordic nRF52 series, which is utilized in the connected medical device mentioned earlier, is more energy-efficient than the previous nRF51 models. The design advancements in the nRF52 series contribute to its reduced power consumption. However, a long-pressed button can still lead to wasted energy as it continuously completes the circuit. An innovative solution is to check the button’s state at set intervals, which avoids unnecessary power consumption. It’s like glancing at the doorbell occasionally instead of pressing it constantly. In this setup, an internal resistor is temporarily activated to charge a capacitor, akin to priming a clock, then the system enters a vigilant state. It assesses if the button’s state has changed since the last check—like a guard scanning for any new activity. If nothing has changed, the system resumes its energy-saving stance, staying alert without expending power until it’s time to check again.
A Hybrid Approach: Why choose one method when you can harness the strengths of both? Our optimal solution blends interrupt-based reading with polling. When the button is unpressed, we rely on interrupts for immediate response—there’s no latency in our digital doorbell. Should the button be held, we switch to polling mode to prevent energy leakage, resuming interrupts when the button is released. This hybrid method offers dual benefits: simplicity in code, as debouncing — the elimination of false signals from the ‘bouncing’ effect of a button press — is handled solely in the interrupt logic, ensuring a clean, single activation is recognized. Additionally, this approach leads to reduced click latency during active use, maintaining a responsive user experience.
Empirical Results and Best Practices: Our hands-on application of this hybrid method significantly reduced the current leakage from 300µA down to a mere 7µA for all GPIOs, achieving this with a polling interval of 500ms and a rapid charge time-span of just 2ms. Importantly, we observed that the overall current consumption is less about the number of GPIOs and more about the activity within the main loop. To demystify, the ‘main loop’ is the central set of instructions that a microcontroller continuously cycles through during operation. Think of it as the heartbeat of the device’s firmware, where it checks for inputs, performs calculations, and controls outputs. Keeping this heartbeat, or main loop, ‘lean’ means writing the code in a way that it performs these tasks efficiently without unnecessary steps that could drain power. Why does this matter? Because for each polling interval, the microcontroller must complete at least one cycle of this main loop. The leaner the loop, the less time and energy are spent on each cycle, leading to significant energy savings over time. In essence, a streamlined main loop contributes to a longer battery life, ensuring that our low-power devices remain both responsive and energy-efficient.
Utilizing Tools for Enhanced Energy Efficiency
In our continuous effort to refine low-power device design, our engineers combine their technical knowledge and practical experience with effective, SoC manufacturer-recommended tools. One such practical tool is the Power Profiler Kit II (PPK2), recommended by the chip manufacturer for our project. This device enables us to measure the current consumption of embedded devices across various modes, offering a clear insight into their energy profile.
Figure 6. Power Profiler Kit II (PPK2)
With the Power Profiler software installed on nRF Connect for Desktop, we can visualize and analyze the data collected by PPK2. This software tool is a window into the device’s power consumption, showing us real-time measurements and allowing us to export the data for further analysis.
Figure 7. nRF Connect for Desktop — Cross-platform development software for Nordic Products
The precision of our power measurements hinges on the techniques we employ. Our engineers perform measurements in a steady state to ensure a flat current chart, representative of the device’s typical behavior. They select the appropriate dynamic range to capture all relevant data, avoiding spikes that could skew the results. By choosing a measuring window that fits at least 10 periods of the device’s operation, we achieve stable and accurate values through averaging. We also account for overlapping periodic processes by adjusting the window to the lowest frequency, ensuring that we capture all aspects of the device’s power consumption. The empirical data gathered with PPK2 informs our design choices and helps us to confirm that each specific mode of the device does not exceed expected current consumption, and that the overall power budget aligns with our goals for energy efficiency. Up next, we explore the essential calculations for confirming our device’s longevity in practical use.
Calculating Battery Life in Low-Power Devices
With the detailed energy consumption data from PPK2 in hand, we can evaluate if this aligns with our battery’s capacity, ensuring our device functions effectively for its expected lifespan on a single, non-replaceable battery. Let’s begin with the battery, our energy reservoir. Take the CR2032 type as an example, known for its nominal capacity of 240 milliampere-hours. This capacity, however, isn’t static; it degrades over time due to self-discharge, a natural phenomenon where a battery loses its charge without any connected load. If we have a self-discharge rate of 4% per year and store our CR2032 for two years, its available capacity diminishes slightly to 220.8 milliampere-hours.
On the other side of the equation, we have the device’s power consumption, which isn’t constant either. It varies depending on the device’s operating modes. A device might switch between periods of high energy use, which we call ‘Fast Advertising Mode,’ and more extended durations of low energy use, or ‘Slow Advertising Mode.’ In technical terms, ‘Advertising Mode’ refers to periods when a device is actively communicating its presence to other devices or systems, a common operation in Bluetooth and wireless technologies. During ‘Fast Advertising,’ the device sends out signals more frequently, using more power. Conversely, ‘Slow Advertising’ involves less frequent signaling, conserving energy. When not in either advertising mode, the device falls into ‘Idle Mode,’ where it operates with minimal power, similar to a car engine idling.
Building on the insights from our previous chapter, where we examined the process of measuring a device’s power consumption in various modes, we calculate the energy used in each mode, summing up to the total energy expenditure over time. A hypothetical device might spend 1560 seconds a year in fast advertising at 0.6 mA, and 4,492,800 seconds in slow advertising at 0.01 mA, with the remainder in idle mode. To calculate the total charge expended (Qexp), we multiply the current by the duration for each mode and sum them up.
Modes | Duration, sec | A current consumption | The charge, mA*h |
Fast advertising | 30*52=1560 | 0,6mA | 0,6*1560/3600=0,26 |
Slow advertising | 3600*24*52=4492800 | 0.01mA | 0,01*4492800/3600=12,48 |
Totally Qexp | 0,26+12,48=12,74 |
If our device uses 12.74 mAh annually and our adjusted battery capacity is 220.8 mAh, we’ve got a green light for the power budget. When considering this balance, we must not overlook the effect of temperature, as it can influence both battery capacity and device power consumption in significant and often non-linear ways. Additionally, given the variable nature of digital devices’ power needs, accurately measuring current consumption becomes crucial, requiring precise instruments or robust capacitors to even out the fluctuations. Understanding these factors is key to designing and using low-power devices efficiently, ensuring that they last as long as needed, whether they’re deployed in remote sensors or worn as smart devices.
Embarking on a Journey of Expert Collaboration
Wrapping up our conversation on essential practices for low-power device design, remember that what’s been covered barely scratches the surface. Our team possesses a wealth of deeper insights and sophisticated techniques crucial for innovation in Bluetooth-connected devices. Partnering with us opens the door to extensive expertise that has enabled countless clients to lead in innovation.
Let’s talk about your project and explore how we can help. Reach out to us today to set up a consultation.