Capacitive-Touch Arduino Keyboard Piano




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.

Capacitive-Touch Arduino Keyboard Piano




Step 1: Parts and Material

Major Components in Project

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

Step 2: The Idea and Design

The basic principle behind our method of touch sensing is that each piano “key” is sensor that can measure the electrical capacitance of a person’s body. The measurement will change as the user gets closer to the sensor and will spike dramatically when the user touches the sensor. The Arduino will be looking for these spikes in order to detect when the user has touched the key.

We will need to use one pin an the Arduino for each key as an “input pin”, and we’ll need one pin total to be used as the “common send” pin. We will also need one pin for the buzzer that will be used to generate a tone. This means that since an Arduino one has 20 input pins (14 digital and 6 analog), we can have up to 18 keys on our keyboard! If you have an Arduino Mega or any other board with more pins, that number can be even higher!

Step 3: Create your “Keys”

Keyboard Piano

Out of your aluminum foil, cut a few shapes to be your piano “keys”. Any shape will do, but we took the simple route and made squares. Each key should be somewhere between 2″x2″ and 4″x4″, but most other sizes will work as well.

Step 4: Assemble the Key Circuitry

Each touch-sensitive “key” on the piano is going to require one resistor and two wires/cables. Solder one wire to each leg of the resistor, but make sure to leave part of the leg sticking out. The leg will be used to connect to the foil in the next step. Make as many of these as you plan on having piano keys.

Step 5: Connect the Foil “Key”

Remember the extra bit of leg we saved? Take it and poke it through a corner or side of one of your aluminum foil squares. Fold the leg over the edge back towards itself to make the connect hold more strongly. Go ahead and assemble all of your keys.

 

For more detail: Capacitive-Touch Arduino Keyboard Piano




This Post / Project can also be found using search terms:

  • piaono project by arduino
  • ttp229 capacitive keyboard with arduino
  • capacitive sensor arduino keyboard piano code
  • how to build capacitive sensor piano
Clip to Evernote

Leave a Comment

(Spamcheck Enabled)

Read previous post:
Arduino MIDI-in shield
Arduino MIDI-in shield

This instructable shows how to build a shield to connect devices that send MIDI signals (e.g. a masterkeyboard) to an...

Close
Scroll to top