micro:bit Guitar – Touch Tunes

In this activity, students will design and build a simple guitar instrument using cardboard and foil connected to a micro:bit’s pins. Instead of using built-in buttons, students create their own touch-sensitive inputs by completing an electrical circuit with their fingers. When a student touches both the ground (GND) and a pin (like pin 1 or 2), the micro:bit detects the signal and plays a programmed tune.

This project introduces key concepts including input/output systems, electrical circuits, and physical computing, while reinforcing coding skills like conditional logic and event detection. Its purpose is to help students understand how hardware and software interact, while encouraging creativity through designing their own instrument and composing music.

Grade Levels: 3 - 12
Subject Matter: Algorithms, Physical Computing, Programming
Concepts: Programs and Algorithms, Computing Devices and Systems, Data and Information
Standards: 6-8.PA.1, 6-8.CD.2, 6-8.CD.3, K-2.PA.1, K-2.PA.2, K-2.PA.3, K-2.PA.4, 3-5.PA.2, 3-5.PA.3, 6-8.PA.2, 6-8.PA.3, 3-5.DI.1, 6-8.DI.1, 6-8.DI.2, 3-5.CD.1, K-2.CD.2, 3-5.CD.2
  • Average Rating: 0.0 (0 ratings)

Materials

Main Resource Instructions

  1. Introduce the Activity 
    • Today, you’re going to turn cardboard into a musical instrument using code.
    • Predict: What micro:bit functions/sensors will be used in order to allow the cardboard to communicate with the micro:bit and result in music?
    • Discussion questions:
      1. How do instruments usually make sound?
      2. How could we connect something external to the micro:bit
      3. Would the cardboard be used as an input or an output?
  2. Introduce the concept
    • The micro:bit can detect touch through its pins. When you touch a pin AND ground, you complete a circuit.
      1. Take a moment to identify the micro:bit “pins”
        1. Watch “pins” video – https://youtu.be/EDgdHb0R96I?si=zLhj0ygoY44I2ea2
      2. The touch circuit we are making work because:
        1. Electricity needs a complete path (circuit)
        2. Your body helps close that path
        3. The micro:bit detects that signal and runs code
        4. When a pin is touched, the program plays a sound
  3. Build the Guitar 
    • Let’s build your instrument first.
      1. Cut a guitar or keyboard shape from cardboard
      2. Add foil strips (these are touch pads)
      3. Connect wires:
        1. One to GND (ground)
        2. One to Pin 1
        3. One to Pin 2
      4. Attach wires to foil strips – These foil pieces are your keys or strings.
      5. Example:
  4. Code the micro:bit
    • Now we tell the micro:bit what to do when you touch it.
    • Program if pin 1 is touched → play melody
    • Program if pin 2 is touched → play different melody
  5. Download & Test: Let’s test your instrument!
    • Download code to micro:bit
    • Verify your cords are connected
    • Make music by holding:
      1. One finger on GND
      2. One finger on a foil strip
    • Test your guitar – The different foil strips should trigger different tunes 
  6. Debugging: – if it’s not working, check:
    • Are you touching GND AND a pin?
    • Are wires securely connected?
    • Did you download your code?

Assessment Opportunities

  • Check for understand: When you touch both parts, you complete a circuit. A tiny electrical signal flows through you, and the micro:bit detects it and plays a sound.
    • What was the input?
    • What was the output?
    • What caused the sound?
  • Reflection
    • How did your body help the circuit work?
    • What caused the music to play?
    • How is this different from pressing a button?
    • What would you improve about your design?

Extension Opportunities

Students can:

    • Add more foil pads (more notes)
    • Compose original music
    • Add LED visuals while playing
    • Turn into a piano, drum pad, or game controller
    • Combine with another micro:bit project

Elements of this resource were created by BBC micro:bit, then curated by the team at Nextech.

Learn More