Introduction: Arduino Piano - Pentotron

HI! This is my first instructable, i´ll do my very best to make it a good one. I´m not a native speaker, so please keep any mistakes you might find.

This instructable will show you how to build your own arduino "piano". It plays only pentatonic scales and therefore just has 5 keys. If you don´t know what that means: Don´t worry. It´ll always sound nice and makes a great toy piano. You can change the key with a knob(so you can play in any key) and switch from major to minor pentatonic scales with the help of a switch. A lot of keys and switches here. Let´s get going.

This is a rather easy project to do. You´ll need:

  • 1x Arduino Uno
  • 5x Momentary Switches
  • 2x Rocker Switches
  • 1x 1/4 inch guitar jack (or a Piezo /8 ohms Speaker if you don´t need an output jack)
  • 1x Potentiometer
  • 1x 9v Battery
  • 1x 9v Battery Clip
  • a soldering iron or a breadboard (and in that case some dupont wires)
  • any sort of housing
  • some wire

Step 1: Wiring Everything

Connect everything according to the schematic. Substitute the speaker on the top right with your Piezo or your guitar jack, if you want to know how to wire it have a look at the second picture.

  • the buttons Pin 8-12
  • the rocker switch Pin 7
  • the audio jack/speaker/piezo Pin 2
  • the potentiometer Analog Pin A0
  • 5v for the potentiometer
  • The On/Off Switch to Vin
  • Ground to Ground

Step 2: Transfer the Code

The "pitches" file should open automatically when opened with the Arduino IDE, but just in case i´ll attach it too.

Step 3: Keys

But one thing that took a little time to figure out were the keys! I´ll tell how i did that

  • I elevated the "keys" area with a small block of wood going accross the whole width.
  • I then divided that width into five equal parts and cut out some wooden keys in that size.
  • Then I marked where the buttons had to go. They should provide stability to the keys and be easily clickable. I placed them 2cm from the front edge and in the middle of the keys under those keys.
  • After glueing them in place i constructed a little wooden bridge that went over the cables.
  • The keys get glued and then stapled to that bridge
  • The keys should rest on both the bridge and the buttons

Step 4: The Housing

The Housing is a bit tricky. You can try any shape, i went for a "Toypiano" - Style. And because i neither have a 3D Printer nor access to one i chose wood as my go to material. I needed room for the audio jack, the knob, switch and access to the arduino USB- Port. Yes, that´s one switch less than above! I was able to use a potentiometer with a built in switch, which was a stylish solution for me. My knob controls key AND Power. As an output i was able to recycle an old part from a guitar pickup. Even though the XLR-Output was broken it could still be used. And as an added bonus it held a 9V battery! Your housing will almost certainly look different(and almost certainly look better). It was basically just a wooden box that was built around the keys and with the switch and knob in mind.

  • Cut out your shapes
  • Start from the bottom, apply the key"bock"
  • apply the side and secure them with screws
  • wire the rest up
  • cut cutouts for your buttons and potentiometer
  • test erverything
  • glue everything together with hotglue

Step 5: Have Fun!

Plug in a 9v Buttery, a cable and play some nice melodies. The Pentotron will play a little greeting melody- a little nod to the origins of the code. I did add quite a bit, but i got used to the little melody quickly, i had to keep it in there.

Have fun and thank you! Ask any questions you might have. I´m from germany, that´s what those comments in the code are in.


First Time Author

Participated in the
First Time Author