Micro:bit Summer Challenge

The junior talent scheme, Fundamentals of Programming, for which I am a mentor have set a summer challenge – To create something interesting with a Microbit. As a mentor and one of the judges, I too was given a kit which arrived in the post recently.

I love tinkering and building projects with Raspberry Pi’s and Arduinos, but to date had not really looked at the Microbit in much detail, so this is my opportunity to correct that.

The kit contains;

  • Micro:bit device
  • Battery pack
  • 3 LED’s (presumably for traffic lights)
  • Crocodile leads
  • Mini speaker
  • 2 Paperclips – no idea what these are for as yet
  • Small breadboard for prototyping

The challenges start off basic (scroll name on the led matrix), but the stretch task is where you can let your imagination run wild. As one of the judges I am not allowed to participate, but it won’t stop me seeing what I can create with the kit and the additional £20 (max limit) of hardware – most of which I probably already have bought and not yet used!

The Micro:bit

While it’s not in the same category as a Raspberry Pi or Arduino, it certainly punches above its weight for its size and price. The device on its own is around £13. I know some secondary schools were giving them away to year 7 pupils as part of a nation scheme to encourage kids to learn programming.

What can it do?

16 MHz 32-bit ARM Cortex-M0 microcontroller, 256 KB flash memory, 16 KB static RAM, 2.4 GHz Bluetooth low energy wireless networking.

  • 5 x5 LED matrix which allow manipulation of each LED individually, with lots of built-in easy to use functions to display text and basic images
  • Two tactile push buttons
  • 3 GPIO pins (where the real magic can occur)
  • Bluetooth
  • Accelerometer & Magnetometer
  • Temperature sensor

Lots there to explore, without adding anything extra.

How to program it

It can be programmed using the website https://microbit.org/code/. From here you can create a program and download the code as a hex file to then upload to the Microbit via a USB lead (it appears as a drive, so simply drop in the file)

The ‘Make Code’ editor provides ‘scratch style’ drag and drop blocks of functionality (see screenshot below) to get up and running without writing a single line of code. With a flick of a switch you can convert to JavaScript. There are also Python modules if you prefer that route.

Even without a physical device, the website provides a simulator, so you can get coding and see the results in the simulator right away – give it a try.

The easiest way to get going is to download the App. I did this for the iPad and I was creating programs in minutes and using bluetooth to upload them seamlessly to the device. Below I connected the green LED and Speaker. Pressing button A plays a tune, button B turns on the LED for 1 second, then off again using the GPIO (General Purpose Input/Output) pins. It’s these pins and the Bluetooth that open up a whole world of possibilities, allowing connection to external apps (bluetooth) or driving servos or motors via the GPIO pins for starters.

Example program and circuit using the kit

Simple program to display an image on the LED Matrix, play a tune and light up an LED!

Over the next few weeks I will be experimenting by adding some external components to see what I can create.