Skip to content » Microbit Unit Home » Topics » Microbit sound and music tutorial

Microbit sound and music tutorial

Microbit sound and music tutorial

In this tutorial we will cover all the hardware and coding you will need in order to output sound and music on the Microbit. The tutorial includes a demonstration on how to connect up speakers and buzzers, as well as the basics of coding music.

In order to play music on the Microbit we need to use the website. Click on the button below to launch the site.

Outputting sound on the Microbit is easy, you just need the following ingredients:

Connecting a Piezo buzzer to the Microbit

Connecting buzzers / speakers without a breadboard

You can connect up either a speaker, buzzer or headphones – the principle is the same for all the devices!

You don’t have go out an buy a speaker to get this working either – I recycled mine from an old radio that I had spare, but make sure you ask the person who owns the device before you take it apart, you might get in trouble!

Microbit speaker connection demo

Microbit with speaker connected

microbit with buzzer connected

Microbit with buzzer connected

Playing music on the Microbit

Coding sound on the Microbit is easy, you just tell the Microbit what note to play (e.g. A or C#) and how many beats to play it for.

Playing notes

c for quarter beat

The Microbit can be coded to play normal musical notes, you just choose the note the duration of the note.

How long will the note play for?

The duration of the note will depend on:

  • The tempo (Beats per minute)
  • How much of a beat you are playing for – 1/4, 1/2 , full beat

Microbit speaker music output demonstration.

Online Metronome

Changing the music tempo(speed)

set tempo to 120 beats per minute

If you want to change the speed of the music piece then you should change the tempo


  • Tempo  = 60 Beats per minute
  • so 1 beat  equals 1 second
  • 1/2 a beat equals 1/2 a second

If you want to add a pause to your musical creation, you should add a rest!

rest for 1 beat

How long the silence lasts will depend on the number of beats and the tempo of the music.

Teacher Resources

Starter worksheet Link