Star Wars Piano Music Robot




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:
- box of medicine
- speakers from an old TV
- cables to interconnect things
- usb cable
we have made the following items using cardboard:
- eyes
- mouth
we have bought the following items:
- the microbit board
- the amplifier board
- the microbit breakout board
- the ultrasonic sensor
Supplies
SUPPLIES
- a medicine box to place all staff.
- two speakers (ears).
- coloured cardboard to trim down (mouth, eyes, nose, teeth etc).
- a microbit board.
- a break-out board for microbit (ours was aliexpress, many others can work)
- ultrasonic sensor HC-SR04 able to work at 3v (this is very important, if not it won't work)
- amplifier board based in 8002A (ours was aliexpress, search web "HXJ8002 Audio Power Amplifier Board")
- thin cables to interconnect everything
- USB-A to USB-micro cable to connect the microbit
TOOLS
- Hot glue gun
- Cutting pliers
- Wire strippers
- Soldering iron
- Tin
- knife to make holes on cardboard
- markers
Eyes


- First, you have to take a piece of red cardboard and draw the eyes on it with a pencil.
- Then, you have to go over it with a marker.
- Then, you have to cut it out and glue it.
Mouth


- First, you have to take a yellow piece of cardboard and draw the mouth on it with a pencil.
- Then, you have to go over it with a marker.
- Then, you have to cut it out and glue it.
- Maybe, you will want to cut out some teeth with red cardboard and glue them to the mouth.
- Maybe you will also want to draw the tongue.
Speakers






- Drill a hole in the box on each side where the speakers will be.
- Run the speaker cables into these two holes.
- Take the speakers from an old TV.
- Then plug in the hot glue gun and wait for it to be ready.
- Glue the rear part of each speaker to each side of the box.
Amplifier and Ultrasonic Sensor









- See the attached circuit diagram and use it for the following steps.
- Cut and pre-tin all the wires.
- 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.
- Solder the power and input signal wires to the amplifier board.
- Solder the other end of the power cable to the MicroBit breakout board.
- 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





- Take the MicroBit and connect it to the breakout board.
- Connect the MicroBit to the USB cable (this usb cable should be capable of conveying power and data).
- Make two holes in the box using the knife to fit the ultrasonic sensor in.
- Make a hole in the base of the box to take out the USB cable.
Makecode

- Connect your USB cable to the computer.
- Open the Makecode webpage, create an account, log in with your user.
- Click in EXTENSIONS and add the SONAR extension.
- Download the program: https://makecode.microbit.org/S60797-46302-26926-76149 and see how it works.
- Load it into your microbit by draging and dropping the program (.hex file) in the USB unit that should have been popped up.
- wave your hand in front of it, it should start playing the Imperial March
- to stop it, shake it (gently, be careful to not let the lid to open and spread the circuits around)
Have fun!!