Mecha-electronic Pianist

by jac_obo in Circuits > Art

7803 Views, 29 Favorites, 0 Comments

Mecha-electronic Pianist

IMG_3988.jpeg
IMG 4020

This is a very cool project that tries to emulate a person playing the piano. We use a microbit board together with a servo expansion board (from Kitronik) to play "happy birthday" song in a conventional piano (already existing).

The project uses one servo per piano key to push it and produce a note. Once the servos have been fixed to the piano, we program the microbit to activate each servo (each note) in the corresponding moment to create a melody, as if a person would be playing the piano.

Supplies

  1. 1 microbit board
  2. 1 kitronik servo expansion board for microbit (model 5694) https://kitronik.co.uk/products/5694-compact-16-servo-driver-board-for-the-bbc-micro-bit
  3. 8 servos SG90 (180 degrees, not 360 degrees)
  4. 8 popsicle sticks (flat, wood)
  5. 8 threads
  6. 1 hot glue gun
  7. 1 roll of double-sided tape
  8. 4 AA 1.5V batteries
  9. 1 battery holder for 4 batteries.
  10. 1 piece of long rigid cardboard
  11. 1 conventional piano
  12. micro USB to USB cable

Popsicle Sticks

IMG_4002.jpeg
IMG_4003.jpeg
  1. Take each popsicle stick, cut a piece of double-sided tape, apply the tape on the stick.
  2. Reserve for later use

Marking Position of the Servos

IMG_3948.jpeg
  1. Take the rigid cardboard and put it in front of the piano keys.
  2. Mark with a pencil the separation among keys for the 8 keys to be used.

Glueing the Servos to the Cardboard

IMG_3971.jpeg
IMG_3968.jpeg
  1. Using the hot glue gun, glue each servo to the cardboard using the previous pencil marks like in the picture

Define the Piano Keys to Be Used

  1. Locate the piano keys that are going to be used. We chose from SOL to SOL of the central octave.
  2. Use some double-sided tape on the cardboard to fix the cardboard below the part of the piano that is going to be used.

Piano Keys

IMG_3960.jpeg
  1. Remove the protective film from the double sided tape of each popsicle stick and stick it to each piano key. Be sure that the stick is centered and that all of them are at the same position.

Threads

  1. Cut eight threads from each servo to each popsicle stick (lenght depending on the piano, ours is 7-8cm).
  2. Fix one end of the thread to the servo lever with hot glue. Repeat for the eight threads.
  3. Mount the eight threads in the servos with the screw.

Putting All Together

IMG_3964.jpeg
IMG_3963.jpeg
IMG_3966.jpeg
IMG_3975.jpeg
IMG_3978.jpeg
IMG_3989.jpeg
IMG_3984.jpeg
IMG_3985.jpeg
  1. Pull up each thread and put a drop of hot glue to fix the thread to the popsicle stick.
  2. remove all servo levers until the last step.


Connect the Microbit

IMG_4011.jpeg
IMG_4007.jpeg
  1. insert the microbit board into the servo expansion board (pay attention to the polarity).
  2. connect the battery holder to the expansion board. Pay attention to the polarity.
  3. put the on/off swith to OFF position.
  4. put the batteries into the battery holder.
  5. connect the micro USB cable to the PC/Mac.

Makecode

Captura de pantalla 2025-08-25 a las 19.50.28.png
  1. Open the make-code environment in a browser.
  2. drag and drop the attached file in the makecode app and see the code
  3. drag and drop the attached file to the microbit USB drive and wait for it to copy to the microbit.
  4. disconnect the usb cable from the microbit.

Play a Song

IMG_4014.jpeg
  1. connect the servos to the microbit servo expansion board. Servo 1 (left) to SV1, servo 2 to SV2, servo 3 to SV3 ... servo 8 (right) to SV8. Pay attention to the polarity of the servo cable. It has 3 wires and it is marked in the servo board the GND, Vcc and signal (control).
  2. put the on/off switch to on. You will see that all servos move to the 0 position.
  3. now, all the servo levers can be fixed to the servos (with screw).
  4. press the A button in the microbit.


  1. you will hear "happy birthday" song! :)