Go Down

Topic: capacitive touch Sensor without extra hardware? (Read 1 time) previous topic - next topic

cowanrg

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?

cowanrg

here is the code i was trying:

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

PaulS

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

TchnclFl

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

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

cowanrg

#4
Feb 21, 2010, 05:52 am Last Edit: Feb 21, 2010, 05:52 am by cowanrg Reason: 1
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

TchnclFl

Perhaps you should try the latest version, Arduino 0018?

mowcius

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

Mowcius

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

cowanrg

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?

mowcius

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

Grumpy_Mike

Quote
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.

cowanrg

Quote
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.

mowcius

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

Mowcius

Go Up