Using only an Arduino, a few resistors, a buzzer, and some bits of aluminum foil, you can create your own touch-sensor piano keyboard in just a few minutes! Using an Arduino Uno, you can create a piano with up to 18 keys; or with an Arduino Mega, you can get over 60 keys! Other Arduino boards should work with this project with little to no modification to the code.
You'll first want to collect all of the parts you will need for the project:
• An Arduino (or Arduino-compatible) microcontroller board. • Any Arduino board should work: Uno, Leonardo, Mega, Pro Mini, etc. • Eight 2.2 Megaohm (2.2 MΩ) resistors • Anywhere between 1 MΩ and 4.7 MΩ should work • You need one resistor per piano key • A 2.2 MΩ resistor has a color code of Red-Red-Green or Red-Red-Black-Yellow • A piezo buzzer • Some spare wires or jumper cables • Aluminum foil • A foot or two should do • Tape • A surface to tape your keys to • We used a scrap piece of cardboard, but it can be anything you like, even the tabletop itself!
Equipment that you may need:
• Soldering iron and solder • You can probably get by without an iron by wrapping wires together instead of soldering, but the connection will not be as reliable • Scissors to cut aluminum foil and tape