Arduino 8 Key Tinfoil Piano

by Cozcozmusix in Circuits > Arduino

3221 Views, 35 Favorites, 0 Comments

Arduino 8 Key Tinfoil Piano

IMG_1402.jpg

In this Instructables tutorial, I will teach you how to make a simple 8 key piano with your Arduino.

Supplies

  • Arduino Board
  • Breadboard
  • 10MΩ Resistor*8
  • Arduino mini box speaker
  • Wires/Jumpers
  • Tape
  • Cardboard
  • Tinfoil
  • (optional) Hot glue gun

Gather Supplies

IMG_1416.JPG
41iVUCmaENL._SX342_.jpg
unnamed.jpg
Arduino_Uno_-_R3.jpg
40-wires-30cm-male-to-male-Arduino-Jumper-wires.jpg

Here is what you'll need:

  • Arduino Board
  • Breadboard
  • 10MΩ Resistor*8 (1MΩ Resistors work too)
  • Arduino Mini Speaker
  • Wires/Jumpers
  • Double-sided tape
  • Carboard
  • Tinfoil
  • (optional) Hot Glue Gun

Making the Keys

IMG_1415.jpg
IMG_1407.JPG
IMG_1408.jpg

To make the main keyboard, carefully cut out 8 pieces of tinfoil (Mine is approximately 2cm) and cut out a piece of cardboard that could fit these strips of foil. (Making the keys too big may affect its sensitivity and not activate upon press)

IMPORTANT: Do not let the keys touch each other, short-curciting the keyboard

Making the Board + Connections

Use a wire and rip off one end of the connection, exposing about 1cm of the copper wires, spread out these thin strands of wires (shown above) to help ensure a better connection when taped to the foil.

Use some double-sided tape and secure the foil strips onto the cardboard, don't forget to sandwich the copper wires in between (shown above) (Optional) I made cuts into the cardboard to manage the 8 pieces of wires better, however, this is completely based on your preference (does not affect the instrument)

Assemble the Circuit

FNO1DTMKL55QV2F.jpg
IMG_1409.jpg
IMG_1410.JPG

Populate your breadboard and Arduino following the diagram and pictures above:

D2: Captive Sensor (More on that later)

D3~D10: Piano Keys (I used rainbow colours to better clarify each key

D11: Speaker

Gnd: Speaker

Make sure the resistors are plugged into the D2 Bus, in between the wires coming from the Arduino and the wires from the tinfoil.

If you would like to learn more about Captive Sensors: (a method used to detect human touches)

Upload Code + Tweaking

IMG_1411.JPG

Upload the Following Code to Arduino, if your speaker isn't making sounds when pressed, play around with the threshold level on this line of code

Sometimes the keys are extremely sensitive (playing lots of random noises not pressed) ...In that case move the number closer to the 5 digit range

int treshold = (10~30000);

Personally, using the 10MΩ resistors. Values around 5000~7000 all work well.

Import Code:

https://create.arduino.cc/editor/alany222/0c78e092...

Import Library:

https://playground.arduino.cc/Main/CapacitiveSenso...

Optional: Making a Cardboard Enclosure

IMG_1413.JPG

If you have extra cardboard & time left, consider making an enclosure for your creation!

I'm using cardboard but feel free to use anything else other than conductive materials (may affect the keys)

Finished Product:

Demo + Credits

Using the Keyboard:

Credits To: Frugha

Original Link: https://www.instructables.com/Arduino-Tinfoil-Pia...

Thank you! xD