GBP | USD

Dev Platform Speeds Development of Low-Power Bluetooth-Enabled IoT Designs

Contributed By Digi-Key's North American Editors

Bluetooth-enabled IoT devices provide ready access to data through smartphones and other gateway devices. Still, the design of low-power, battery-operated IoT solutions remains challenging in terms of both wireless sensing as well as optimization of power-draining communications subsystems. For designers with ever tightening time-to-market windows, the design task needs to be simplified.

To help developers meet the challenges of low-power design complexity and time-to-market pressure, STMicroelectronics and Enmo Technologies combined their SensorTile development kit and Bluetooth software expertise, respectively. Together they offer a simple approach for rapid development of battery-powered IoT devices able to meet tight power budgets.

IoT hardware and software need not be difficult

The emergence of integrated Bluetooth solutions has significantly aided developers looking to leverage the pervasive availability of mobile Bluetooth-enabled devices. Besides reducing design complexity, off-the-shelf Bluetooth solutions directly speed market delivery because they are typically certified to comply with regulatory requirements. For most developers, however, the task of combining these sophisticated ICs with multiple sensors and a host MCU remains a lengthy and involved process. Further, development of the associated software drivers, middleware, and application software can cause even the most experienced development team to stumble.

The STMicroelectronics SensorTile development kit offers a complete IoT development solution that combines a wireless sensor system board, a pair of carrier boards, and a comprehensive software development package. Designed to work with the SensorTile environment, the Enmo Technologies IoT.Over.Beacon software platform provides a unique solution for minimizing power consumption in Bluetooth-enabled IoT designs. Together, the SensorTile kit and Enmo platform enable developers to implement a complete, low-power IoT device solution with minimal effort, or use those same hardware and software components as the basis for custom designs.

Wireless sensor node

As the centerpiece of the kit, the SensorTile core system board is a standalone Bluetooth-enabled sensor system with a footprint of 13.5 mm x 13.5 mm. Based on a 32-bit ARM® Cortex®-M4F-based STM32L4 MCU, the core system includes the STMicroelectronics BlueNRG Bluetooth transceiver and multiple sensors, all communicating through SPI connections or specialized interfaces (Figure 1).

Diagram of STMicroelectronics SensorTile core system

Figure 1: The SensorTile core system provides a complete wireless sensor solution that combines a low-power MCU, Bluetooth transceiver, multiple sensors, balun, and even an integrated antenna in a 13.5 mm x 13.5 mm form factor. (Image source: STMicroelectronics)

ST packs the board with an extensive set of its own sensors including its LSM6DSM inertial measurement unit (IMU), LSM303AGR eCompass module, LPS22HB pressure sensor, and its MP34DT04 MEMS microphone. Along with an onboard low dropout (LDO) regulator, the core board includes the STMicroelectronics BALF-NRG-01D3 miniature balun, which integrates a harmonics filter and matching network customized for the BlueNRG transceiver. A TDK ANT016008LCS2442MA1 multilayer antenna completes the design of the wireless sensor system.

Developers can use two different options to connect the core board to the kit’s accompanying carrier boards or to their own system designs. On the sides of the board, a set of pads allow developers to solder it to the cradle board or other pc board. The back of the board includes a connector for mounting it to the expansion board, or any other cable or board with an appropriate connector (Figure 2).

Image of STMicroelectronics SensorTile core board

Figure 2: Developers can plug the SensorTile core board into the socket on the SensorTile development kit’s expansion board to take advantage of additional options including Arduino-compatible peripherals. (Image source: STMicroelectronics)

Both the pc board pads and back connector bring out a number of MCU pins including SPI, I2C and UART interfaces, a pulse-density modulation (PDM) interface, analog-to-digital converters (ADCs), and ST’s serial wire debug (SWD) interface (Figure 3).

Board pin CONN pin Pin name MCU pin Main functions(1)
1 2 MIC_CLK PC2 DFSDM1_CKOUT, ADC
2 4 VDD_OUT VDD/VBAT 1.8 V from onboard LDO
3 6 VIN / Power supply for LDO [2 V - 5.5 V]
4 8 VDDUSB VDDIO2
VDDUSB
Power supply for USB peripheral and
VDDIO2 [1.8 V - 3.3 V]
5 10 GND VSS Ground
6 12 RXD/USB_DP PD2/PA12 USART5 RX of USB_OTG_FS DP(2)
7 14 TXD/USB_DM PC12/PA11 USART5 TX or USB_OTG_FS DM 1
8 16 SAI_CLK PG9(3) SAI2_SCK_A, SPI3_SCK
9 15 SAI_FS PG10(3) SAI2_FS_A, SPI3_MISO
10 13 SAI_MCLK PG11(3) SAO2_MCLK_A, SPI3_MOSI
11 11 SAI_SD PG12(3) SAI2_SD_A, SPI3_NSS
12 9 GPIO2 PB8/PB9/PC1 DFSDM_DATIN6, I2C3_SDA
13 7 GPIO3 PC0 DFSDM_DATIN4, I2C3_SCL
14 5 NRST NRST STM32 Reset
15 3 SWD_CLK SWD Programming interface clock
16 1 SWD_IO SWD Programming interface IO
17 / GND Ground
18 / GND Ground

Notes:
(1) Refer to STM32L476 datasheet on st.com for the complete set of functions of each pin
(2) USB_OTG_FS Peripheral is functional for VDDUSB >e; 3 V
(3) Logic level of this pin is referred to VDDIO2

Figure 3: Developers have access to a subset of MCU pins through the board’s pc board pads or through a dedicated connector placed at the back of the board. (Image source: STMicroelectronics)

Although the core board can be used as a standalone solution, the kit’s carrier boards provide designers with alternatives for development and deployment of IoT designs based on the SensorTile. The cradle board and accompanying schematics demonstrate how developers can augment the core systems with additional sensors and other peripherals. The board includes an STMicroelectronics HTS221 sensor for humidity and temperature. In addition, the cradle board includes an SD card socket, micro-USB interface, on/off switch, and battery pack. Designers simply solder the core board to corresponding pads on the cradle to take advantage of the additional peripherals. After development, designers can remove the cradle board’s break-away SWD interface for production delivery.

The kit’s expansion board provides an even simpler method for developing custom designs. Developers need only plug the core board into the expansion board using the dedicated connector (Figure 2). Along with the SWD interface for software development, the expansion board provides additional connectors including a micro-USB connector, audio jack, and Arduino-compatible connectors.

Instant deployment

Developers can begin exploring Bluetooth-enabled IoT design simply by plugging the core board into the expansion board (or soldering it onto the cradle board), connecting it to a host PC via USB for power, and downloading the supported Android or iOS mobile apps. The development kit comes with the core system already programmed with firmware supporting three sample applications demonstrating sensor data logging to the SD card, MEMS microphone audio streaming, and sensor data streaming using Bluetooth low energy (BLE) with the ST BlueMS app for Android or iOS.

Besides providing software for instant deployment of SensorTile applications, the sample applications serve as guidelines for working with the SensorTile’s multilayered architecture. Along with ARM Cortex Microcontroller Software Interface Standard (CMSIS) components, STMicroelectronics builds on its own STM32Cube environment to provide a hardware abstraction layer (HAL) and board support package (BSP). These layers in turn interface with the underlying hardware on the STLCS01V1 core board, STLCX01V1 expansion board, and STLCR01V1 cradle board (Figure 4).

Image of STMicroelectronics SensorTile software package

Figure 4: The SensorTile software package provides sample applications built on STMicroelectronics’ STM32Cube device software layers. It abstracts complex hardware interactions to a few simple software calls. (Image source: STMicroelectronics)

Despite its apparent complexity, the layered architecture provides developers with a simple abstracted view of sensor data acquisition and wireless communications. For example, the BLE streaming application demonstrates how developers need call only a few initialization routines before the main wait loop (Listing 1). The main loop waits for key events including expiration of a timer that specifies the wait time between sensor data sampling. When the timer handler sets SendEnv=1, the routine collects and transmits environmental data using a single call,

SendEnvironmentalData().

  /* Initialize the BlueNRG */

  Init_BlueNRG_Stack();

 

  /* Initialize the BlueNRG Custom services */

  Init_BlueNRG_Custom_Services(); 

 

  /* initialize timers */

  InitTimers();

 

  StartTime = HAL_GetTick();

  /* Infinite loop */

  while (1){

    /* Led Blinking when there is not a client connected */

    if(!connected) {

      if(!TargetBoardFeatures.LedStatus) {

        if(HAL_GetTick()-StartTime > 1000) {

          LedOnTargetPlatform();

          TargetBoardFeatures.LedStatus =1;

          StartTime = HAL_GetTick();

        }

      } else {

        if(HAL_GetTick()-StartTime > 50) {

          LedOffTargetPlatform();

          TargetBoardFeatures.LedStatus =0;

          StartTime = HAL_GetTick();

        }

      }

    }

 

    /* handle BLE event */

    if(HCI_ProcessEvent) {

      HCI_ProcessEvent=0;

      HCI_Process();

    }

 

    /* Update the BLE advertise data and make the Board connectable */

    if(set_connectable){

      setConnectable();

      set_connectable = FALSE;

    }

 

    /* Environmental Data */

    if(SendEnv) {

      SendEnv=0;

      SendEnvironmentalData();

    }

Listing 1. As shown in this code snippet from the ST SensorTile software package, developers call a few initialization routines prior to the wait loop for new Bluetooth events or sensor data sampling. (Code source: STMicroelectronics)

The SendEnvironmentalData routine steps through each sensor, acquiring data from each sensor using a BSP routine. For example, the pressure sensor BSP routine, BSP_PRESSURE_Get_Press(), updates data contained in a data structure specific to the pressure sensor device. The SendEnvironmentalData routine then transmits the data via Bluetooth with a corresponding call to a BlueNRG service routine, MCR_BLUEMS_F2I_2D().

Designers can adopt the provided software applications with little change or adapt them as needed for their custom requirements. Supported by the STMicroelectronics STM32 Open Development Environment (STM32 ODE), the SensorTile software environment is designed to support open source software libraries and frameworks. The kit comes pre-programmed with ST’s BLUEMICROSYSTEM Open.Framework firmware.

STMicroelectronics’ open environment offers another significant benefit to developers. Rather than remaining locked into specific mechanisms, they can take advantage of third-party software libraries designed to enhance functionality. For power-limited IoT devices, this capability becomes particularly important in leveraging more energy efficient mechanisms.

Reducing power requirements

For many IoT applications, the associated wireless sensor systems rely on battery power and need to meet tight power budgets. The SensorTile core system addresses this requirement in hardware through its use of low-power devices. For example, the sensors require only microamps of power at the low rates typically required in environmental and motion applications. The LSM6DSM IMU uses only 9 μA at 12.5 Hz sample rates, the LSM303AGR eCompass requires only 200 μA at 20 Hz, and the LPS22HB pressure sensor needs no more than 12 μA at 1 Hz.

Further, the STM32L476 MCU requires only 100 μA/MHz (24 MHz) in run mode. The BlueNRG Bluetooth transceiver IC consumes only 1.7 μA in a standby mode that maintains an active BLE stack. Nevertheless, active wireless transmissions typically account for the dominant share of power consumption, and the SensorTile is no different. At 8.2 mA current for transmissions at 0 dBm, the BlueNRG transceiver more than qualifies for low-power applications, but nevertheless remains a significant current consumer for power-constrained designs.

System designers address the power challenges associated with wireless communications by the simple expedient of reducing the number and duration of wireless transmission transactions. Using standard Bluetooth communications, however, developers have had few options for limiting power consumption. Typical Bluetooth-enabled applications rely on device discovery and pairing with repeated polling checks that result in significant power consumption without actual data exchange. In addition, standard Bluetooth pairing brings significant logistical complications to IoT deployment because each IoT device needs to be put into discovery mode. It then must be manually paired with the mobile device, or other data aggregator.

Bluetooth’s beacon mechanisms provide an alternative that eliminates the power and logistical issues associated with discovery and pairing. Unfortunately, standard beacons are not designed to carry any data payload such as sensor data.

However, with its IoT.Over.Beacon technology, Enmo Technologies combines the power-saving advantages of beacon technology with the data exchange capabilities of Bluetooth’s paired device technology. As a result, Enmo’s mechanism can deliver variable sized payloads as large as 50 Kbytes, while maintaining the low-power requirements needed for extended operation in battery-powered IoT devices.

As with the native SensorTile environment, developers can take advantage of Enmo’s reference firmware. Although handled transparent to the developer, the Enmo reference firmware replaces low-level STMicroelectronics’ calls with calls to its proprietary IoT.Over.Beacon library for SensorTile.

To accomplish this, developers need to load the reference firmware using the STM32 ST-Link utility, which provides a simple graphical user interface for file selection and uploading. Once loaded into the SensorTile core board, the Enmo reference firmware interacts over low-power Bluetooth connections with Enmo’s Android and iOS mobile apps. Developers can easily display SensorTile data in the Enmo app using widgets that display sensor data as graphs or tables (Figure 5).

Image of Enmo Technologies’ reference firmware

Figure 5: Once loaded onto the SensorTile, Enmo Technologies’ reference firmware communicates sensor data over Bluetooth to Enmo’s Android or iOS app. (Image source: Enmo Technologies)

A key feature of conventional Bluetooth beacons is their ability to trigger when a mobile device enters and leaves the physical area covered by the beacon-enabled application. For IoT devices, however, the concept of physical entry and exit may not apply.

Enmo provides proprietary mechanisms that mimic the conventional entry and exit paradigm of Bluetooth beacons. Here, developers specify conditions that would trigger entry and exit for an IoT device. For example, a temperature sensing IoT device might initiate the “entry” or “exit” protocols as the temperature moves above or below some set threshold.

As with the native SensorTile software package, the Enmo reference firmware for SensorTile offers an immediate solution for rapidly deploying low-power Bluetooth-enabled IoT devices. Similarly, for custom SensorTile development, Enmo offers a software development kit (SDK) that allows engineers to integrate Enmo’s IoT.Over.Beacon mechanism into their own unique SensorTile IoT applications. Using the Enmo SDK, developers write their custom SensorTile firmware using the STMicroelectronics environment, calling the Enmo IoT.Over.Beacon library when they want to send data via Bluetooth. The library transparently performs the data transfer in IoT.Over.Beacon mode and provides a software callback when the transfer is complete.

Conclusion

Battery-powered IoT designs present significant hurdles for developers looking to rapidly deploy Bluetooth-enabled sensor devices. The STMicroelectronics SensorTile development kit provides a complete solution that can be used as a standalone device or added as a subsystem to existing designs. Even with the SensorTile’s low power requirements, however, standard Bluetooth protocols can rapidly drain power from battery-operated systems.

By combining the ST SensorTile with Enmo Technologies’ unique IoT.Over.Beacon platform, developers can rapidly deploy Bluetooth-enabled sensors able to meet tight power budgets.

Disclaimer: The opinions, beliefs, and viewpoints expressed by the various authors and/or forum participants on this website do not necessarily reflect the opinions, beliefs, and viewpoints of Digi-Key Electronics or official policies of Digi-Key Electronics.

About this publisher

Digi-Key's North American Editors