When building a battery-powered product, you need to make the most out of what little power you have to work with. Even if you are supplementing a LiPo battery with some kind of energy harvesting system (e.g. solar or wind), those external systems are variable by nature, meaning you should always strive to build the most power-efficient product possible.
This is why the Blues Notecard is so popular when weighing wireless connectivity options in the IoT.
In this article, I'll provide some tips for getting the most battery life out of your product, especially as it pertains to using the Notecard - whether it's utilizing Cellular, Wi-Fi, or LoRa connectivity.
Be sure to consult the Low-Power Design Guide for a deeper technical dive into the low-power capabilities of the Notecard.
- Maximize the Notecard's Power Management Capabilities
- Use Voltage Variable Behaviors
- Take Advantage of Flash Storage on the Notecard
- Use the Right Radio Access Technology
- Streamline Your OTA Firmware Update Process
- Put the Host to Sleep with the Notecard
Maximize the Notecard's Power Management Capabilities
While you can override virtually every behavior of the Notecard via the Notecard API, its default is an "occasionally connected" low-bandwidth device. When not connected, this generally means the Notecard is in an idle state. And when it's idling, your instinct might be to cut power to the Notecard entirely (but that may actually work against you!).
The Notecard Cellular is built around a low-power STM32 host MCU and idles at a mere ~8µA@5V (other Notecard models are comparable - with the Notecard Cell+WiFi idling at ~18µA@5V and the Notecard WiFi at ~12µA@5V).
In most applications you may actually use more energy by disabling the Notecard and cold-booting than if you just left it idle!
Use Voltage-Variable Behaviors
As an "occasionally connected" device, the Notecard is often programmed to establish a network connection and sync data with the cloud at a user-defined cadence (e.g. once every 10 seconds, 10 minutes, 10 hours, 10 weeks, you get the picture...).
As battery voltage levels change, you may need to extend the life of the product's battery and have it sync less frequently based on the reported voltage. This is where the voltage-variable behaviors of the Notecard come into play.
Based on the battery technology in use, you can set a cadence at which the Notecard will sync with Notehub to specific voltages (i.e. it can sync less often as voltage levels drop).
For example, say you're powering your system with a LiPo battery. You would start with this card.voltage request:
{
"req": "card.voltage",
"mode": "lipo"
}
This is equivalent to the following voltage levels:
"usb:4.6;high:4.0;normal:3.5;low:3.2;dead:0"
. Meaning, when the battery is >=
4.0V the voltage is considered "high". Where is this "high" value then used? In
a hub.set request, which
dictates how often the Notecard will sync data with the cloud:
{
"req": "hub.set",
"mode": "periodic",
"voutbound": "usb:30;high:60;normal:90;low:120;dead:0",
"vinbound": "usb:60;high:120;normal:240;low:480;dead:0"
}
In the above example, the Notecard will perform an "outbound" sync (from Notecard TO Notehub) every 60 minutes when voltage is "high", every 90 minutes when voltage is "normal", every 120 minutes when voltage is "low", and so on. It will also perform an "inbound" sync (from Notehub TO Notecard) every 120 minutes when "high", etc.
Likewise, you can set up these same behaviors when using the GPS/GNSS module on the Notecard. While you may want the Notecard to start tracking location data on a more frequent cadence when voltage levels are high, you may also want those power-intensive GPS events to happen less frequently as voltage levels wane.
{
"req": "card.location.mode",
"mode": "periodic",
"vseconds": "usb:3600;high:14400;normal:43200;low:86400;dead:0"
}
In this example, the Notecard will use the onboard GPS module to sample location at an increasingly longer cadence as voltage levels drop (i.e. every 14400 seconds when "high", every 43200 seconds when "normal", and so on).
Take Advantage of Flash Storage on the Notecard
There is approximately 1MB of user-accessible flash storage available on the Notecard, so use it! Unless you absolutely need to sync data with the cloud ASAP, you can store a lot of data on the Notecard itself prior to a sync. For example, performing one large sync every hour/day/week is generally more efficient power- and data-wise than syncing every time you create a new Note.
Consult our guide on cellular data usage to estimate usage in a variety of scenarios.
You can also get even more out of the flash storage on the Notecard by leveraging templated Notefiles. These templates provide the Notecard with a "schema" to apply to future Notes added to the Notefile. The template acts as a "hint" to the Notecard that allows it to internally store data as fixed-length records rather than as flexible JSON objects (which tend to be much larger).
For example, if my product is relaying the same set of sensor data in a note.add request like this:
{
"req": "note.add",
"file": "readings.qo",
"body": {"temperature":32.4, "humidity":56, "pump_state":true}
}
I can first create a templated Notefile with body
arguments that correspond to
the proper data types
used in the note.add
requests (above):
{
"req": "note.template",
"file": "readings.qo",
"body": {
"temperature": 14.1,
"humidity": 11,
"pump_state": true
}
}
After this note.template
request runs, the Notecard will automatically apply
the template to all Notes added to the readings.qo
Notefile.
Use the Right Radio Access Technology
There are Notecard varieties that support different Radio Access Technologies (RATs), including cellular, Wi-Fi, and LoRa. For applications requiring minimal data transfer, NB-IoT can be a more power-efficient choice, especially over long distances. Likewise, if in range of a Things Stack LoRaWAN gateway, using the Notecard LoRa is another great option, as LoRa devices use minimal power when idle and when transmitting.
To force a Notecard Cellular to use NB-IoT, simply issue this request to the Notecard:
{
"req": "card.wireless",
"mode": "nb"
}
There are pros and cons for using Cat-1 vs LTE-M vs NB-IoT, so be sure you are aware of those before committing to one cellular protocol!
Streamline Your OTA Firmware Update Process
To optimize your remote OTA firmware update process, be sure to leverage the Notecard's OTA DFU (over-the-air device firmware update) capabilities. This starts and ends with Notecard Outboard Firmware Update.
By utilizing Notecard Outboard Firmware Update with a modern host MCU, your firmware updates will be as compact as possible and efficiently delivered to the Notecard with minimal impact on battery life.
Read our full guide on implementing Notecard Outboard Firmware Update.
Put the Host to Sleep with the Notecard
When building a power-conscious solution, you may want to put the host MCU to sleep. The note.attn API allows just such functionality.
Using the "mode":"sleep"
argument, you can instruct the Notecard to pull the
ATTN
pin low, which can be used by the host to sleep the host MCU:
{
"req": "card.attn",
"mode": "sleep"
}
Read more about this feature in our Host Power Management guide.
Wrapping Up
Incorporating the Blues Notecard into your IoT toolkit offers numerous advantages when building battery-efficient devices. By focusing on the Notecard's power management features, choosing the right communication protocols, optimizing for OTA DFU, and putting the host to sleep, you can develop IoT solutions that are not only efficient but also robust and sustainable.
Get started with Blues by picking up your own Blues Starter Kit today! 💙