I've been searching for schematics on the web for how to make a touch switch, but 90% of what I find either shows how to make a capacitive touch switch, or has all these extra components like transistors and nand gates which confuse me as to how to make it function with the Arduino.
I need a resistive touch switch for two reasons:
-
I'm building a replica prop, and the original uses a resistive touch switch, so for authneticity's sake I want to mimic this.
-
I'm fairly certain that a resisitve touch switch is not unlike a potentiometer and as such requires only one pin to function. Capacitance switches appear to require two.
I found this post dealing with them:
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1264609996
But the ascii schematics aren't clear.
I'm pretty sure that what PaulS is trying to show is the following:
And I suspect that the reason mburkit was having issues is because he connected the circuit up this way:
...and because he used a 10K resistor which according to this page is much less than the resistance of skin:
http://www.produceconsumerobot.com/truth/
Other pages I've read seem to indicate that the finger should have a lower resistance than the resistor you use in the circuit. Which if I understand how potetiometers work, makes perfect sense.
And that page seems to indicate that a human finger has a resistance somehwere between 50K and 10M ohms. Though I'm sure this probably differs based on how far apart you have the contacts. (Mine will have 0.2" (5mm) or less seperation.)
But it also says a 10M resistor makes the signal noisy, so I dunno. And PaulS didn't specify the size of resistor needed.
Also, assuming PaulS's cicuit works, I am concerned about something in the design. When you place your finger across the terminals, they have a lot of resistance, and things are hunky-dory. But what happens if a piece of metal accidentally comes in contact with them? Then there's no resistor between the +5v and the pin of the Arduino. Is that a problem? I'm not sure, but I think that would let hundreds of milliamps of current flow and would fry the Arduino.
So to prevent the Arduino from being fried, I think I should use one of the following setups. I suppose it doesn't matter which, since R2 would only be 1K or so. Though perhaps it should be larger than that?
Another thing that concerns me is how much current will be flowing across your finger. I saw something that said 10mA is painful, and 40mA is dangerous. But is that a concern with a battery? I don't know. But I could select the size of R2 to get the mA down into a safe range if that's an issue. I suspect it isn't though.
Speaking of which, I found this page on wikipedia:
Which says the resistance of skin is 1K to 100K, which is quite a bit different from what that other page said.
So much conflicting info.
Anyway, one last thing...
When no connection is being made, do you suppose the Arduino will return 0 for the value on the analog port, or might I want to treat say, any value less than 512 as an off state? I suppose I may need to do debouncing as well because this switch will need to toggle an action. There's a debounce library right? I'm sure I saw one.