Friday 6 November 2015

A Quick Note About Developer Boards

When I speak at conferences I often demonstrate Bluetooth Low Energy applications using some kind of developer board and I get asked questions by people who are new to the subject and keen to get 'hands on' about what I use and why.

There are lots of ready made Bluetooth developer kits out there, often from Bluetooth chip manufacturers. There are also plenty of options for 'Bluetooth-enabling' your favourite small/medium/large computer as well. In either case, your aim is the same; to acquire a programmable Bluetooth Low Energy platform you can use for prototyping new device ideas, for testing your client applications or maybe to accomplish the complete and final implementation of device firmware before flashing the code to the final product hardware.

At the recent Oredev event in Sweden for example, I used a Bluegiga DKBLE dev board to act as a programmable Bluetooth beacon since this was a convenient approach to being able to vary beacon advertising packet content without needing to have lots of separate beacons in different physical locations for testing purposes. In short I could do all my testing sat at my desk and could change beacons by tweaking my code and flashing it to the board. Very convenient and fast,

Bluegiga DKBLE programmed to be an AltBeacon


Dev kits typically include some hardware which will either be a programmable microcontroller unit (MCU) or full computer system complete with an O/S like Linux. The Bluetooth low energy controller (hardware part of the stack) will either be an integral part of the board in the form of a 'system on a chip' or it will be a separate component you plugin. In the latter case it might be a USB dongle or maybe an expansion or daughter board of some sort. I sometimes use an Arduino for example and to Bluetooth-enable it I plug in a Bluetooth Low Energy 'shield' and install the related Arduino Bluetooth Low Energy library to program against.

There are lots of different Bluetooth dev kits out there and in fact often it's an option to simply use your favourite computing platform rather than a specialised board. I sometimes use my Raspberry Pi or my Intel Edison for example. In either of these cases, both devices being Linux based, I install BlueZ, the Bluetooth stack for Linux and plug in a Bluetooth Low Energy dongle into one of the USB ports and I'm away.

Arduino Uno (on the right) with Redbear Labs Bluetooth shield controlling a Neomatrix LED panel


There are a number of factors to consider when choosing a dev kit or other programmable platform to add to your development environment. The most important one I think is the GAP roles you need supporting. If all you want to do is implement devices which advertise, accept connections and expose GATT services, characteristics etc then you need to make sure the GAP Peripheral role is supported. If GAP Peripheral is supported (means you can advertise and accept connections) then GAP Broadcaster almost certainly is as well (advertises but will not accept connections). Beacons often use the GAP Broadcaster role. If you want to be able to scan, discover and connect to other devices from your board then you need GAP Central. For maximum flexibility you want a board/kit that supports both sets of roles. Some kits let you choose this according to the software library you install or link against. For example the Nordic nRF51 uses libraries which Nordic call 'soft devices'. The S110 gives you Peripheral mode, the S120 gives you Central and the S130 gives you both.

You'll also need to consider the programming language used. Most but not all boards from Bluetooth chip manufacturers use C or C/C++. The one exception I can think of is the Bluegiga kit I use (Note: Bluegiga are now called Silicon Labs having been recently acquired and they have a new kit that looks nice called the Gecko). The Bluegiga boards use a scripting language called BGScript which is a bit like BASIC and very easy to learn.

Computers as opposed to boards may offer other options. On my Raspberry Pi and Intel Edison I tend to use node.js with libraries BLENO and NOBLE. Python has some support though I haven't found a library that I regard as complete. This is something I'm currently looking into.

Your board will be most useful, especially if you're new to this if it comes with lots of sample code which you can flash to the board to turn it into any one of the many types of device which have standard profiles as defined by the Bluetooth SIG. I also use my Bluegiga as a heart rate monitor device sometimes, with the heart rate measurement values generated internally in software rather than being acquired through a sensor. This makes testing and demonstrating really easy as I can vary the heart rate which is transmitted to my smartphone app just by turning a dial on the board.

Some kits come with sensors or other I/O capabilities that you might find useful. Having a collection of readily available sensors can be great especially when the board has some standard firmware you can flash and which makes the sensor data available via suitable Bluetooth GATT services. I gave away some Texas Instruments SensorTag kits in my Oredev sessions and these are a great example of this as there's also a standard smartphone app you can install and you can be up and running and watching sensor data appear over Bluetooth on your phone in a matter of minutes.

Finally, look for any special features you might have in mind. I recently got a Cypress CY8CKIT which supports capacitive sensing which opens up all sorts of wonderful possibilities for making Bluetooth Low Energy controller devices which make other devices respond to you touching things like.... errrr..... potatoes.... plugged into the Cypress board!

Cypress board as Bluetooth potato MIDI controller!




















The new (at time of writing) Gecko board from Silicon Labs has an ethernet port as well, which is intriguing.

Gecko - Spot the ethernet port!


That's about it. There's lot of choice and kits are generally not expensive. They're fun to have, a great way to learn and in my opinion an essential ingredient in any Bluetooth developer's dev environment!











Note on terminology: 'Bluetooth Smart' is the brand name for 'Bluetooth Low Energy' Technically they're the same thing.

No comments:

Post a Comment

Note: only a member of this blog may post a comment.