Static Electricity touch sensing breaking things..

I have an alarm clock with a metal enclosure that I wanted to add a snooze feature to. I attached an analog arduino input pin to the case with an external pulldown resistor.
This seemed to work ok; the voltage seen by the analog input would go up past a threshold consistantly when I touched the case. I put the clock back together and tested it: the touch detection worked ok for a few minutes and then stopped working...
Eventually I figured out that the analog pin would no longer read ANYTHING so I tried using the next pin over and it worked ok untill the same thing happened...
So obviously I am killing the pins somehow. I though that it was only possible to do this when they were in output mode (low impedance) but I guess not.

Is there a better way to achieve what I want that won't break anything?
Should I try putting a big resistor between the case and input pin to limit the current so I don't fry anything?

If I read this correctly what you're doing is floating your metal case to an analog input.

Those pins are made to read 0V or 5V.

Walking across a vinyl floor is likely going to source 15,000V.

Carpet, 30,000V.

You want to hook up two resisters, one to ground, one to chassis, and hook up the analog pin between them.

at least in the kilo-ohms. maybe mega-ohms.

Well holy crap I had no idea that the voltage could be that high. :o

I wasn't quite floating it, I had about a 2.5k[ch937] pulldown to ground but nothing in-between the chassis and the analog input pin so I guess thats probably why they died... I was worried that I was going to run out of pins.

I'll try putting at least a 1M[ch937] between the pin and the chassis.

In situations like this, include a 5.1V Zener diode between the pin and ground to clamp the voltage within acceptable limits in addition to the afore mentioned resistor network. I've walked across synthetic carpet and drawn some pretty long arcs. Having worked on ignition systems in the past where 30-40kV was the norm, the arc length was pretty close to what I used as a test gap for magneto output. What you are sensing is a lot less, but can be easily in the 1.5-2kV if two satisfactory synthetic materials get included in clothing and blankets. Dry Wool and nylon can be really good at this.

Be advised that a 5.1v zener may not operate as expected unless there is a certain minimum current available to flow thru it. Didn't know this until a while back when I was being stingy with my electrons when making a voltage divider with high value resistors.

Thanks for the help!

So if I understand correctly:
Putting a Zener diode between the arduino pin and ground will assure if there is any voltage greater than 5.1 (in this case) that current will go to ground instead of the arduino.

zoomkat -
Is it reasonable to assume that if the current is that low, then there is no risk to damaging the arduino?

How do you quote people's posts on this forum??? I don't see a quote button anywhere. I swear I've seen people quote people in replies...

static electricity is extremely low current, thats the problem with the zener.

it's extremely high voltage.

I'd suggest experimenting with the voltage divider scenario I gave ya.

zoomkat -
Is it reasonable to assume that if the current is that low, then there is no risk to damaging the arduino?

No, I would not assume that. Static charges carry little current but can apparently can arc thru semiconductor layers and cause damage. As the voltage regulator on my DFArduino does not function properly, I can say that my arduino survived operating at 7.5v for a short while until I checked it with a multimeter. A 5.1v zener may prevent reaching the 7.5v range even at a low current value. As to the quoting, when typing a post, run your cursor over the above tool bar to see the various options (code is the #, quote is to the right of it).

@zoomcat, you're correct. After a little research, actually, the problem with static electricity is not the small current, but the microseconds duration pulse that doesn't allow the Zener diode time to react. Since it doesn't break over into conduction quick enough, the pulse gets through to the even thinner insulation and traces inside the microprocessor and fries that section (pin). ST Micro and others make TVS diodes for this purpose, they have picosecond response times to help clamp overvoltage.

Here's an article discussing the various ways to protect I/O lines from ESD.

http://www.ce-mag.com/archive/03/ARG/dunnihoo.html

I think you need a dose of protection:-
http://www.thebox.myzen.co.uk/Tutorial/Protection.html

There are diodes specifically designed for ESD protection.

I used this one on an Arduino-based dust collector controller. It's been running fine for a couple of years.

A dust collector is a woodworking tool that is similar to a huge vacuum. Mine moves air at a maximum of 1100 CFM (cubic ft/min); compare to a large shop vac, which moves air at max 185 CFM. Moving air can create a tremendous amount of static - think about lightning bolts!

-j