What you’ll learn
- What is a micro:bit?
- What’s new in the latest micro:bit?
The micro:bit is a small, low-cost IoT platform targeting schools, but it’s also a handy way to learn programming, especially Python. The platform is based a Nordic nRF52833 SoC. As with many development boards, it contains a second microcontroller, in this case an NXP KL26 to handle programming of the flash memory and for debugging.
I had a chance to check out the latest version 2 (Fig. 1) that adds a few new features, including a speaker and a microphone. There’s also a touch sensor above the LED display that provides the basic user interface along with the original buttons. Bluetooth support has been bumped up to Bluetooth 5.0, and the power switch has been changed to a power button. Both versions include a 3-axis accelerometer and magnetometer. In addition, there are temperature and light-level sensors.
The latest version keeps the edge connector that exposes most of the interface. The large holes are designed to facilitate connections via alligator or hook clips. The module can be powered by the USB interface or a small battery pack.
The nRF52833 provides the Bluetooth support along with 2.4-GHz transmissions. The latter can support protocols like Zigbee, Thread, and IEE 802.15.4. The chip is based on a 64-MHz Cortex-M4F, whereas the original micro:bit had a Cortex-M0. The micro:bit V2 maintains 512 kB of flash memory, twice that of V1. And the 128 kB of RAM is eight times that of the earlier version.
The micro:bit was originally launched by the BBC, targeting students as young as seven years old. It’s supported by Microsoft’s MakeCode as well as MicroPython and Scratch.
MakeCode (Fig. 2) is a basic graphical programming language. It’s a lot like programming with Legos, since pieces snap together and only certain blocks will fit. The language supports multiprocessing as well as event-based programming. Events like button presses can be used to toggle LED state or changing variables. Scratch is another graphical programming interface that’s similar to MakeCode. Scratch and MakeCode target multiple platforms, including micro:bit.
MicroPython is a subset of the popular Python programming language. The MicroPython IDE for micro:bit provides a way to edit a program and download it to the micro:bit (Fig. 3). It also has built-in functionality to access the interfaces and services available on the module.
The micro:bit software support is actually more extensive. It’s supported by a range of platforms from Ada/SPARK to MATLAB and Simulink. The Nordic nRF5 SDK for Mbed offers support for micro:bit as well as the chip family in general.
Micro:bit’s underlying system is programmed using C++, and C++ is accessible to more advanced developers. I tried the MakeCode and MicroPython tools but have yet to attempt to hack the C++ code, as that takes a good bit more effort. On the flip side, it provides complete access to the system and all of the source code is available. This includes the software that runs on the host as well as the code that runs on both the nRF51/2 and NXP KL26/DAPLink processor. The Arduino IDE is one platform that handles the micro:bit’s C++ support.
The micro:bit is available from the usual electronic distributors such as Newark, SEEED, and Digi-Key, as well as distributors that are tailored for hobbyists like Sparkfun and Adafruit. As with popular platforms like Raspberry Pi and Arduino, the micro:bit has a large ecosystem with robots, displays, and sensors that work with the basic unit.
Overall, the micro:bit V2 is a significant step up from the original incarnation. The larger memory footprint makes more ambitious projects possible and the dual-radio system allows developers to experiment and work with a wider range of communication options. That’s quite a bit for less than $20.