Skip Navigation

micro: music

By Jen Perry 3 projects (3+ hours)
Grades 4-6
English Language Arts,
Science and Technology,
  • Programming
  • Data
  • Technology and Society
  • Design
Tools & Languages

Key Coding Concepts

  • Algorithms
  • Events
  • Variables



A step-by-step set of operations to be performed to help solve a problem



When one thing causes another thing to happen



A placeholder for a piece of information that can change

This lesson contains three projects. In project one, learners will learn to code their own music for micro:bit using the MakeCode editor. In the second project, learners will collaborate (with guided instruction) to create their own piano. In the third project, learners will design their own micro:bit controller.


  • The educator should have some knowledge of micro:bit.
  • Learners should have had some previous experiences with coding (Scratch or Blockly).


  • micro:bit (1 per learner)
  • Device capable of pairing to micro:bit (1 per learner)
  • Headphones (1 per learner)


  • Supplies for paper piano: paper, tinfoil, 6 alligator clips, and glue
  • Supplies for fruit keyboard: banana, orange, headphone jack, and 4 alligator clips
  • Supplies for guitar extension activity: fabric, duct tape, cardboard, glitter, tinfoil, elastic bands, buttons, etc.

Before the lesson...

Project #1: Create a Song

Consider playing this video by Call of Dennig to show learners an example of what they will be making in this project.
*Note: This example was written in the old editor.

Go to and click ‘New Project’.

Ask learners to create their own song with code. Challenge them to use loops and other coding blocks.

They can use the simulator to play their song or download it and attach their micro:bit to speakers/headphones to share with their friends.

To connect the micro:bits to headphones, use the instructions here.

*Note: Do not wear the headphones. They will function like speakers (loud ones!) and can cause damage to learners’ hearing if they try to use them like regular headphones while connected to micro:bit.

Project #2: Make a Piano

(Collaboration with Guided Instruction)

This is a complex project, but could be completed with small groups and adult guidance. Materials should be prepped ahead of time.

Below are detailed instructions, an exemplar video, and code that could be used.

Piano Paper Project Instructions
*Note: The code in this document was written in the old editor.

An exemplar of a project.

Piano Code
*Note: Click ‘Edit’ to remix the old code in the new editor.

Project #3: Fruit Keyboard

Learners will design their own micro:bit controller using alligator clips, a headphone jack, a banana, and an orange. You may want to tell learners that they will be using these materials to create a circuit!

Follow this lesson from micro:bit MakeCode.

Is the learner able to independently follow coding instructions?

Does the learner have a growth mindset, able to troubleshoot any bugs that may arise?

Is the learner able to take risks and create some of their own code?

Is the learner able to collaborate with others?


  • Use the MakeCode micro:bit Musical Instrument Project to challenge learners to create a musical instrument that uses arrays to store sequences of notes. The array of notes can be played when an input occurs, such as one of the buttons being pressed, or if one or more of the pins is activated.
  • Follow this video tutorial to learn to play Star Wars on your micro:bit.
  • Create an animation to go with your music.


Journal Reflection/Class Discussion:

  1. What was your favourite part of the micro:music project?
  2. What was something you found challenging?
  3. What was something you would do differently next time or want to try out?
  4. What are some examples of music and technology working together?


Tech & Society (Ethics, Safety, & the Law)

Data (Ownership & Governance)

  • Discuss data collected from playlists and music choices. Ask learners if they or their parents have ever downloaded music?
  • Explore music and privacy policies and discuss how and why this data is being collected:

MakeCode Reference Guide

micro:bit Tutorial Series Part 1: Getting Started

micro:bit by BBC - Creative Classroom Tips for Educators

micro:bit Christmas Carols (with headphone connection instructions)

micro.bit MakeCode Editor

Shooting Stars | micro:bit Tutorial (by Call of Dennig)

micro:bit Paper Piano Project

Piano Code

Banana Keyboard Lesson:
MakeCode micro:bit

Music Reference and Tutorials from MakeCode micro:bit and

micro:bit Paper Piano Exemplar

micro:bit MakeCode: Design an Intstrument

Playing Star Wars music on your BBC MicroBit (by MicroMonsters)

Music and math: The genius of Beethoven - Natalya St. Clair (TED Ed)

Let’s Give Credit (Common Sense Media)

Apple Music and Privacy (Apple)

Understanding my Data (Spotify)

Teach lessons that are tied to your existing curriculum!


More Lesson Plans For Grades 4-6

    View All Lesson Plans

    Explore lessons based on components

    The K-12 Computer Science Framework

    Although learning how to build digital projects is a key part of Computer Science education, students should also learn a wider set of skills and competencies that will help them to harness the power of digital technologies as both creators and consumers. A comprehensive approach to K-12 Computer Science education includes learning about the following five focus areas:

    View Framework ➝


    By the end of high school, students should be able to create a simple computer program.

    Computing and Networks

    By the end of high school, students should understand and be able to use the tools and devices commonly used to build digital projects.


    By the end of high school, students should be able to explain how we use computers to create, store, organize, and analyze data.

    Technology and Society

    By the end of high school, students should be able to explore the ways in which technology and society have mutually shaped each other.


    By the end of high school, students should be able to apply design principles to the digital projects they create.