Fast Tracking BLE Design for IoT and Beacon Applications

There is hardly an embedded device used in our homes, offices and factories that doesn’t have some form of wireless communication. A myriad of devices are all around us chattering away as we’re driving, working out on an exercise bike, or overseeing a manufacturing process. It isn’t so long ago that the opposite was true. The thermostat in our home, our car’s music player, and the escalator in our office were isolated applications; just doing the job they needed to do. There is no doubt that the Internet of Things (IoT) and the industrial form of it, the IIoT, are responsible for the surge in connectivity; but the foundations of this ubiquitous wireless environment are solidly based around the advent of smartphones and their apps.

From an engineering perspective, incorporating any aspect of radio frequency connectivity into a product has come a long way from having to undertake a discrete wireless design. While for very high volume designs the investment in discrete wireless is reflected in a lower bill of material cost, the likelihood is that the time to design it and undertake the necessary radio regulatory approvals outweighs the cost difference compared to opting for a module-based approach. When a marketing specification for a new product is drawn up, the context is usually that it could be used in any country or region of the world. Gone are the days of thinking a product will only be used in the geography where it was sold. A pre-certified wireless module that meets all necessary radio approval standards greatly simplifies the design requirements for creating regional product variants.

Aiding the engineer to speed the job of integrating wireless communication into a design is now a more straightforward task. Resources such as Digi-Key’s IoT product selector break down the process of selecting suitable components and modules to use in development. When choosing a wireless module, the first criteria is that of the communication standard and protocol to be used. The most popular methods are Wi-Fi and Bluetooth, the latter being the default method for short-range, low-power communications. Specifically, the Bluetooth Low Energy (BLE) profile appears purpose made for battery-powered IoT devices. Also known as Bluetooth 4.0/4.2 or Bluetooth Smart, BLE offers a range of 300 feet and a data throughput of up to 270 kbs. In addition to being used in a variety of IoT devices such as sensors and actuators, BLE can be commonly found in healthcare, fitness, home entertainment, and beacon applications. Beacons, used for proximity marketing and indoor navigation purposes, have been picked up by sales hungry retail organizations as a way of pushing marketing offers to passing customers’ smartphones. Use of BLE for retail beacons is predicted to grow by 222% during the period of 2016 – 2020 according to Research and Markets, a market research company. Outside of retail, beacons are being used to keep passengers updated on their flight status and potential delays within an airport.

Faced with selecting a BLE module for their design, what features should an engineer look for when not all modules provide the same capabilities? Some modules feature the wireless transceiver modem, but depend on the host application to run the necessary software stacks. Others, and increasingly the more common approach, are ‘host-less’ and comprised of a wireless SoC device that incorporates a wireless transceiver and a microcontroller. Such wireless SoC devices have enough computing resources to not only run the protocol stacks but the end application too, although there clearly are going to be limitations for complex designs. When reviewing potential products there will be the obvious, yet still important, datasheet specifications of physical size, power consumption and peripheral capabilities.

However, the factors most likely to help speed the integration of the module into the end design are not always apparent from just looking at the datasheet. The availability of a prototyping platform such as an evaluation kit or reference design is a good starting point. Then there are the software tools and stacks to consider. Does the vendor provide these? Do they require licensing? Is extra circuitry required such as external clocks or antenna matching components? Also, does the development platform come with code examples? Can you set up a very simple test to quickly build confidence in using the module? The days of writing ‘Hello world’ or blinking an LED might appear rather out of date, yet they engender a lot of faith in the module and development environment and establish a trusted known position from which to take the next step.

An example of a BLE module is the BMD-3XX series from module manufacturer Rigado.

Image of Rigado BMD-300 BLE module

Figure 1: Rigado BMD-300 BLE module.

Based around the nRF52832 2.4 GHz wireless SoC from Nordic Semiconductor, the module provides a complete RF solution that is pre-certified across all regions of the world. No additional RF design is required as the module is available with an internal antenna or a U.FL connector. Both of these versions measure 14 x 9.8 x 1.9 mm. An ultra-compact variant, the BMD-350, measuring just 8.7 x 6.4 x 1.5 mm is also available for extremely space-constrained designs.

Block diagram of Rigado BMD-3XX series modules

Figure 2: Block diagram of BMD-3XX series modules.

Figure 2 highlights a functional block diagram of the BMD-3XX series. The SoC has an ARM Cortex-M4F 32-bit core with FPU, 512 kB of embedded flash and 64 kB RAM. Peripheral interfaces include three SPI Master/Slaves, two 2-wire I2C, I2S audio, UART, and 32 GPIO. A 128-bit AES hardware encryption function, random number generator, 32- and 24-bit timers and a 12-bit ADC are some of the other features. Completing this comprehensive module’s capabilities are an integrated DC-DC converter, a temperature sensor, a low power comparator and a quadrature demodulator. The pre-loaded BMDware firmware provides iBeacon and UART bridge capabilities without the need to program the module in any way. Alternatively, a number of Nordic Semiconductor SoftDevice protocol stacks can be used to create integrated BLE applications. Provisioning encrypted over-the-air (OTA) firmware updates are made possible through a secure bootloader that uses the module’s AEC-128 capabilities. Standard ARM debug capabilities through a serial wire debug (SWD) interface and serial wire output (SWO) allows a non-intrusive method of debugging program code, setting breakpoints and single stepping through code. In addition, the module supports ETM and ITM trace data, which is sent to a debugger attached to a 4-bit trace port.

An integrated 32 MHz crystal provides the high frequency clock for the wireless operation. A low frequency clock source is also required and this can be provided by an internal RC oscillator, taken from the high frequency clock or provided externally. Opting for an external crystal helps keep the power budget as low as possible in addition to maintaining accuracy.

The BMD-300 series evaluation kit, BMD-300-EVAL as shown in Figure 3, provides a comprehensive prototyping and development platform from which to start your design. This features a full breakout of the module pins, a 32.768 kHz crystal for the low frequency clock together with several buttons and LEDs. On-board programming and debugging uses a Segger J-Link-OB to allow access to SWD/SWO via a USB interface. An Atmel MCU is used to facilitate interfacing with the test environment and the module itself. Sharing a lot in common with Nordic Semiconductor’s own nRF52 evaluation boards means that most of the code examples and set up procedures also work on the BMD-300 platform.

Image of Rigado BMD-300 series evaluation kit

Figure 3: BMD-300 series evaluation kit.

Setting up and programming is a straightforward process and thoroughly explained in the module’s evaluation kit user guide. The first steps in this process involve downloading and installing the latest Keil MDK-ARM development kit, Nordic Semiconductor’s nRFgo-Studio, the most current Segger J-Link utilities, and Nordic’s latest nRF5 SDK. In addition to all the necessary libraries, drivers and software stacks, the SDK also provides a fully featured set of code examples.

Once all the above items have been installed it’s time to connect the evaluation kit up to a computer through the Segger J-Link interface. The nRFgo Studio works with the J-Link interface to provide full access to the module’s features. Programming the module with a SoftDevice protocol file is also achieved using this method.

Image of Nordic Semiconductor nRFgo Studio SoftDevice Window

Figure 4: Nordic Semiconductor nRFgo Studio SoftDevice Window.

The S132 SoftDevice is a BLE central and peripheral protocol stack that supports up to eight connections with an additional observer and a broadcaster role all running concurrently. Figure 4 illustrates setting this up within the nRFgo Studio tool. The stack also integrates a BLE controller and host, and is equipped with a set of flexible APIs to integrate into your own application.  A complete listing of the SoftDevice files available can be found on the Nordic Semiconductor site.

The evaluation board also has a set of connectors that are compatible with the Arduino shield format, making access to the modules GPIO through many standard Arduino shields. 

Image of Nordic nRF SDK code example (click for full-size)

Figure 5: Well documented code example from Nordic nRF SDK.

As mentioned above, the Nordic SDK provides a number of example applications that use APIs to interact with the SoftDevice protocol. An example, illustrated in Figure 5, shows the ‘ble_app_blinky_c’ main.c file. The code is extremely well documented, making it easy for a developer facing this for the first time to understand what is going on inside the program.

Should you wish to create your own development and test environment based around the evaluation board, the process is made relatively straightforward since Rigado provide all the necessary layout, PCB, drill holes and schematics on their website. A fully documented bill of materials file is also included, giving manufacturer and Digi-Key part numbers.

Conclusion

Taking a holistic approach to selecting a wireless module for your next design, looking at not only the module itself, but the availability of evaluation tools, software stacks and code examples, ensures that your design will be communicating in the shortest time possible.

  • Fast Tracking BLE Design for IoT and Beacon Applications已关闭评论
    A+
发布日期:2019年07月14日  所属分类:参考设计