How do I make a resistive touch switch?

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:

  1. I'm building a replica prop, and the original uses a resistive touch switch, so for authneticity's sake I want to mimic this.

  2. 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. :frowning:

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.

The resistance of skin:

Clean skin often has a resistance of about 500 ohms. Dirty skin can have electrical resistances of up to several million ohms.

Your body resistance varies greatly in different parts of your body. A value of 1500 ohms is commonly used as the resistance between major extremities of an average human body: hand to hand, or hand to foot.

I would probably use a 4K7 pot on the other side so you can fiddle a bit with the sensitivity.

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?

There is no problem with taking 5v straight to the analog pin, only shorting 5v to gnd is an issue.

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.

Running on 5V with an arduino, there is pretty much no way you could get a shock off it.

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.

When the finger is not on the contacts, the arduino should read 0 as it is connected to the gnd pin (yes it's through a resistor but that doesn't make a difference in this situation).

Mowcius

4.7K pot on the other side of what?

Where you currently have R1. Instead of a fixed resistor, if you use a pot then you can adjust the sensitivity of the touch switch.

Mowcius

But 4.7K seems way too low. Even if it were paired with a resistor. Most of the examples I've been able to find for these sorts of switches reccomend resistances as high as 10M ohms...

Well I was just going on what I had found online. Anyway that should be enough info for you to fiddle and see what works now.

Mowcius

Jus a quick look, you probably need a very high value resistor connected between the input pin and ground to keep the pin from floating without grounding the extremely low current flowing thru the finger. Just as a reality check, touch the probes of your multimeter to your finger tip and see what the resistance is, then you will see the extremely small current high resistance realm you are working in. Are you sure the gizmo you are duplicating actually uses a resistive switch?

I have a multimeter, but I'm not really sure how to use it. I'll try to figre out how to get it to measure resistance though. :slight_smile:

As for whether the gizmo uses a resitive switch, I'm pretty sure it does:
http://www.cylandprops.com/PKEmeterp1.html

Note the four wires at the top of the handle:

Also on the front of the meter:

Unfortunately, not much can be told from the internals. :slight_smile:

I'm not getting anything out of my multimeter, whether it's set to 200 ohms, 2K, 20K 200K or 2000K. At least not on my finger. It reads .820 when I've got it across an 820 ohm resistor on the 2K setting. Not sure why the setting is called 2K when it's obviously reading 1K as 1.0, but nothing in electronics ever seems to make sense to me.

Anyway, I know it's working. But I suspect my finger's resistance is indeed somewhere in the 10M ohm range, so the meter can't read it.

Not sure why the setting is called 2K when it's obviously reading 1K as 1.0, but nothing in electronics ever seems to make sense to me.

Because it can read a maximum of 2K on that setting.

Mowcius

That seems kinda silly. So does that mean in any mode the highest number it will display is 2.0? Why 2.0? Why not 2000? And why 2K? Why not 1K?

Hm...

It would appear that in reality 2K might actually mean 1.999~ which would make more sense. I guess maybe it's an accuracy thing or something? Getting the most out of the display? Still not really sure why it's not 10K though. 9.9999 would still make more use of the display than 1.9999.

Still not really sure why it's not 10K though. 9.9999 would still make more use of the display than 1.9999.

Presumably becuase of how it measures it or something...

Dunno on that one.

Mowcius

Probably need to get an auto ranging multimeter. :wink:

DVM complexity and cost is mostly due to the number of 'counts' it's internal A/D converter has, not it's number of display characters (display characters are cheap). The most common A/D for DVMs is a 2000 count converter (0-1999). So 'filling in that first character position to a full 9 could require a 10,000 count A/D converter, resulting in a much higher cost instrument.

Lefty

Retro:
Makes sense now. Thanks. :slight_smile:

How to use a multimeter is in the manual. 2K scale would be good for around 500 ohms - 2k ohms. You can find information about it in the manual for the meter. If you get 0 on a scale go down and if you get open go up.

You can find autoranging DMM's but those are more expensive. Until you get to the $200+ range they are slow to give a reading.

Manual? What's that? All my electronics equipment is a hand me down from my dad and was made in the 1980's. :slight_smile: