A Player Piano built using an Arduino Mega 2560 that can play 7 different songs!
Song list: Auld Lang Syne, Harry Potter Theme, Final Countdown, Song of Storms, Song of Healing, Star Wars Theme, Lost Woods
Watch the video demonstration: (Same as the 2nd preview image)
This project is not for beginners! You'll need to be fairly familiar with your 3D Printer, how to use an Arduino and Soldering.
Arduino Mega 2560 (You can't use an Uno because you need at least 25 I/O pins)
ProtoShield for Arduino Mega 2560 (Optional but HIGHLY recommended) ( Example )
12 LEDs (I used 6 different colors)
12 Resistors with correct resistance for your LEDs
12 Tall Tactile Switches ( Example )
1 Momentary (normally open) push button switch with 12mm diameter hole ( Example )
13 10k Resistors (For your switches)
2 Speakers - 8ohm - low wattage - 30mm diameter ( Example )
1 Power jack with 12mm diameter ( Example )
AC/DC adapter to fit that power jack with suitable voltage for Arduino (7-12V DC)
1 Power plug to fit into Arduino ( Example )
Lots of very tiny wire of various colors
Glue: I used a combination of hot glue (To hold together large parts and LEDs) and super glue (for piano legs and keys)
Soldering Iron + Solder
STEP 0: Download files
Download all the STL files
Download Piano_sketch.zip - extract it to your computer and open up Piano.ino (this is the sketch file for the piano's programming)
Read through the sketch file and see if you can make sense of it. Understanding how this project is programmed should help you in building it.
And then of course, load the sketch onto your Arduino.
STEP 1: Print the pieces
NOTE: I printed the piano body in white and the keys in black so that the LEDs would shine through the brightest. If you print the piano in a darker color, or paint it, the LEDs may not be very bright.
Print Key.STL 12 times.
Print Button_holder_support.STL 7 times.
Print Leg.STL twice.
All other pieces print once.
Print all pieces with NO SUPPORTS
EXCEPT for Middle.STL - use full supports for that piece.
I think i used 0.3 mm layer height for most pieces for the sake of shorter print times. But 0.2 mm would work fine too.
STEP 2: Assembly
Start with the LED_holder piece. Glue in all your LEDs. Make sure to leave most of the leads exposed.
Once all your LEDs are in, glue LED_holder into Middle.
Take the tactile buttons and glue them to the Button_holder piece. I used just a very small drop of super glue on the bottom middle of the tactile switch. You might have to bend the legs of switches slightly to get them to fit right.
This is how the Button_holder piece fits into the Middle piece. It's not glued in, but instead you slide in the Button_holder_support pieces and that holds it all together quite nicely. But DON'T put it together like this YET!!! You'll want to wire up the buttons first.
You can go ahead and glue the Bottom, Middle, and Top pieces together. That's so easy, I'm not even going to put a picture.
Now you pretty much need to start wiring things up. I'm not going to go into detail on how to do this, but if you're familiar with Arduinos, you should be able to figure it out.
The buttons are wired up using this method: Simple Arduino Button
When wiring the tactile switches, if you choose to wire them all together (and to the 5v output from the Arduino) like I did, keep in mind that you'll need enough room to slide the button_holder_support pieces in so make sure you use longer lengths of wire(see the picture below)
After you have the switches wired, you can go ahead and put the Button_holder piece into the Middle piece and slide in all the button_holder_support pieces.
For the LEDs, you have a wire going from each Arduino pin to the positive lead on the LED, then a resistor from the negative lead, and then to the ground.
For the speakers, it's just a wire going from the Arduino pin to the positive terminal on the speaker and then a wire from the negative terminal on the speaker to the ground.
IMPORTANT: These are the Arduino pins I used:
Speaker 1: Pin 10
Speaker 2: Pin 11
Piano key buttons: [from left (low) to right (high)] 22,24,26,28,30,32,34,36,38,40,42,44
LEDs: [from left (low) to right (high)] 23,25,27,29,31,33,35,37,39,41,43,45
Top button that starts a song: Pin 50
I made the mistake of wiring up all the buttons and LEDs in reverse order (so on the piano, the high keys are on the left and low keys are on the right.) So be mindful of that when you're wiring everything up.
If you look carefully at this picture, it should help you figure out the wiring.
Once everything is wired up, you can now test it! Hopefully everything works. I ran into a ton of problems when I wired up mine. Most of which were due to poor solder joints. So I had to go back and fix those a few times.
Next, glue on the Legs. I used super glue for this.
And then glue on all the piano keys (or leave them small and round if you want) I used super glue for this too, using just a very little amount.
I attached the back piece with just some masking tape so it would be easy to remove (if I needed to fix something, add more songs, or use the Arduino for a different project. )
I also put tiny felt furniture pads on the bottom of it so it would be more stable. (OPTIONAL)
And you're done! Now post pictures to the Thingiverse.