Creative Technologies Makerspace

Introduction to the micro:bit

People say the micro:bit is easy to use and that may be true as it is used often in education to teach the basics of programming and working with sensors etc. It however still needs an introduction to get you started and this is one.

Overview

The micro:bit is the most accessible of the three main ‘tiny computers’. More precise, it is a micro-controller with some additional items that make it more accessible to use. The micro-controller itself is less than 1x1cm. The ‘additional items’ are some on-board sensors, such as buttons, a microphone and an accelerometer. Next to the sensors, there are some standard ways of output like a 5×5 LED matrix and a tiny speaker. Furthermore there are a few ‘pins’ that you can use to connect even more input or output devices.

micro:bit V2
micro:bit V2. source: https://microbit.org/get-started/user-guide/overview/

Input and output, on-board or external

In the image above you see where all the standard elements such as microphone and speaker are. At the bottom of the device there are a number of gold colored connectors or pins. These are to connect additional parts like for instance an Ultrasonic Distance Sensor. Connecting additional parts is done either by using alligator clips or the combination of some form of break out board and jumper wires.

The on-board sensors are very easy to use. In the programming environment (see further down this post) their use is just a matter of drag and drop and you have sounds play at the press of a button or create a digital die which you can roll by shaking the micro:bit.

Connecting external sensors using the pins may come with some issues though. The micro:bit may not be able to provide enough power to make it all work. You can use an external power source to help here.

Additionally, you may also run into not having enough free/reliable pins anymore as some are internally connected to the micro:bit’s on-board sensors. See https://microbit.pinout.xyz/ (click on the pins on the left to see the explanation on the right) or https://makecode.microbit.org/device/pins for an elaborate overview of all the pins.

Bottom line is maybe that, if you need to connect more than one or two external elements, you may have to look into using the Arduino or be very aware that there may be conflicts between external and on-board sensors.

Programming

Programming the micro:bit is pretty easy. The standard environment to do so is https://makecode.microbit.org/. The most common used features are immediately available. More advanced features are more hidden or need to be added to the project explicitly (such as servo motor code or Ultrasonic Distance Sensor features). Right-click on a code block allows you to get some help on that specific element.

One thing to keep in mind: because you do not need to make an account, the projects are stored in your browser’s ‘cookies’. This means that your projects are only available on your computer in that specific browser! However, you can download projects or share them on github or by using the share button at the top-right.

A view of the makecode.org editor
an example of playing an alarm when the temperature gets to high

Video tutorials from the experts

Check out the Getting started post on microbit.org for the hardware features of the micro:bit (LED, Buttons, etc.) and how they to use them. All the videos from those pages are in the playlist below

If you want a bit more technical background, Shawn Hymel‘s youtube playlist below tells you how the features (LEDs, buttons, etc) of the micro:bit actually work. Hover your mouse over the hamburger menu top-right to get to the individual videos of the playlist. He first explains the feature at the hardware level and then uses it in https://makecode.microbit.org/. Oh, and he explains a lot more you can do if you add some sensors and other things.