loading
Picture of 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.

 

Step 1: Parts and Material

Picture of Parts and Material
IMG_5168.JPG
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
 
1-40 of 68Next »

Hi there,

I made this the other day but I used a breadboard instead of directly wiring the pieces to each other. I thought I should upload a diagram of the wiring I used just in case anybody else wants to make this using a breadboard. I also made some adjustments in the code to work for the amount and size of keys I had (about 1" wide by 2" long), including mrizkalla's adjustments to stop the loop effect. I've uploaded it to my Google Drive and it can be found by clicking here: https://drive.google.com/folderview?id=0B53IAtyS3-7NbF9jTmFMd1U4eU0&usp=sharing

Wiring Diagram-01.jpg
tylercrumpton (author)  megantissington5 months ago

Wonderful, thanks, Megan! I would love to see some pictures of the project!

Hi Tyler,

Here are some pics from when I did the project and a video of me playing Ode To Joy on it... worked pretty well!

Thanks for the comment!

_DSC0138.JPG_DSC0139.JPG
_DSC0140.MOV(516x290) 17 KB
tylercrumpton (author)  megantissington5 months ago

That's awesome! Thanks!

Ardutronico17 days ago

It's wrong that you can only get 18 on an Arduino Uno or 60 on Mega, because you can use shift registers like 74HC595. This one take 3 pins and give 8, but there is an instructable for giving 16 of 3 pins (http://www.instructables.com/id/Multiplexing-with-Arduino-and-the-74HC595)

tylercrumpton (author)  Ardutronico17 days ago

Unfortunately, using a shift register to expand the pin count won't work here, since this project requires inputs rather than outputs. That "Multiplexing with Arduino" Instructable is focused on supporting an array of LEDs, rather than buttons.

It might be possible to do a similar "scanning" process for the piano that normal button matrices use, but that is another, more complicated project.

Atul N Yadav made it!1 month ago

I made Arduino Piano with 4 Keys....may be I have used 1 m ohm resistor that would have caused it not to play good, but results are encouraging.

Need to know how I can change the length of note to be played in program ?

It would be great help :)

IMG_0109.JPG
tylercrumpton (author)  Atul N Yadav1 month ago

Awesome make! You can make the tones only play for a certain length of time by adding a timeout to the tone() function. For example, change this:

tone(BUZZER_PIN, notes[i]);

to this:

tone(BUZZER_PIN, notes[i], 500);

That will make the tone play for half a second (500 milliseconds) before cutting off.

Hope that helps!

Great, thanks mate !!!

ChristineK22 months ago

when I tried to upload the code, it said :

avrdude: stk500_getsync(): not in sync: resp=0x00

can someone help?

KhoJ3 months ago

Hi! I have no idea why the note D4 can't be played properly when I touch it. It played a weird sound. The note B4 also cant' be played at all. Any idea how to fix this?

Thanks!

SarahG33 months ago

I'm new to programming, so I have a question regarding the code. If I plan on using momentary switches for the keys instead of aluminum foil, would you happen to know how the code should change for this? I feel like it might be simpler, because I don't think I would need the capacitive sensor with a switch like that. I don't really know hahaha Please help if you can! :-)

JeremyC6 made it!4 months ago

This is my first arduino project. Turned out great. I followed megantissington's breadboard diagram and used the code that she uploaded to google drive. The only change I made was adding C5 to complete the octave.

Here's a video:

https://www.youtube.com/watch?v=iNsObVeigsw

20150425_173526.jpg
LindsayK14 months ago

Has anyone tried dripping water on the touchpads. Do they respond the same to water as the do to a finger?

Hi there,

Thank you for this beautiful update.

I made this up with little modification. Instead of buzzer I used LEDs, Means when I press a key corresponding LED glows.

I have set CAP_THRESHOLD to correct value by try-n-error method.

But I came across one strange issue.

1. When I connect Arduino UNO only to PC with USB cable it works absolutely fine.

2. When i connect both USB and POWER cable(12v, 1A) to Arduino, these LED keep blinking when I pressthe keys.

3. After programming the Arduino, I disconnect the USB cable , and connect the POWER cable, these does not works. While pressed keys, sometime LED blinks.

Now I am not getting any clue about this :( . Please update if you know any possible reason for this.

I will be updating my project details and PIC soon.

Thanks

Souvik

jrtumbles7 months ago

https://learn.sparkfun.com/tutorials/installing-an...

Try this tutorial for installing the libraries. It is much more clear than the arduino site explanation and code worked immediately after installing the libraries properly.

john

jrtumbles7 months ago

Hi Tyler,

I hate to bother you with this especially because you have addressed it so many times before. I am getting the following errors each time I try to compile the library and or sketches.

I have followed the arduino tutorial and tried following the instructions here, but to no avail. Can you help me get this code loaded and working? I am planning to teach this to my grandson as soon as I can get it working right. I absolutely love your projects and the fact that you are helping so many people is just amazingly generous and kind. I would greatly appreciate it if you could kind of walk me through the process and get this working.

Thank you,

John

sketch_nov14a:32: error: 'CapacitiveSensor' does not name a type

sketch_nov14a.ino: In function 'void setup()':
sketch_nov14a:39: error: 'keys' was not declared in this scope
sketch_nov14a.ino: In function 'void loop()':
sketch_nov14a:50: error: 'keys' was not declared in this scope

lucia10017 months ago

Hi, just a quick question. When i press a key, the sound plays perfectly fine, and does what it is supposed to do. However whenever i let go of the key, it keeps playing the same note even though i am not touching the key. Is this supposed to happen? If it isn't, how would i fix this?

omadison2 years ago
The code doesn't work. I have installed the library correctly (I think, because it shows on my libraries when the arduino program is opened) and I cannot get the code to verify without this error :
CapSensePiano:32: error: 'CapacitiveSensor' does not name a type
CapSensePiano.ino: In function 'void setup()':
CapSensePiano:37: error: 'keys' was not declared in this scope
CapSensePiano.ino: In function 'void loop()':
CapSensePiano:47: error: 'keys' was not declared in this scope

I really suck with code. That's why I use this site to make cool things without a lot of coding. Can you help me out?
tylercrumpton (author)  omadison2 years ago
Hello! Which Arduino are you using? It looks like there is a separate version of the library for the Arduino Due (which is included in the library .zip file).

Does the sample "CapacitiveSensorSketch" Arduino code that came with the library verify correctly for you? If not, then there may be something wrong with the way the library is set up on your computer.
i am using arduino uno but am experiencing the same problem as omadison
12
tylercrumpton (author)  amore21 year ago

Hi! Sorry for the delayed response; do you have the Capacitive Sense Arduino library properly installed? Make sure that this library is installed before trying to run the sketch.

sorry i want to ask you

both program and Material are right but when i tough tHe Aluminum foil

it don`t have sound
this is the program
/*

Capacitive-Touch Arduino Keyboard Piano

Plays piano tones through a buzzer when the user taps touch-sensitive piano "keys"

Created 18 May 2013

Modified 23 May 2013

by Tyler Crumpton and Nicholas Jones

This code is released to the public domain. For information about the circuit,

visit the Instructable tutorial at http://www.instructables.com/id/Capacitive-Touch-...

*/

#include <CapacitiveSensor.h>

#include "pitches.h"

#define COMMON_PIN 2 // The common 'send' pin for all keys

#define BUZZER_PIN A4 // The output pin for the piezo buzzer

#define NUM_OF_SAMPLES 10 // Higher number whens more delay but more consistent readings

#define CAP_THRESHOLD 150 // Capactive reading that triggers a note (adjust to fit your needs)

#define NUM_OF_KEYS 8 // Number of keys that are on the keyboard

// This macro creates a capacitance "key" sensor object for each key on the piano keyboard:

#define CS(Y) CapacitiveSensor(2, Y)

// Each key corresponds to a note, which are defined here. Uncomment the scale that you want to use:

int notes[]={NOTE_C4,NOTE_D4,NOTE_E4,NOTE_F4,NOTE_G4,NOTE_A4,NOTE_B4,NOTE_C5}; // C-Major scale

//int notes[]={NOTE_A4,NOTE_B4,NOTE_C5,NOTE_D5,NOTE_E5,NOTE_F5,NOTE_G5,NOTE_A5}; // A-Minor scale

//int notes[]={NOTE_C4,NOTE_DS4,NOTE_F4,NOTE_FS4,NOTE_G4,NOTE_AS4,NOTE_C5,NOTE_DS5}; // C Blues scale

// Defines the pins that the keys are connected to:

CapacitiveSensor keys[] = {CS(3), CS(4), CS(5), CS(6), CS(7), CS(8), CS(9), CS(10)};

void setup() {

// Turn off autocalibrate on all channels:

for(int i=0; i<8; ++i) {

keys[i].set_CS_AutocaL_Millis(0xFFFFFFFF);

}

// Set the buzzer as an output:

pinMode(BUZZER_PIN, OUTPUT);

}

void loop() {

// Loop through each key:

for (int i = 0; i < 8; ++i) {

// If the capacitance reading is greater than the threshold, play a note:

if(keys[i].capacitiveSensor(NUM_OF_SAMPLES) > CAP_THRESHOLD) {

tone(BUZZER_PIN, notes[i]); // Plays the note corresponding to the key pressed

}

}

}

sorry i want to ask you

both program and Material are right but when i tough tHe Aluminum foil

it don`t have sound
this is the program
/*

Capacitive-Touch Arduino Keyboard Piano

Plays piano tones through a buzzer when the user taps touch-sensitive piano "keys"

Created 18 May 2013

Modified 23 May 2013

by Tyler Crumpton and Nicholas Jones

This code is released to the public domain. For information about the circuit,

visit the Instructable tutorial at http://www.instructables.com/id/Capacitive-Touch-...

*/

#include <CapacitiveSensor.h>

#include "pitches.h"

#define COMMON_PIN 2 // The common 'send' pin for all keys

#define BUZZER_PIN A4 // The output pin for the piezo buzzer

#define NUM_OF_SAMPLES 10 // Higher number whens more delay but more consistent readings

#define CAP_THRESHOLD 150 // Capactive reading that triggers a note (adjust to fit your needs)

#define NUM_OF_KEYS 8 // Number of keys that are on the keyboard

// This macro creates a capacitance "key" sensor object for each key on the piano keyboard:

#define CS(Y) CapacitiveSensor(2, Y)

// Each key corresponds to a note, which are defined here. Uncomment the scale that you want to use:

int notes[]={NOTE_C4,NOTE_D4,NOTE_E4,NOTE_F4,NOTE_G4,NOTE_A4,NOTE_B4,NOTE_C5}; // C-Major scale

//int notes[]={NOTE_A4,NOTE_B4,NOTE_C5,NOTE_D5,NOTE_E5,NOTE_F5,NOTE_G5,NOTE_A5}; // A-Minor scale

//int notes[]={NOTE_C4,NOTE_DS4,NOTE_F4,NOTE_FS4,NOTE_G4,NOTE_AS4,NOTE_C5,NOTE_DS5}; // C Blues scale

// Defines the pins that the keys are connected to:

CapacitiveSensor keys[] = {CS(3), CS(4), CS(5), CS(6), CS(7), CS(8), CS(9), CS(10)};

void setup() {

// Turn off autocalibrate on all channels:

for(int i=0; i<8; ++i) {

keys[i].set_CS_AutocaL_Millis(0xFFFFFFFF);

}

// Set the buzzer as an output:

pinMode(BUZZER_PIN, OUTPUT);

}

void loop() {

// Loop through each key:

for (int i = 0; i < 8; ++i) {

// If the capacitance reading is greater than the threshold, play a note:

if(keys[i].capacitiveSensor(NUM_OF_SAMPLES) > CAP_THRESHOLD) {

tone(BUZZER_PIN, notes[i]); // Plays the note corresponding to the key pressed

}

}

}

sorry i want to ask you

both program and Material are right but when i tough tHe Aluminum foil

it don`t have sound
this is the program
/*

Capacitive-Touch Arduino Keyboard Piano

Plays piano tones through a buzzer when the user taps touch-sensitive piano "keys"

Created 18 May 2013

Modified 23 May 2013

by Tyler Crumpton and Nicholas Jones

This code is released to the public domain. For information about the circuit,

visit the Instructable tutorial at http://www.instructables.com/id/Capacitive-Touch-...

*/

#include <CapacitiveSensor.h>

#include "pitches.h"

#define COMMON_PIN 2 // The common 'send' pin for all keys

#define BUZZER_PIN A4 // The output pin for the piezo buzzer

#define NUM_OF_SAMPLES 10 // Higher number whens more delay but more consistent readings

#define CAP_THRESHOLD 150 // Capactive reading that triggers a note (adjust to fit your needs)

#define NUM_OF_KEYS 8 // Number of keys that are on the keyboard

// This macro creates a capacitance "key" sensor object for each key on the piano keyboard:

#define CS(Y) CapacitiveSensor(2, Y)

// Each key corresponds to a note, which are defined here. Uncomment the scale that you want to use:

int notes[]={NOTE_C4,NOTE_D4,NOTE_E4,NOTE_F4,NOTE_G4,NOTE_A4,NOTE_B4,NOTE_C5}; // C-Major scale

//int notes[]={NOTE_A4,NOTE_B4,NOTE_C5,NOTE_D5,NOTE_E5,NOTE_F5,NOTE_G5,NOTE_A5}; // A-Minor scale

//int notes[]={NOTE_C4,NOTE_DS4,NOTE_F4,NOTE_FS4,NOTE_G4,NOTE_AS4,NOTE_C5,NOTE_DS5}; // C Blues scale

// Defines the pins that the keys are connected to:

CapacitiveSensor keys[] = {CS(3), CS(4), CS(5), CS(6), CS(7), CS(8), CS(9), CS(10)};

void setup() {

// Turn off autocalibrate on all channels:

for(int i=0; i<8; ++i) {

keys[i].set_CS_AutocaL_Millis(0xFFFFFFFF);

}

// Set the buzzer as an output:

pinMode(BUZZER_PIN, OUTPUT);

}

void loop() {

// Loop through each key:

for (int i = 0; i < 8; ++i) {

// If the capacitance reading is greater than the threshold, play a note:

if(keys[i].capacitiveSensor(NUM_OF_SAMPLES) > CAP_THRESHOLD) {

tone(BUZZER_PIN, notes[i]); // Plays the note corresponding to the key pressed

}

}

}

sorry i want to ask you

both program and Material are right but when i tough tHe Aluminum foil

it don`t have sound
this is the program
/*

Capacitive-Touch Arduino Keyboard Piano

Plays piano tones through a buzzer when the user taps touch-sensitive piano "keys"

Created 18 May 2013

Modified 23 May 2013

by Tyler Crumpton and Nicholas Jones

This code is released to the public domain. For information about the circuit,

visit the Instructable tutorial at http://www.instructables.com/id/Capacitive-Touch-...

*/

#include <CapacitiveSensor.h>

#include "pitches.h"

#define COMMON_PIN 2 // The common 'send' pin for all keys

#define BUZZER_PIN A4 // The output pin for the piezo buzzer

#define NUM_OF_SAMPLES 10 // Higher number whens more delay but more consistent readings

#define CAP_THRESHOLD 150 // Capactive reading that triggers a note (adjust to fit your needs)

#define NUM_OF_KEYS 8 // Number of keys that are on the keyboard

// This macro creates a capacitance "key" sensor object for each key on the piano keyboard:

#define CS(Y) CapacitiveSensor(2, Y)

// Each key corresponds to a note, which are defined here. Uncomment the scale that you want to use:

int notes[]={NOTE_C4,NOTE_D4,NOTE_E4,NOTE_F4,NOTE_G4,NOTE_A4,NOTE_B4,NOTE_C5}; // C-Major scale

//int notes[]={NOTE_A4,NOTE_B4,NOTE_C5,NOTE_D5,NOTE_E5,NOTE_F5,NOTE_G5,NOTE_A5}; // A-Minor scale

//int notes[]={NOTE_C4,NOTE_DS4,NOTE_F4,NOTE_FS4,NOTE_G4,NOTE_AS4,NOTE_C5,NOTE_DS5}; // C Blues scale

// Defines the pins that the keys are connected to:

CapacitiveSensor keys[] = {CS(3), CS(4), CS(5), CS(6), CS(7), CS(8), CS(9), CS(10)};

void setup() {

// Turn off autocalibrate on all channels:

for(int i=0; i<8; ++i) {

keys[i].set_CS_AutocaL_Millis(0xFFFFFFFF);

}

// Set the buzzer as an output:

pinMode(BUZZER_PIN, OUTPUT);

}

void loop() {

// Loop through each key:

for (int i = 0; i < 8; ++i) {

// If the capacitance reading is greater than the threshold, play a note:

if(keys[i].capacitiveSensor(NUM_OF_SAMPLES) > CAP_THRESHOLD) {

tone(BUZZER_PIN, notes[i]); // Plays the note corresponding to the key pressed

}

}

}

sorry i want to ask you

both program and Material are right but when i tough tHe Aluminum foil

it don`t have sound
this is the program
/*

Capacitive-Touch Arduino Keyboard Piano

Plays piano tones through a buzzer when the user taps touch-sensitive piano "keys"

Created 18 May 2013

Modified 23 May 2013

by Tyler Crumpton and Nicholas Jones

This code is released to the public domain. For information about the circuit,

visit the Instructable tutorial at http://www.instructables.com/id/Capacitive-Touch-...

*/

#include <CapacitiveSensor.h>

#include "pitches.h"

#define COMMON_PIN 2 // The common 'send' pin for all keys

#define BUZZER_PIN A4 // The output pin for the piezo buzzer

#define NUM_OF_SAMPLES 10 // Higher number whens more delay but more consistent readings

#define CAP_THRESHOLD 150 // Capactive reading that triggers a note (adjust to fit your needs)

#define NUM_OF_KEYS 8 // Number of keys that are on the keyboard

// This macro creates a capacitance "key" sensor object for each key on the piano keyboard:

#define CS(Y) CapacitiveSensor(2, Y)

// Each key corresponds to a note, which are defined here. Uncomment the scale that you want to use:

int notes[]={NOTE_C4,NOTE_D4,NOTE_E4,NOTE_F4,NOTE_G4,NOTE_A4,NOTE_B4,NOTE_C5}; // C-Major scale

//int notes[]={NOTE_A4,NOTE_B4,NOTE_C5,NOTE_D5,NOTE_E5,NOTE_F5,NOTE_G5,NOTE_A5}; // A-Minor scale

//int notes[]={NOTE_C4,NOTE_DS4,NOTE_F4,NOTE_FS4,NOTE_G4,NOTE_AS4,NOTE_C5,NOTE_DS5}; // C Blues scale

// Defines the pins that the keys are connected to:

CapacitiveSensor keys[] = {CS(3), CS(4), CS(5), CS(6), CS(7), CS(8), CS(9), CS(10)};

void setup() {

// Turn off autocalibrate on all channels:

for(int i=0; i<8; ++i) {

keys[i].set_CS_AutocaL_Millis(0xFFFFFFFF);

}

// Set the buzzer as an output:

pinMode(BUZZER_PIN, OUTPUT);

}

void loop() {

// Loop through each key:

for (int i = 0; i < 8; ++i) {

// If the capacitance reading is greater than the threshold, play a note:

if(keys[i].capacitiveSensor(NUM_OF_SAMPLES) > CAP_THRESHOLD) {

tone(BUZZER_PIN, notes[i]); // Plays the note corresponding to the key pressed

}

}

}

aasd45691717 months ago

sorry i want to ask you
both program and Material are right but when i tough tHe Aluminum foil

it don`t have sound
this is the program
/*

Capacitive-Touch Arduino Keyboard Piano

Plays piano tones through a buzzer when the user taps touch-sensitive piano "keys"

Created 18 May 2013

Modified 23 May 2013

by Tyler Crumpton and Nicholas Jones

This code is released to the public domain. For information about the circuit,

visit the Instructable tutorial at http://www.instructables.com/id/Capacitive-Touch-...

*/

#include <CapacitiveSensor.h>

#include "pitches.h"

#define COMMON_PIN 2 // The common 'send' pin for all keys

#define BUZZER_PIN A4 // The output pin for the piezo buzzer

#define NUM_OF_SAMPLES 10 // Higher number whens more delay but more consistent readings

#define CAP_THRESHOLD 150 // Capactive reading that triggers a note (adjust to fit your needs)

#define NUM_OF_KEYS 8 // Number of keys that are on the keyboard

// This macro creates a capacitance "key" sensor object for each key on the piano keyboard:

#define CS(Y) CapacitiveSensor(2, Y)

// Each key corresponds to a note, which are defined here. Uncomment the scale that you want to use:

int notes[]={NOTE_C4,NOTE_D4,NOTE_E4,NOTE_F4,NOTE_G4,NOTE_A4,NOTE_B4,NOTE_C5}; // C-Major scale

//int notes[]={NOTE_A4,NOTE_B4,NOTE_C5,NOTE_D5,NOTE_E5,NOTE_F5,NOTE_G5,NOTE_A5}; // A-Minor scale

//int notes[]={NOTE_C4,NOTE_DS4,NOTE_F4,NOTE_FS4,NOTE_G4,NOTE_AS4,NOTE_C5,NOTE_DS5}; // C Blues scale

// Defines the pins that the keys are connected to:

CapacitiveSensor keys[] = {CS(3), CS(4), CS(5), CS(6), CS(7), CS(8), CS(9), CS(10)};

void setup() {

// Turn off autocalibrate on all channels:

for(int i=0; i<8; ++i) {

keys[i].set_CS_AutocaL_Millis(0xFFFFFFFF);

}

// Set the buzzer as an output:

pinMode(BUZZER_PIN, OUTPUT);

}

void loop() {

// Loop through each key:

for (int i = 0; i < 8; ++i) {

// If the capacitance reading is greater than the threshold, play a note:

if(keys[i].capacitiveSensor(NUM_OF_SAMPLES) > CAP_THRESHOLD) {

tone(BUZZER_PIN, notes[i]); // Plays the note corresponding to the key pressed

}

}

}

So I have the circuit hooked up and I did it on a bread board. However, when I use pin 2 as the send pin it does not work. if I unplug the wire in pin 2 it sends it perfectly, but continually plays iwthout touching. I must add, I am also using pop cans instead of pieces of aluminum. Any suggestions?

Angela

tylercrumpton (author)  angela.sims.188 months ago

Hello Angela!

It might be worthwhile to try lowering the CAP_THRESHOLD value (if you haven't already), since the cans will probably have a different capacitive characteristic. Try lowering it to the point were it triggers automatically and then raise it up a bit from there.

Hope that helps!

EjazJ8 months ago

Heyy, i am trying to make this project. but it shows up the same error as capacitance type not defined. i have properly installed the libraries (pitches.h) but still the error shows up. please help me as i am not that good at coding.

tylercrumpton (author)  EjazJ8 months ago

Hi there!

You shouldn't need to do anything special with the "pitches.h" file; you can just leave it in the same folder as the ".ino" file. You will, however, need to install the "CapactiveSensor" library for your Arduino installation. You can download that library here:

https://github.com/arduino-libraries/CapacitiveSen...

Here is a guide for installing libraries if you need help with that:

http://arduino.cc/en/Guide/Libraries

Hope that helps!

So I have the circuit hooked up and I did it on a bread board. However, when I use pin 2 as the send pin it does not work. if I unplug the wire in pin 2 it sends it perfectly, but continually plays iwthout touching. I must add, I am also using pop cans instead of pieces of aluminum. Any suggestions?

Angela

Hi there, Im looking to implement this design but in a few different ways...perhaps you can help point a noob in the right direction.

1. How can I send midi out to a device (in this case a midi controllable turntable to control the pitch of vinyl records) ....is there a specific arduino that has midi in/out?

Also im trying (rather ambitiously) to make a 3d printed case for it and instead of foil for the 'keys' can a solid aluminum pin/screw/button be used instead to prevent wear?

Hi! I know there are some Arduino devices like the Leonardo that can output MIDI over USB. You should be able to use a different material for the "keys", but it's hard to tell until you give it a shot! Try it with a variety of pins or screws until you find one that reacts well.

Hi! I have both libraries installed into my library and they are still coming up with the error message

"CapacitiveSensor Has not been declared" and

"CapacitiveSensor does not have a type"

can you help?

tylercrumpton (author)  angela.sims.189 months ago

Hi Angela!

Those errors are usually indicative of an improperly-installed or missing library. In the CapacitiveSensor-master.zip file, make sure that you only copy over the CapacitiveSensor and CapacitiveSensorDue folders over to your Arduino "libraries" folder.

If the libraries are properly installed, you should be able to select them in the "Sketch>>Import Library..." menu in the Arduino IDE. Do they show up there for you?

Hope this helps,

Tyler

DizzyIzzi10 months ago

Hi! This is my first instructables and my first Arduino Uno project. Can you tell me where to change the Cap Threshold value? I looked around your files and I just can't see it. Thanks!

tylercrumpton (author)  DizzyIzzi10 months ago

Hi there! The Cap Threshold value is near the top of the CapSensePiano.ino file and looks like:

#define CAP_THRESHOLD 150

Just change the 150 value to something else if you need to. Hope that helps!

SimonR110 months ago

Hello! Thanks very much for taking the time to put this together.

Is there anything stopping me from programming this onto an ATmega328?? As far as I can see the Uno isn't doing anything that the mega couldn't, but would there be memory issues?

Thanks,

Simon

1-40 of 68Next »