Forums

ESD protection for microcontroller pin that is to be touched

Started by Rene October 9, 2012
Hi!

I am designing a touch sensor on an AVR micocontroller. I have been 
working on the Qtouch library for days now but with no luck, there is 
nothing to be seen on the pins with the scope after flashing a sample 
program into the mcu. It has been a big PITA to even get the program to 
compile because the samples are made for AVR studio and Qtouch studio 
which are windows-only and I use Linux with avr-gcc.

Now I have tried something else (this qtouch stuff is really starting to 
be annoying, and when browsing the web it seems I am not the only one 
who feels this way) and that is showing the value the ADC measures on 8 
leds that are connected to a port when touching the pin with my finger 
(so physical touch detection instead of capacitive) and it shows that 
simply the 50 Hz that is in my body is enough to drive it to easily 
detectable signals (like in my old home-build touch dimmer but that uses 
a special ic). I intend to use a big pull down resistor, I guess 1 Mohm 
or so (also as a bleeding resistor, the internal resistance of the ADC 
is VERY high, it takes quite a while before charge disappears). The 
internal pull up is too strong, then the ADC value gets influenced by 
the touch too little. The AVR by the way has internal diodes on each pin 
to Vcc and from ground, I believe these should give some protection 
against discharges as well.

But now my question is: what series resistor should I use towards the 
sensor? I am concerned about the transfer of static from my body onto 
the mcu (which, at the same time, I want to measure). To make matters 
worse, I'm building this device for a boy in a wheelchair on rubber 
tires and filled with plastic sheets that rub against eachother. So I 
really see a risk of the mcu not having a long life expectancy without 
some precautions. So what value would be safe? If I use 1 MOhm for pull 
down and 1 MOhm as series resistor, I get usable results (though ). 
Would this be safe in the long term for the mcu?

An alternative would be to do it with a darlington transistor. But my 
question still remains: what to do to prevent charge from the body 
damaging my circuit?

Thank you very much in advance for your help!

Yours sincerely,
Rene

P.S. I ordered some ic's on Ebay in Hongkong. Today they were delivered 
in a small box with their feet stuck into a piece of *styrofoam* (no, it 
wasn't something antistatic, it was plain, cheap styrofoam). I guess the 
people running the shop are traders and not electronic engineers...
Dnia 09-10-2012 o 21:35:39 Rene <a@b.c> napisa=C5=82(a):

> Now I have tried something else (this qtouch stuff is really starting =
to =
> be annoying, and when browsing the web it seems I am not the only one =
=
> who feels this way) and that is showing the value the ADC measures on =
8 =
> leds that are connected to a port when touching the pin with my finger=
=
> (so physical touch detection instead of capacitive) and it shows that =
=
> simply the 50 Hz that is in my body is enough to drive it to easily =
> detectable signals[snip] > the mcu (which, at the same time, I want to measure). To make matters =
=
> worse, I'm building this device for a boy in a wheelchair on rubber =
> tires and filled with plastic sheets that rub against eachother.
Given that the wheelchair is battery powered and the person in it is = isolated from the ground, where do you expect to get your 50Hz from? The touch is likely to be detectable anyways, since a static charge you'= re = so afraid of will flow into the pin and a person is also an antenna. But= = the original idea of using a real capacitive sensor gave you isolation -= I = wouldn't give up on it so quickly. If the AVR is too much hassle, use a = = PIC and the CVD method (Microchip's AN1298). Regards, Andrzej Ekiert
On 10/10/2012 5:35 AM, Rene wrote:
> Hi! > > I am designing a touch sensor on an AVR micocontroller. I have been > working on the Qtouch library for days now but with no luck, there is > nothing to be seen on the pins with the scope after flashing a sample > program into the mcu. It has been a big PITA to even get the program to > compile because the samples are made for AVR studio and Qtouch studio > which are windows-only and I use Linux with avr-gcc. > > Now I have tried something else (this qtouch stuff is really starting to > be annoying, and when browsing the web it seems I am not the only one > who feels this way) and that is showing the value the ADC measures on 8 > leds that are connected to a port when touching the pin with my finger > (so physical touch detection instead of capacitive) and it shows that > simply the 50 Hz that is in my body is enough to drive it to easily > detectable signals (like in my old home-build touch dimmer but that uses > a special ic). I intend to use a big pull down resistor, I guess 1 Mohm > or so (also as a bleeding resistor, the internal resistance of the ADC > is VERY high, it takes quite a while before charge disappears). The > internal pull up is too strong, then the ADC value gets influenced by > the touch too little. The AVR by the way has internal diodes on each pin > to Vcc and from ground, I believe these should give some protection > against discharges as well. > > But now my question is: what series resistor should I use towards the > sensor? I am concerned about the transfer of static from my body onto > the mcu (which, at the same time, I want to measure). To make matters > worse, I'm building this device for a boy in a wheelchair on rubber > tires and filled with plastic sheets that rub against eachother. So I > really see a risk of the mcu not having a long life expectancy without > some precautions. So what value would be safe? If I use 1 MOhm for pull > down and 1 MOhm as series resistor, I get usable results (though ). > Would this be safe in the long term for the mcu? > > An alternative would be to do it with a darlington transistor. But my > question still remains: what to do to prevent charge from the body > damaging my circuit? > > Thank you very much in advance for your help! > > Yours sincerely, > Rene > > P.S. I ordered some ic's on Ebay in Hongkong. Today they were delivered > in a small box with their feet stuck into a piece of *styrofoam* (no, it > wasn't something antistatic, it was plain, cheap styrofoam). I guess the > people running the shop are traders and not electronic engineers...
I would put 1M from the sensor plate to a junction of a couple of Schottky diodes, one to ground, one to processor Vcc,then another resistor, maybe 10k or so, to processor pin. That way the external diodes carry the static discharges away, and the processor pin only sees the residual. The PIC CVD method as suggested could also be adapted to AVR. Static discharge is still an issue with capacitive sensors, the coupling can still transfer high voltages. -- Regards, Adrian Jansen adrianjansen at internode dot on dot net Note reply address is invalid, convert address above to machine form.
Adrian Jansen wrote:
> > On 10/10/2012 5:35 AM, Rene wrote: >> Hi! >> >> I am designing a touch sensor on an AVR micocontroller. I have been >> working on the Qtouch library for days now but with no luck, there is >> nothing to be seen on the pins with the scope after flashing a sample >> program into the mcu. It has been a big PITA to even get the program to >> compile because the samples are made for AVR studio and Qtouch studio >> which are windows-only and I use Linux with avr-gcc. >> >> Now I have tried something else (this qtouch stuff is really starting to >> be annoying, and when browsing the web it seems I am not the only one >> who feels this way) and that is showing the value the ADC measures on 8 >> leds that are connected to a port when touching the pin with my finger >> (so physical touch detection instead of capacitive) and it shows that >> simply the 50 Hz that is in my body is enough to drive it to easily >> detectable signals (like in my old home-build touch dimmer but that uses >> a special ic). I intend to use a big pull down resistor, I guess 1 Mohm >> or so (also as a bleeding resistor, the internal resistance of the ADC >> is VERY high, it takes quite a while before charge disappears). The >> internal pull up is too strong, then the ADC value gets influenced by >> the touch too little. The AVR by the way has internal diodes on each pin >> to Vcc and from ground, I believe these should give some protection >> against discharges as well. >> >> But now my question is: what series resistor should I use towards the >> sensor? I am concerned about the transfer of static from my body onto >> the mcu (which, at the same time, I want to measure). To make matters >> worse, I'm building this device for a boy in a wheelchair on rubber >> tires and filled with plastic sheets that rub against eachother. So I >> really see a risk of the mcu not having a long life expectancy without >> some precautions. So what value would be safe? If I use 1 MOhm for pull >> down and 1 MOhm as series resistor, I get usable results (though ). >> Would this be safe in the long term for the mcu? >> >> An alternative would be to do it with a darlington transistor. But my >> question still remains: what to do to prevent charge from the body >> damaging my circuit? >> >> Thank you very much in advance for your help! >> >> Yours sincerely, >> Rene >> >> P.S. I ordered some ic's on Ebay in Hongkong. Today they were delivered >> in a small box with their feet stuck into a piece of *styrofoam* (no, it >> wasn't something antistatic, it was plain, cheap styrofoam). I guess the >> people running the shop are traders and not electronic engineers... > > I would put 1M from the sensor plate to a junction of a couple of > Schottky diodes, one to ground, one to processor Vcc,then another > resistor, maybe 10k or so, to processor pin. That way the external > diodes carry the static discharges away, and the processor pin only sees > the residual. >
I'll second that. This is the way it's done right. The pull-down if needed can also be from that node. If this touch-stuff goes through the ADC then one can employ filtering to notch out 50, 100, 150Hz and so on. or in America 60, 120, 180Hz. If the uC runs out of MIPS sometimes the clever selection of the sampling intervals suffices.
> The PIC CVD method as suggested could also be adapted to AVR. > > Static discharge is still an issue with capacitive sensors, the coupling > can still transfer high voltages.
Especially on a dry winter day ... bzzt ... pop. -- Regards, Joerg http://www.analogconsultants.com/
On Oct 9, 12:35=A0pm, Rene <a...@b.c> wrote:
> Hi! > > I am designing a touch sensor on an AVR micocontroller. I have been > working on the Qtouch library for days now but with no luck, there is > nothing to be seen on the pins with the scope after flashing a sample > program into the mcu. It has been a big PITA to even get the program to > compile because the samples are made for AVR studio and Qtouch studio > which are windows-only and I use Linux with avr-gcc. > > Now I have tried something else (this qtouch stuff is really starting to > be annoying, and when browsing the web it seems I am not the only one > who feels this way) and that is showing the value the ADC measures on 8 > leds that are connected to a port when touching the pin with my finger > (so physical touch detection instead of capacitive) and it shows that > simply the 50 Hz that is in my body is enough to drive it to easily > detectable signals (like in my old home-build touch dimmer but that uses > a special ic). I intend to use a big pull down resistor, I guess 1 Mohm > or so (also as a bleeding resistor, the internal resistance of the ADC > is VERY high, it takes quite a while before charge disappears). The > internal pull up is too strong, then the ADC value gets influenced by > the touch too little. The AVR by the way has internal diodes on each pin > to Vcc and from ground, I believe these should give some protection > against discharges as well. > > But now my question is: what series resistor should I use towards the > sensor? I am concerned about the transfer of static from my body onto > the mcu (which, at the same time, I want to measure). To make matters > worse, I'm building this device for a boy in a wheelchair on rubber > tires and filled with plastic sheets that rub against eachother. So I > really see a risk of the mcu not having a long life expectancy without > some precautions. So what value would be safe? If I use 1 MOhm for pull > down and 1 MOhm as series resistor, I get usable results (though ). > Would this be safe in the long term for the mcu? > > An alternative would be to do it with a darlington transistor. But my > question still remains: what to do to prevent charge from the body > damaging my circuit? > > Thank you very much in advance for your help! > > Yours sincerely, > Rene > > P.S. I ordered some ic's on Ebay in Hongkong. Today they were delivered > in a small box with their feet stuck into a piece of *styrofoam* (no, it > wasn't something antistatic, it was plain, cheap styrofoam). I guess the > people running the shop are traders and not electronic engineers...
As a 'rule of thumb' I always encourage my staff to use buffers to the outside world. Several reasons, buffers tend to be more robust, when hit, they tend to not do much because they're not exercising a program; and being somewhat sacrificial, don't mind changing them out if they die. Next, barring lightning, you can pretty much keep ESD out and do what you want. BUT you have to think in terms of bandwidths up into the GHz. just design the protection filter to function over that bandwidth and you have some hope. *IF* you insist on direct connection to the uC; I'd put a nice cap adjacent to the uC pin right to its GND, put a series resistor as large as you can stand; which takes you over to the connection point and then put in the three fast tranzorbs, or components like that out at the pin to be touched between Vcc and GND, pin and GND, and pin and Vcc. AND right between that pin and the person add that series resistor to limit current. If components are SMT; you may wish to put several R's in series so their body capacitance doesn't feed thru/arc over too much and definitely connect right at the edge of the board, through a separate connection. There's a lot more to do to keep the onslaught of planar fields across the PCB and keep out any ESD induced magnetic field injections, too, but those are a start. Have you thought? Using 50/60Hz AC mains pickup works like a charm UNTIL there's a power outage. Then not so good. If the Operator doesn't need this to work when there's no AC power, or operate at remote outside locations, then go ahead and use the technique. If I were you, I'd make this self-contained -- isolate the pin, drive an outside ring using the uC's DAC output, or sq wave output will also work. and sense the feedpath provided as a finger gets in there. All self contained, requires NO direct connection to the uC and will operate like a proximity switch. Doing such, you can put the ring and center pickup BEHIND a plastic membrane and keep a lot of unwanted stuff out, including dirt.
On Wed, 10 Oct 2012 08:02:38 +1000, Adrian Jansen <adrian@qq.vv.net> wrote:

> >On 10/10/2012 5:35 AM, Rene wrote: >> Hi! >> >> I am designing a touch sensor on an AVR micocontroller. I have been >> working on the Qtouch library for days now but with no luck, there is >> nothing to be seen on the pins with the scope after flashing a sample >> program into the mcu. It has been a big PITA to even get the program to >> compile because the samples are made for AVR studio and Qtouch studio >> which are windows-only and I use Linux with avr-gcc. >> >> Now I have tried something else (this qtouch stuff is really starting to >> be annoying, and when browsing the web it seems I am not the only one >> who feels this way) and that is showing the value the ADC measures on 8 >> leds that are connected to a port when touching the pin with my finger >> (so physical touch detection instead of capacitive) and it shows that >> simply the 50 Hz that is in my body is enough to drive it to easily >> detectable signals (like in my old home-build touch dimmer but that uses >> a special ic). I intend to use a big pull down resistor, I guess 1 Mohm >> or so (also as a bleeding resistor, the internal resistance of the ADC >> is VERY high, it takes quite a while before charge disappears). The >> internal pull up is too strong, then the ADC value gets influenced by >> the touch too little. The AVR by the way has internal diodes on each pin >> to Vcc and from ground, I believe these should give some protection >> against discharges as well. >> >> But now my question is: what series resistor should I use towards the >> sensor? I am concerned about the transfer of static from my body onto >> the mcu (which, at the same time, I want to measure). To make matters >> worse, I'm building this device for a boy in a wheelchair on rubber >> tires and filled with plastic sheets that rub against eachother. So I >> really see a risk of the mcu not having a long life expectancy without >> some precautions. So what value would be safe? If I use 1 MOhm for pull >> down and 1 MOhm as series resistor, I get usable results (though ). >> Would this be safe in the long term for the mcu? >> >> An alternative would be to do it with a darlington transistor. But my >> question still remains: what to do to prevent charge from the body >> damaging my circuit? >> >> Thank you very much in advance for your help! >> >> Yours sincerely, >> Rene >> >> P.S. I ordered some ic's on Ebay in Hongkong. Today they were delivered >> in a small box with their feet stuck into a piece of *styrofoam* (no, it >> wasn't something antistatic, it was plain, cheap styrofoam). I guess the >> people running the shop are traders and not electronic engineers... > >I would put 1M from the sensor plate to a junction of a couple of >Schottky diodes, one to ground, one to processor Vcc,then another >resistor, maybe 10k or so, to processor pin. That way the external >diodes carry the static discharges away, and the processor pin only sees >the residual.
I'd use a unipolar TVS diode after a resistor. I don't want the ESD surge going into my supply, if I can help it, either. A capacitor at that node helps a lot, too.
>The PIC CVD method as suggested could also be adapted to AVR. > >Static discharge is still an issue with capacitive sensors, the coupling >can still transfer high voltages.
krw@att.bizzzzzzzzzzzz wrote:
> On Wed, 10 Oct 2012 08:02:38 +1000, Adrian Jansen <adrian@qq.vv.net> wrote: > >> On 10/10/2012 5:35 AM, Rene wrote: >>> Hi! >>> >>> I am designing a touch sensor on an AVR micocontroller. I have been >>> working on the Qtouch library for days now but with no luck, there is >>> nothing to be seen on the pins with the scope after flashing a sample >>> program into the mcu. It has been a big PITA to even get the program to >>> compile because the samples are made for AVR studio and Qtouch studio >>> which are windows-only and I use Linux with avr-gcc. >>> >>> Now I have tried something else (this qtouch stuff is really starting to >>> be annoying, and when browsing the web it seems I am not the only one >>> who feels this way) and that is showing the value the ADC measures on 8 >>> leds that are connected to a port when touching the pin with my finger >>> (so physical touch detection instead of capacitive) and it shows that >>> simply the 50 Hz that is in my body is enough to drive it to easily >>> detectable signals (like in my old home-build touch dimmer but that uses >>> a special ic). I intend to use a big pull down resistor, I guess 1 Mohm >>> or so (also as a bleeding resistor, the internal resistance of the ADC >>> is VERY high, it takes quite a while before charge disappears). The >>> internal pull up is too strong, then the ADC value gets influenced by >>> the touch too little. The AVR by the way has internal diodes on each pin >>> to Vcc and from ground, I believe these should give some protection >>> against discharges as well. >>> >>> But now my question is: what series resistor should I use towards the >>> sensor? I am concerned about the transfer of static from my body onto >>> the mcu (which, at the same time, I want to measure). To make matters >>> worse, I'm building this device for a boy in a wheelchair on rubber >>> tires and filled with plastic sheets that rub against eachother. So I >>> really see a risk of the mcu not having a long life expectancy without >>> some precautions. So what value would be safe? If I use 1 MOhm for pull >>> down and 1 MOhm as series resistor, I get usable results (though ). >>> Would this be safe in the long term for the mcu? >>> >>> An alternative would be to do it with a darlington transistor. But my >>> question still remains: what to do to prevent charge from the body >>> damaging my circuit? >>> >>> Thank you very much in advance for your help! >>> >>> Yours sincerely, >>> Rene >>> >>> P.S. I ordered some ic's on Ebay in Hongkong. Today they were delivered >>> in a small box with their feet stuck into a piece of *styrofoam* (no, it >>> wasn't something antistatic, it was plain, cheap styrofoam). I guess the >>> people running the shop are traders and not electronic engineers... >> I would put 1M from the sensor plate to a junction of a couple of >> Schottky diodes, one to ground, one to processor Vcc,then another >> resistor, maybe 10k or so, to processor pin. That way the external >> diodes carry the static discharges away, and the processor pin only sees >> the residual. > > I'd use a unipolar TVS diode after a resistor. I don't want the ESD surge > going into my supply, if I can help it, either. A capacitor at that node > helps a lot, too. >
But mind that TVS have tons of capacitance. With 1M series resistors I don't see how an ESD hit could possibly endanger a well-bypassed power rail. If still concerned make a "waste dump sub-rail" instead. [...] -- Regards, Joerg http://www.analogconsultants.com/
"Adrian Jansen" <adrian@qq.vv.net> wrote in message 
news:50749f03$0$11118$c3e8da3@news.astraweb.com...
> I would put 1M from the sensor plate to a junction of a couple of > Schottky diodes, one to ground, one to processor Vcc,then another > resistor, maybe 10k or so, to processor pin. That way the external > diodes carry the static discharges away, and the processor pin only sees > the residual.
Agreed, with one caveat: Using a series 1M resistor against schottky diodes is iffy. Only 2.5uA of unbalanced leakage and your logic level is wrong. I'd use 1N4148 instead. They'll still fire before the MCU input protection diodes, and their greater peak current handling capacity allows you to use a much smaller series resistance without endangering the MCU. Tim -- Deep Friar: a very philosophical monk. Website: http://webpages.charter.net/dawill/tmoranwms
Rene <a@b.c> wrote:

>Hi! > >I am designing a touch sensor on an AVR micocontroller. I have been >working on the Qtouch library for days now but with no luck, there is >nothing to be seen on the pins with the scope after flashing a sample >program into the mcu. It has been a big PITA to even get the program to >compile because the samples are made for AVR studio and Qtouch studio >which are windows-only and I use Linux with avr-gcc. > >But now my question is: what series resistor should I use towards the >sensor? I am concerned about the transfer of static from my body onto
You really should read and understand the manual first. The electrode is not to be touched! Qtouch is a fancy word for capacitive touch sensing which works because a finger changes the dielectric constant and thus the measured capacitance. You shouldn't use a scope on the pins because you won't see anything. -- Failure does not prove something is impossible, failure simply indicates you are not using the right tools... nico@nctdevpuntnl (punt=.) --------------------------------------------------------------
On Tue, 09 Oct 2012 16:44:17 -0700, Joerg <invalid@invalid.invalid> wrote:

>krw@att.bizzzzzzzzzzzz wrote: >> On Wed, 10 Oct 2012 08:02:38 +1000, Adrian Jansen <adrian@qq.vv.net> wrote: >> >>> On 10/10/2012 5:35 AM, Rene wrote: >>>> Hi! >>>> >>>> I am designing a touch sensor on an AVR micocontroller. I have been >>>> working on the Qtouch library for days now but with no luck, there is >>>> nothing to be seen on the pins with the scope after flashing a sample >>>> program into the mcu. It has been a big PITA to even get the program to >>>> compile because the samples are made for AVR studio and Qtouch studio >>>> which are windows-only and I use Linux with avr-gcc. >>>> >>>> Now I have tried something else (this qtouch stuff is really starting to >>>> be annoying, and when browsing the web it seems I am not the only one >>>> who feels this way) and that is showing the value the ADC measures on 8 >>>> leds that are connected to a port when touching the pin with my finger >>>> (so physical touch detection instead of capacitive) and it shows that >>>> simply the 50 Hz that is in my body is enough to drive it to easily >>>> detectable signals (like in my old home-build touch dimmer but that uses >>>> a special ic). I intend to use a big pull down resistor, I guess 1 Mohm >>>> or so (also as a bleeding resistor, the internal resistance of the ADC >>>> is VERY high, it takes quite a while before charge disappears). The >>>> internal pull up is too strong, then the ADC value gets influenced by >>>> the touch too little. The AVR by the way has internal diodes on each pin >>>> to Vcc and from ground, I believe these should give some protection >>>> against discharges as well. >>>> >>>> But now my question is: what series resistor should I use towards the >>>> sensor? I am concerned about the transfer of static from my body onto >>>> the mcu (which, at the same time, I want to measure). To make matters >>>> worse, I'm building this device for a boy in a wheelchair on rubber >>>> tires and filled with plastic sheets that rub against eachother. So I >>>> really see a risk of the mcu not having a long life expectancy without >>>> some precautions. So what value would be safe? If I use 1 MOhm for pull >>>> down and 1 MOhm as series resistor, I get usable results (though ). >>>> Would this be safe in the long term for the mcu? >>>> >>>> An alternative would be to do it with a darlington transistor. But my >>>> question still remains: what to do to prevent charge from the body >>>> damaging my circuit? >>>> >>>> Thank you very much in advance for your help! >>>> >>>> Yours sincerely, >>>> Rene >>>> >>>> P.S. I ordered some ic's on Ebay in Hongkong. Today they were delivered >>>> in a small box with their feet stuck into a piece of *styrofoam* (no, it >>>> wasn't something antistatic, it was plain, cheap styrofoam). I guess the >>>> people running the shop are traders and not electronic engineers... >>> I would put 1M from the sensor plate to a junction of a couple of >>> Schottky diodes, one to ground, one to processor Vcc,then another >>> resistor, maybe 10k or so, to processor pin. That way the external >>> diodes carry the static discharges away, and the processor pin only sees >>> the residual. >> >> I'd use a unipolar TVS diode after a resistor. I don't want the ESD surge >> going into my supply, if I can help it, either. A capacitor at that node >> helps a lot, too. >> > >But mind that TVS have tons of capacitance. With 1M series resistors I >don't see how an ESD hit could possibly endanger a well-bypassed power >rail. If still concerned make a "waste dump sub-rail" instead.
The capacitance, like everything else, depends on the part used. TVS diodes can be had <1pF. The ones intended for USB work pretty well (1pF, IIRC). They're small, but that's all that's really needed behind a big resistor. Where does this "sub-rail" go? You don't want much inductance in it.