As part of project – Bluetooth Maze, I am using BBC Micro Bit as a supporting actor to the Beaglebone wireless which is my Hero board. In this blog post my intention is to test out a couple of features of the BBC Micro bit which I intend to use in my project. Basically, the BBC Micro bit is going to act as the controller, to control the Maze which I going to be sitting on/controlled by the Beaglebone Wireless and servo motors. The Micro bit will be sending magnetometer and accelerometer value to the Beaglebone via BLE. For now I am testing send the values from the Micro Bit to the with Adafruit’s Blefruit Connect App for iOS.
When I originally planned for the project, I intended to use Micro-Python with the Micro bit, but due the RAM limitation the BLE stack won’t fit on Micro bit 16k RAM . Here is a exert from the BBC micro:bit MicroPython documentation - http://microbit-micropython.readthedocs.io/en/latest/ble.html
While the BBC micro:bit has hardware capable of allowing the device to work as a Bluetooth Low Energy (BLE) device, it only has 16k of RAM. The BLE stack alone takes up 12k RAM which means there’s not enough room to run MicroPython.
Future versions of the device may come with 32k RAM which would be sufficient. However, until such time it’s highly unlikely MicroPython will support BLE.
So , this meant I had to go the Arduino route. Now since the microbit is not 'natively' supported by the Arduino IDE, I followed the awesome guide on the Adafruit Learning system to add board, by adding the following link to the preference - https://sandeepmistry.github.io/arduino-nRF5/package_nRF5_boards_index.json
And then in the Board Manager , search for nRF5 and install the "Nordic Semiconductor nRF5 Boards", now if you running a Debain based operating system and don’t want to deal with all the permission issues , you will have to run the Arduino IDE as sudo, in my case I am running Ubuntu 16.04.
Next, download/add the following libraries to the Arduino IDE
- Sparkfun’s Magnetometer library
- akafugu MMA8653 accelerometer library.
- BLE Peripheral library
- Adafruit's Microbit library
And, once all the libraries are setup, install Adafruit's Bluefruit connect App iOS App store or the google play store, and then upload the BLE UART demo. And then finally upload the BLE plotter demo.For more info check out the tutorial on Adafruit learning system at -https://learn.adafruit.com/use-micro-bit-with-arduino?view=all#bluetooth-uart , here is a screenshot of the Bluefruit App with the plotter demo running on the Microbit.
References
Adafruit Learning system for Micro Bit Arduino tutorial - https://learn.adafruit.com/use-micro-bit-with-arduino?view=all
Micro Python using Micro Bit - http://microbit-micropython.readthedocs.io
Micro Bit features - http://microbit.org/guide/features/
Top Comments