capacitive touch Sensor without extra hardware?

i'm wanting to make a simple touch sensor for the arduino, so i can create something similar to a lamp control module. i saw this video on youtube and a snippet of code on the arduino website.

but i couldn't get the code to work. any ideas?

here is the code i was trying:

http://www.arduino.cc/playground/Code/CapacitiveSensor

What do you have hooked to the Arduino? Dry hands or wet?

Try this one: I know for a fact it works:

http://www.arduino.cc/playground/Main/CapSense

i can't seem to get the code to even compile. with the capsense library, it doesn't seem to 'install' correctly. when i unzip it, i get errors in windows, and it doesn't compile correctly. so i can't get past step 1.

edit: i'm using arduino 0017

Perhaps you should try the latest version, Arduino 0018?

Hmm, I had it working on 0017 before. Maybe you should have a look with google :wink:

Mowcius

I just tried on 0018 and it works fine.

It seems to compile ok, i'm not sure what issues you can be having. Just download - unzip and copy into hardware-libraries (in 0017) make sure it's in the correctly named folder and use the example downloaded with it.

Mowcius

i figured out that vista doesn't like the file structure in the zip file. i extracted it on an xp machine and it works fine.

i got the basic sketch to work, and things are just fine with the example.

however, with that i'm trying to do, it doesn't work. i have a long square steel tube (0.5" square, 3 feet long) that i'm trying to use as a touch sensor. it doesn't work at all. its conductive, but i cannot get a capacitance reading reliably from it. it jumps all over the place. i've tried using as low as 100k ohm resistance up to about 2M ohm. the 100k makes the baseline values more stable, but it won't read a touch. any ideas?

Hmm, are you sure it is all wired up correctly, sounds like a floating pin (on a digital pin!?)

Try the code with a small piece of foil or something first to make sure it is working properly. I would not have thought that the tube would make much of a difference.

Mowcius

but i cannot get a capacitance reading reliably from it. it jumps all over the place.

This doesn't surprise me, you have a big conductor picking up all sorts of rubbish. This code / project is just a demonstration of a principal, it is not a solid robust technique that can be used with anything. As mowcius said it was made to work with small foil pieces, your problems do not surprise me at all.

Hmm, are you sure it is all wired up correctly, sounds like a floating pin (on a digital pin!?)

Try the code with a small piece of foil or something first to make sure it is working properly. I would not have thought that the tube would make much of a difference.

Mowcius

it's quite reliable with a small bit of foil. it works VERY well actually. i would have thought the same about the tube, i didn't expect it to be that much different at all. i'm sure its hooked up right. i'm using an alligator clip to attach to the tube. when i just clip it on foil (or read directly from the alligator clip itselft), it's fine. but the tube doesn't work at all. seems strange to me.

Could you stick in a nice cap somewhere to smooth that stuff out a bit?

Mowcius