6 Ways to Manage Power in your IoT Solution
The Helium ecosystem makes a lot of hard things possible. One of these areas is power management. When using the Helium Atom Dev Board, there are several things that a Helium Script author can do to control how quickly power is consumed. Let’s examine a few.
Determine Power States
The first thing to understand is that the Atom Dev Board, which runs Helium OS, will determine what power state the system needs to be in: high power or low power.
Most of the time, the system should be in low power. Typically this means that the core system is drawing less than 1 milliamp of power. In this state, the board is waiting until some future point where it needs to go back into high power to report status or take samples.
Consider Both Switched Power and Constant Power
On the sensor bus, there are two different power pins. One of them is for constant power: this is a line that’s always connected to power either from the battery or USB. The other is the switched power pin, and this line is only connected to power when the Helium Script turns it on.
Some parts and applications need to be connected to constant power to work properly. Others will draw a substantial amount of power unless they are turned off. With the switched power pin, users can control whether or not their devices will be drawing power when they are not actively being used.
On the Dev Board, the constant power pin is labeled Vdd while the switched power pin is labeled Vsw.
Use the Power API
The Power API that’s provided as part of the Helium Script library is quite simple: there’s a function to turn the power on or off; and a function to read whether the power is currently on or off. (The full power API is documented here.)
Typically, a user will want to turn power on, perform their sensor readings, and then turn the power back off again. Remember that the device you attach to the sensor bus will draw power. Use the switched power pin (Vsw) and the power API to use as little power as possible while sleeping.
Optimize Transmission Intervals
Under most cases, the largest power consumer on the Atom Dev Board (and any wireless sensor) is the radio. When the device goes into low power mode, the radios are off and can neither transmit nor receive information. One tactic to minimize power usage is to use a long sampling interval. It may seem obvious, but it’s a major factor in power usage. Study your deployment to determine how often you need to report a data sample. Helium enables you to customize your interval sampling based on these needs. The longer time between reports, the longer battery life your application will achieve.
Disconnect Sampling from Transmission
Many applications can disconnect sampling from transmission. When the board wakes up from sleep to capture more sample data, it will only turn on the radios if more data has been reported. Additionally, there’s overhead required for each radio wake up. These two concepts can be used to identify a few other power optimizations.
First, if the application allows it, aggregate data in an average. This can be done on the Helium Dev Board before the data is transmitted over the network. If the application requires that temperature be sampled and averaged over a period of time, your Helium Script can specify that all those samples can be acquired and stored and then simply reported once. For example: a script may sample temperature once every minute and then only report the whole 15 minute average. Even though the script would have woken from low power 15 times, only one wake would require the power utilization of waking up the radios.
Second, many samples can be reported together and all reports will share the radio wake-up overhead. There’s a window of time where the radio will wait for more information to transmit or receive. If new information is sent in this window, the window is extended. A user can use this behavior to have a Helium Script collect several samples over time and then report them all at once.
Using Interrupt Pins
Many devices are able to output an electronic pulse on one of their pins when certain events occur. These are called interrupts. The Helium Atom Dev Board is able to wait for these events as long as the output pin that generates the event is connected to one of the INT pins on the Dev Board
The Atom Dev Board is able to remain in low power until one of these events happens. If your part is able to wait in a low power mode and generate an interrupt, it’s possible to only wake up and report events when the event happens. This avoids having to wake up and poll the device on a regular basis.
A Simple API Yields Many Options
The Helium Atom Dev Board has a fairly simple power API. Putting it to use along with a little knowledge about how the whole system works gives the user flexibility and options to increase battery life. To test some of these methods, buy a Helium Development Kit and try your hand at writing some Helium Script.