@kidr00b

paul i'd just like to thank you for your explanation! many of my projects have come to fruition because of your tutorials and posts on the forums. So great to see someone genuinely knowledgeable putting their ideas out there to help others understand.

also very clear and well explained!

@antoniodevincentiis3823

Hi paul. Great work!
I report what I found by doing some tests:
1)If you use the same output pin (4 as in the example) for multiple sensors it becomes very slow.
2) The same happens if you connect the serial port, for example 0->RX and TX->1 of Arduino UNO
3) If you put your bare feet on the ground or have damp shoes, the read value rises until it blocks the serial monitor.

For the rest everything seems OK! Great! 👍

@PaulStoffregen

1: Each electrode connects to 2 pins.  The send pin needs a resistor.  I used 4.7M in this video demo.  The receive pin can connect directly, but I used a 1K resistor which helps protect the pin.
2: CapSense uses digital pins.
3: I did not use CapSense's AutoCal functions.

Please check the CapSense page on the Arduino Playground.  If you google "capsense", it's the #1 link.  It explains CapSense in much more detail than I can put into a 90 second video demo.

@PaulStoffregen

Higher resistance values (or 2 or more resistors in series) can improve sensitivity, but it will not solve the ground problem.  That's a fundamental issue with capacitive sensing.  Hand-held products with capacitive touch buttons and screens have metal housings so the user is grounded to the device, and free-standing equipment requires earth grounding to work.

@PaulStoffregen

touchRead(pin) is in the Teensy3 core library, together with all the normal functions like analogRead, digitalWrite, pinMode, etc.

@PaulStoffregen

It's the same copper tape that's sold for create stained glass art.  It's meant to be soldered.  Normally stained glass soldering is done with large/powerful irons.  Just give it a little time to heat up and the solder will flow.

@PaulStoffregen

You can use the same pin to drive multiple sensors, but each needs its own individual input.  In fact, the example shown in this video uses 4 pins to interface 3 touch sensitive electrodes!

@boggynfld

It seems this idea is not so popular with the Arduino for some reason. This seems to be the most recent and useful info on sensing touch directly on the Arduino pins.  Maybe most people are buying off the shelf touch sensor boards?  I tried your code and it work wonderfully (with 2Mohm resistor)! Thank you. I was initially experimenting with input on the analog pins with little success. This is the way to go.

@PaulStoffregen

@notbot Yes.  There's a MIDI library you can use for regular (5 pin) MIDI out.  It works on all Arduino compatible boards.  Teensyduino (Teensy only) also has USB MIDI, which you can use from the Tools > USB Type menu.  It should be pretty simple to use either to send MIDI messages when the sensors are touched.

@robertblaylock618

Thank You.
It is rewarding to have an idea, and then find someone has already done it, and done it So Well. Old people find the strangest stuff interesting I suppose.
Thanks

@PaulStoffregen

I wired it up exactly as described in the comments of the example that comes with version 4.  Open it from File > Examples > CapSense > CapSenseSketch.  Yes, all three 4.7M resistors connect to pin 4.  The receive pins are 2, 6 and 8.  Of course, you can use any digital pins, but those are the pins used by the example program than comes with CapSense, and for this video demo I just used the example code.

@PaulStoffregen

I believe they are the same.  Copper, Aliminum, Tin, Brass, or any non-ferrous metal (eg, magnet doesn't stick) should work identically.  Ferrous metals probably also work fine too.

@PaulStoffregen

CapSense might work, if you use many smaller metal pieces, but that's not really one long continuous metal strip.  Probably not quite what you want.

I did see the ideal product (for your project) recently, and some used it successfully with Teensy a few weeks ago.  The pin number defines may need to be edited, but I have 1 confirmation it does work.  Since youtube doesn't allow links in these comments, google for "QT1106 breakout", and click on "7 Key Slider/Wheel".

Good luck & send me a photo

@PaulStoffregen

Yes, it might be possible.  The chip and extra wiring will add a little capacitance, but other than changing the readings slightly, I'd imagine that ought to work.  Maybe you can give it a try and tell me if it works?

@radosawmosurek2177

Hi, I'm trying to build a capacitve slider. I found some info on Arduino Playground. Do you have any examples how to build it?

@PaulStoffregen

On Teensy3, just connect to any of the touch-capable pins (see the pinout card or reference page) and then use touchRead().  It works like analogRead(), except the number you get is the capacitance in 1/50th pF units.  Teensy3's touchRead() is much faster and more accurate than using this library!

@deltaray3

Seems so funny to solder something to copper tape. Didn't realize that would work. Cool!

@PaulStoffregen

If the foil conducts electricity, odds are very good it will work.

It's so very easy to try... just connect it using a couple resistors to any 2 digital pins on any Arduino compatible board and run the CapSense example (edit the pin numbers to the pins you used!)

Maybe you can reply here after you've tried it, to let everyone know if it worked?

@mohamedasayed

Hey, I have encountered a problem while trying this out. I was hoping if you could help out. Im getting a massive performance reading. I get a value every 4 seconds or so. Any ideas?

@A-MOCM

Hi: any chance of midi out on this code code?