3D Printed 1-Octave Piano

by Charlie_T in Workshop > 3D Printing

4025 Views, 37 Favorites, 0 Comments

3D Printed 1-Octave Piano

IMG_20220504_220152.jpg

This is a 1-octave piano that I made for a final project in a college class. Over the last 16 weeks, I've made several revisions and may make more improvements in the future. This piano is made possible with 3D printed parts and an Arduino Micro. If you desire to make this yourself, it requires some knowledge of 3D printing and soldering.

Supplies

  • 52x 0.5”x0.15” compression springs (7x 8 pack of dollar store mechanical pencils https://www.dollartree.com/jot-mechanical-pencils-8ct-packs/164161)
  • 13x 1”x0.14” extension springs (spring #71 at Ace Hardware)
  • 3D Printed Parts (Attached Below):
  • Shell
  • 13 Keys
  • Top and bottom backboards
  • Top and bottom spring spacers
  • 26x metal inserts (from 1x https://www.staples.com/Staples-Prong-Fastener-Base-Unit-Silver-2-3-4-Width-2-Capacity-100-PK/product_1798823)
  • ⅜” dowel rod
  • Protoboards (https://www.amazon.com/gp/product/B07FFDFLZ3/ref=ppx_yo_dt_b_asin_image_o01_s02?ie=UTF8&psc=1)
  • 26x 10kΩ resistors
  • Spare wire
  • 4x CD4021BE shift registers
  • Arduino micro
  • Breadboard
  • 14x 1/16" thick Washers
  • Code (attached to step 9)
  • USB-MIDI library by lathoub
  • MIDI Library library by Francois Best

Print All the Parts

IMG_20220411_132212.jpg
IMG_20220411_132139.jpg
IMG_20220504_221211.jpg

Print out all the parts attached to the supplies section. In the end, you should have:

  • 1x Shell
  • 2x Spacers (Print 1 Mirrored)
  • 2x Backplate (Print 1 Mirrored)
  • 13x Keys
  • 8x white keys (C, D, E, F, G, A, B, C8)
  • 5x black keys

The shell, spacers, black keys, and most white keys can be printed without supports. Supports are optional for the backplates. The keys all need to be printed on their sides with the pegs sticking up. The D, G, and A keys will need supports underneath them but not in the inlaid letters or around the pegs.

Cut/attach the Metal Tabs to the Keys

Cut the metal inserts to 0.2"x0.5" pieces. I cut off the ends of some prong fastener bases from Staples since they were cheap, thin, and accessible. Once all are cut, rough up one side of each of the inserts and superglue or epoxy it into the slots on the back end of the keys. Use clamps to hold them down while they set.

Combine Protoboards

IMG_20220323_193652.jpg
IMG_20220404_215903.jpg

This project uses only the 3cm x 7cm boards from the pack from Amazon. For this step, you'll need to combine 3 of them into an extra long board. Using a hacksaw, cut 1 end off 2 boards and both off the 3rd board. Use a 4th board to perfectly line up the holes of the boards you are combining. Add tape to the 4th board in the spot you plan to glue to prevent it from sticking to the other boards. I inserted an Arduino to be sure it physically lined up but you could just visually line up the holes. Glue or Epoxy the boards together to make an extra long board. Repeat this so you have 2 boards. Sand off any excess glue to make the surfaces flat.

Solder Wires and Springs to the Spring Board

IMG_20220425_010415.jpg
IMG_20220415_002454.jpg

Once the glue has set, solder the compression springs and wires to the boards. Start with the springs which are positioned every 0.5" widthwise and 0.3" lengthwise. I recommend printing an extra spring spacer to use as a soldering jig to line up the springs and ensure they fit. Solder the springs to the boards with the spacing provided earlier. Each spring will sit in the middle of 4 adjacent holes. Be sure to use lots of flux to help the solder stick to the springs. On the opposite side of each board, solder individual wires to 1 row of springs and a single wire to all 13 springs in the other row. The final product should be 2 boards with 26 springs and 14 wires each.

Assemble the Piano: Part 1/2 - Board Assemblies

IMG_20220418_010002.jpg
IMG_20220418_010009.jpg

Assemble both spring board assemblies and place them into the housing. Start by inserting the spring boards into the spring spacers. Then position the backplate onto each assembly. Finally, insert the board assemblies into the top and bottom of the shell. (The bottom of the shell has the pegs.) If viewed from the back, the board assemblies should stick out slightly on the right side of the shell.

Assemble the Piano: Part 2/2 - Add Keys

IMG_20220418_130444.jpg
IMG_20220509_125109.jpg

Now add the keys to the assembly. Feed the dowel in one side of the housing. Alternate between adding washers and keys. Refer to the picture above to make sure you put the keys on in the right order. Once complete, attach the 13 extension springs to the pegs on the keys and corresponding pegs in the housing. These provide the tension to keep the keys in the up position when not pressed.

Wire the Breadboard

Breadboard Layout.png

The diagram above shows how to wire the breadboard.

Wire the Piano to the Breadboard

Breadboard Layout w Dots.png
IMG_20220425_202052.jpg
IMG_20220504_220212.jpg

Attach all the wires from the piano to the breadboard. Attach the 26 wires that are connected to individual springs to the 26 spots marked on the wiring diagram in purple. Exactly which purple spot they're plugged into doesn't matter at this point; It'll be fixed with programming later. Next, attach the 2 wires connected to the whole row of springs on each board to ground on the breadboard.

Program the Buttons

Screenshot 2022-05-04 4.30.45 PM.png
Screenshot 2022-05-04 4.30.05 PM.png

In the last step, the wires from the piano were plugged into random inputs of the circuit. Download the code attached below. You will also need the "USB-MIDI" library by lathoub and "MIDI Library" by Francois Best which can both be installed using the Library Manager in the Arduino IDE. Turn the debug code of the circuit on by changing the "DEBUG" variable in the header of the code to "true". Then upload the code to the Arduino. Using the serial monitor, we can see all 26 inputs from the shift registers. Press each key to identify which inputs correspond to them being up or down. If an input changes from a 0 to a 1, that button has been pressed. The top row of springs belongs to the "upButtons[]" array and the bottom row to the "dnButtons[]" array. Once they are written down, edit the inputs in the "writeInputs()" function in the code.

Turn Debug Mode Off and Play Your Piano!

3D Printed 1-Octave Piano

Turn debug off by setting the "DEBUG" variable back to "false". The piano is now ready to play! Connect the Arduino to a USB port on a device with an application that will accept MIDI input. There are many apps and websites that can do this, but I recommend the "Perfect Piano" app for smartphones and "MidiOX" for computers.