Bluetooth Low Energy

Bluetooth Low Energy (BLE) is a Bluetooth extension especially optimized for low-power accessories, e.g., heart rate monitors, battery-powered plant sensors, etc. BLE can also be used to control lights (on/off, color, effects), to start and stop motors, to open valves for filling up swimming pools, etc.

In marketing literature, BLE is often called Bluetooth Smart.

BLE and smartphones

Nearly all modern smartphone support BLE, therefore BLE acessories can be remotely monitored and controlled through smartphone apps. This combination of peripherals and apps is sometimes called an "appcessory" (i.e., app plus accessories). Smartphones are the driver that is pulling BLE into the mainstream, as a mass-market technology.

Beyond smartphones

In some situations, accessories should be monitored and controlled unattended, without any user (and smartphone) in the vicinity. In these cases, special BLE Controllers come into play. They can react quickly on their own, e.g. to close the valve when the swimming pool is filled up, without requiring further user interaction.

"Last meters" of the Internet of Things

If an Internet connection is available, it can be used to funnel data from BLE sensors to the Internet, or from the Internet to BLE actuators. For example, temperature and humidity in a greenhouse may be sent to a monitoring service in the cloud, commands to open or close the valve of a water tap could be sent back.

Given such gateway support in a controller, BLE becomes a technology for the "last meters" of an Internet of Things application.

Remote software updates

Typical BLE controllers are preprogrammed for specific applications, e.g. for some gardening tasks. If a BLE controller supports remote software updates over the Internet, these applications can be kept up-to-date, without user intervention. For example, if a new security threat appears, a security update can be sent to the controller.

Smart controllers

A BLE controller may be a "dumb" gateway, i.e., merely forward data between sensors and some cloud service on the Internet. A "smart" controller on the other hand is programmable and can increase robustness against communication failures between the controller and the other endpoint(s) on the Internet:

 

  • By buffering sensor data on the controller until the cloud connection is re-established.
  • By implementing the minimum "business logic" on the gateway, e.g. to open an emergency door when a fire alarm occurs.

Further possible benefits of a smart controller are cost and latency:

  • By detecting relevant events, communication costs can be reduced by only communicating when truly valuable information has become available, e.g., when a tank has become nearly empty and needs to be refilled.
  • The controller can react immediately to an event, whether or not there currently is an open connection to the cloud. For example, a physical access control system may have its own store of people who are currently allowed to enter a building. No legitimate person is prevented from entering the building, simply because the Internect connection is currently unavailable.

Sandboxes

Programming a controller is usually done by its vendor. However, given sufficiently robust "sandboxing" features, some degree of programmability may be made safely accessible to customers as well.

Case study

One of the Mountaineer Group companies, Oberon microsystems, has developed a smart BLE controller with a built-in 3G GSM gateway as a case study. The controller components are briefly described below. They are not available as off-the-shelf products, but Oberon microsystems can adapt, optimize and license their design as part of a more comprehensive engineering mandate.

For the case study, Oberon has used the Gadgeteer hardware standard for a simple plug-and-play integration of the involved modules. For a high-volume product, all components would typically be integrated on a single printed circuit board.

BLE module

The BLE Module handles the wireless connection to BLE peripherals. It has its own microcontroller and operates in the BLE central role. It connects to a Gadgeteer mainboard via a "U" type socket (UART) for data transfer. Its firmware implements a remote procedure call mechanism over the UART connection.

GSM module

The GSM Module handles the connection to the Internet. It can be populated with 2G or 3G modules. It connects to a Gadgeteer mainboard via a "K" type socket (UART with hardware flow control) for data transfer. Its firmware supports TCP/IP and SMS communication.

Mainboard

As mainboard, the small Mountaineer USB Mainboard was used. Its firmware and the application program can be updated remotely, "over the air". It contains an STM32F4 microcontroller and executes a language runtime, the driver for the BLE module, the driver for the GSM module, and the controller application itself.

.NET runtime

The controller uses Oberon's Mountaineer Prime Firmware, based on the open source NETMF for STM32 platform, which is a high-quality implementation of Microsoft's .NET Micro Framework. It supports robust in-field updates of the firmware, the application, or both. Encrypted and signed update images can be deployed via GSM. The light-weight .NET runtime provides the safety and security of a .NET sandbox even on single-chip microcontrollers.

Programming in C# using Visual Studio

The .NET Micro Framework supports convenient cross-development and symbolic cross-debugging in C# from Visual Studio. The same developer know-how, development tools and even part of the code base can be reused across all platforms, from the controller to the PC, server, smartphone, tablet all the way to the cloud.

Controller application

In a typical scenario, the gateway periodically obtains data from the sensors paired with the controller, and pushes this data to a cloud service. Or it may first process the data, e.g., to detect alarm conditions, and only pushes the data when a relevant condition is recognized. Either way, the controller acts as a Web client.

Access across firewalls and NATs

Alternatively, the controller may cache the data that it has received from the BLE sensors, and provide it via a REST API upon request. In this mode, the controller acts as a Web server. Such a server can support the remote control of BLE actuators, e.g., to open doors, close valves, etc. To enable secure access to the server across firewalls and network address translation, the Yaler relay service is used.

Engineering services

If you are interested in minimizing time-to-market and technical risks for your BLE controller developments - on embedded hardware design, or iOS and Android development - the Mountaineer Group is at your service!

Limmat Reference Board

The above case study has shown a prototype based on our Mountaineer boards. After successful tests of this prototype, an integrated single-board computer was designed, which incorporates all necessary components, and uses a more powerful member of the STM32 microcontroller family.

The design of this Limmat Reference Board can be adapted to your specific needs and then licensed to you for production. Evaluation kits will be available in June 2015. For more information, see http://www.limmat.co.

OberonHAP

As a spin-off project of the Limmat secure firmware update mechanism, OberonHAP, a high-performance, low-footprint implementation of Apple's HomeKit Accessory Protocol was developed: http://oberonhap.com.