Bluetooth and the micro:bit
The BBC micro:bit is a small, programmable device equipped with Bluetooth® technology which was designed by the BBC and a team of partners to be used in education. One million micro:bits were recently given to 11- and 12-year old British school children. The Bluetooth SIG is one of the partner organisations involved in the project, and it being a UK-based initiative, I was fortunate to be the SIG’s representative on the micro:bit team.
In this series of articles, I’ll introduce the micro:bit and take a closer look at some of its key capabilities including, of course, Bluetooth.
Make and Code. Code and Make.
Let’s start with the hardware. One of the headline mission statements for the BBC micro:bit is to “inspire a generation to get creative with coding” but it goes way beyond that. The hope is that youngsters will learn about hardware as well as software, and get making things as well as coding. To that end, many of the components are labelled on the device itself.
Here’s the back of the micro:bit.
The component labelled “processor” is a Nordic Semiconductor nRF51 SoC which is built around a Cortex™ M0 CPU and provides Bluetooth low energy technology support. Both Nordic Semiconductor and ARM are micro:bit partners.
The micro:bit contains an accelerometer and a digital compass or “magnetometer.” There are also several temperature sensors inside the device, not labelled in the graphic.
On the top edge, there’s a USB connector which can be used for wired data communication. The button is a reset button and the white plastic component is a battery connector.
On the front of the micro:bit, the most prominent component is a 5 x 5 LED grid. There are also two additional, programmable buttons labelled A and B. At the bottom edge, there are I/O connector pins which allow you to connect it to electronics projects. Pins may be used in analog or digital mode and may be used for either input or output.
A Holistic Approach
Right from the start, the BBC sought to bring together partners who could help with all aspects of the micro:bit, not just the hardware. So some partners focused on designing and creating the device, some on development tools and others on resources which support the roll out to schools and school children.
Collaboration between partners was required to get things done and so collaborate they did.
I got involved with micro:bit about a year ago, and in the beginning, found myself working with people from the BBC, Samsung, ARM and Lancaster University. Soon after though, I worked almost exclusively with Dr. Joe Finney of Lancaster University. Joe is the brains behind, and primary developer of, the micro:bit runtime, a lightweight operating system for the device and the place where the micro:bit custom Bluetooth profile is implemented.
I’ll tell you more about the custom Bluetooth profile for micro:bit in my next article.
These days there are a lot of programmable microcontroller-based devices aimed at hobbyists. What makes the micro:bit so special? I think the answer is partly to do with the micro:bit itself and partly to do with the results from that holistic approach.
The micro:bit provides students with much more than just a raw device which they can learn to program. It’s a cool bit of kit, with Bluetooth low energy an integral component but it’s made cooler still by Lancaster University’s micro:bit runtime system software which in addition to its role as a lightweight O/S, also provides developers with a set of very well designed APIs. If that isn’t enough, it’s made even cooler by some incredible development tools from Microsoft and Code Kingdoms.
Samsung developed the “micro:bit companion” application for Android which lets you write code on your phone or tablet and flash it direct to your micro:bit over Bluetooth. Add to that the learning resources aimed at both teachers and schoolchildren and you have a real recipe for success.
Like I said….. micro:bit is cool!
The BBC and its partners made the decision early on that the micro:bit would be made available on an open-source basis. This includes the hardware design, the micro:bit runtime software, the Bluetooth profile definition and various associated applications, including a full featured micro:bit Bluetooth application for Android which I wrote myself. There are no barriers to learning about the micro:bit and the various computer science and engineering topics which went into it.
Earlier this month the first, major stage of the open source process completed and you can find full details of the currently available open source components here at http://www.microbit.co.uk/open_source
The block diagram above shows the basic architecture of the BBC micro:bit.
Sitting on top of the hardware there are several major software components. Nordic Semiconductor’s S110 “soft device” provides the upper layers of the Bluetooth stack and a development framework to code against.
The largest box depicts Lancaster University’s micro:bit runtime, also known as the DAL (Device Abstraction Layer). Amongst other things, the runtime provides micro:bit application developers with some very nice C++ classes to code against, supports asynchronous processing through the use of fibers, has an internal message bus and <drum roll> is where the custom micro:bit Bluetooth profile is implemented.
Sitting in between the micro:bit runtime, the S110 framework and various aspects of the hardware is ARM’s mbed software. From the point of view of the micro:bit runtime, mbed provides various services and acts as a further abstraction layer. Developing the micro:bit runtime against mbed means that in theory it could be ported to different mbed supported hardware.
I hope I’ve given you a taste of what the micro:bit is all about. In the next part of the series, I’ll introduce and explain the micro:bit Bluetooth profile and explore some of the use cases it supports.
An Introduction to Bluetooth Low Energy Development
This self-study educational resource covers both theory and practice of Bluetooth Low Energy GAP and GATT application development. The guide will equip you with a solid understanding of key Bluetooth Low Energy concepts before guiding you through a series of software development projects that will allow you to put the theory into practice.