Pages: [1]   Go Down
Author Topic: capacitive touch Sensor without extra hardware?  (Read 1191 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 6
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 6
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

here is the code i was trying:

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

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 551
Posts: 46213
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

B0100111001000011, USA
Offline Offline
Edison Member
*
Karma: 0
Posts: 1503
I'm confused.  Wait, maybe not..
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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

0
Offline Offline
Newbie
*
Karma: 0
Posts: 6
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
« Last Edit: February 20, 2010, 11:52:51 pm by cowanrg » Logged

B0100111001000011, USA
Offline Offline
Edison Member
*
Karma: 0
Posts: 1503
I'm confused.  Wait, maybe not..
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Perhaps you should try the latest version, Arduino 0018?
Logged

North Yorkshire, UK
Offline Offline
Faraday Member
**
Karma: 104
Posts: 5531
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Mowcius
Logged

North Yorkshire, UK
Offline Offline
Faraday Member
**
Karma: 104
Posts: 5531
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 6
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

North Yorkshire, UK
Offline Offline
Faraday Member
**
Karma: 104
Posts: 5531
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 513
Posts: 31529
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

0
Offline Offline
Newbie
*
Karma: 0
Posts: 6
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

North Yorkshire, UK
Offline Offline
Faraday Member
**
Karma: 104
Posts: 5531
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Mowcius
Logged

Pages: [1]   Go Up
Jump to: