Star Wars Piano Music Robot

by jac_obo in Circuits > Robots

89 Views, 1 Favorites, 0 Comments

Star Wars Piano Music Robot

IMG 2951
IMG_2942 en tamaño grande.jpeg
IMG_2940 en tamaño grande.jpeg
IMG_2943 en tamaño grande.jpeg

We built this project for pure fun working together with my son 9yo. The project’s idea is therefore from both. We enjoyed a lot projecting, building and thinking.


This is a robot that plays the "imperial march of Star Wars" when you wave your hand in front of it. It stops when you shake it.


This is the link to access the Makecode project:

https://makecode.microbit.org/S60797-46302-26926-76149


we have recycled the following items:

  1. box of medicine
  2. speakers from an old TV
  3. cables to interconnect things
  4. usb cable


we have made the following items using cardboard:

  1. eyes
  2. mouth


we have bought the following items:

  1. the microbit board
  2. the amplifier board
  3. the microbit breakout board
  4. the ultrasonic sensor

Supplies

SUPPLIES

  1. a medicine box to place all staff.
  2. two speakers (ears).
  3. coloured cardboard to trim down (mouth, eyes, nose, teeth etc).
  4. a microbit board.
  5. a break-out board for microbit (ours was aliexpress, many others can work)
  6. ultrasonic sensor HC-SR04 able to work at 3v (this is very important, if not it won't work)
  7. amplifier board based in 8002A (ours was aliexpress, search web "HXJ8002 Audio Power Amplifier Board")
  8. thin cables to interconnect everything
  9. USB-A to USB-micro cable to connect the microbit


TOOLS

  1. Hot glue gun
  2. Cutting pliers
  3. Wire strippers
  4. Soldering iron
  5. Tin
  6. knife to make holes on cardboard
  7. markers

Eyes

IMG_2829 en tamaño grande.jpeg
IMG_2830 en tamaño grande.jpeg
  1. First, you have to take a piece of red cardboard and draw the eyes on it with a pencil.
  2. Then, you have to go over it with a marker.
  3. Then, you have to cut it out and glue it.

Mouth

IMG_2917 en tamaño grande.jpeg
IMG_2833 en tamaño grande.jpeg
  1. First, you have to take a yellow piece of cardboard and draw the mouth on it with a pencil.
  2. Then, you have to go over it with a marker.
  3. Then, you have to cut it out and glue it.
  4. Maybe, you will want to cut out some teeth with red cardboard and glue them to the mouth.
  5. Maybe you will also want to draw the tongue.

Speakers

IMG_2836 en tamaño grande.jpeg
IMG_2899 en tamaño grande.jpeg
IMG_2900 en tamaño grande.jpeg
IMG_2924 en tamaño grande.jpeg
IMG_2898 en tamaño grande.jpeg
IMG_2896 en tamaño grande.jpeg
  1. Drill a hole in the box on each side where the speakers will be.
  2. Run the speaker cables into these two holes.
  3. Take the speakers from an old TV.
  4. Then plug in the hot glue gun and wait for it to be ready.
  5. Glue the rear part of each speaker to each side of the box.

Amplifier and Ultrasonic Sensor

IMG_2904 en tamaño grande.jpeg
IMG_2916 en tamaño grande.jpeg
IMG_2915 en tamaño grande.jpeg
IMG_2914 en tamaño grande.jpeg
IMG_2919 en tamaño grande.jpeg
IMG_2920 en tamaño grande.jpeg
IMG_2922 en tamaño grande.jpeg
IMG_2901 en tamaño grande.jpeg
IMG_2923 en tamaño grande.jpeg
  1. See the attached circuit diagram and use it for the following steps.
  2. Cut and pre-tin all the wires.
  3. Solder one wire from each speaker to the V1 terminal on the amplifier board. Solder the remaining wire from each speaker to the V2 terminal on the amplifier board. This way, the two speakers will be in parallel and both connected to the amplifier board, as shown in the diagram.
  4. Solder the power and input signal wires to the amplifier board.
  5. Solder the other end of the power cable to the MicroBit breakout board.
  6. Use a cable with a pin connector on one end for the ultrasonic sensor (so you can disconnect it) and solder the other end to the breakout board.

Put It All Together

IMG_2926 en tamaño grande.jpeg
IMG_2927 en tamaño grande.jpeg
IMG_2928 en tamaño grande.jpeg
IMG_2939 en tamaño grande.jpeg
IMG_2938 en tamaño grande.jpeg
  1. Take the MicroBit and connect it to the breakout board.
  2. Connect the MicroBit to the USB cable (this usb cable should be capable of conveying power and data).
  3. Make two holes in the box using the knife to fit the ultrasonic sensor in.
  4. Make a hole in the base of the box to take out the USB cable.

Makecode

Captura de pantalla 2025-05-02 a las 12.53.28.png
  1. Connect your USB cable to the computer.
  2. Open the Makecode webpage, create an account, log in with your user.
  3. Click in EXTENSIONS and add the SONAR extension.
  4. Download the program: https://makecode.microbit.org/S60797-46302-26926-76149 and see how it works.
  5. Load it into your microbit by draging and dropping the program (.hex file) in the USB unit that should have been popped up.


  1. wave your hand in front of it, it should start playing the Imperial March
  2. to stop it, shake it (gently, be careful to not let the lid to open and spread the circuits around)


Have fun!!