Connect with us

ESD protection for microcontroller pin that is to be touched

Discussion in 'Electronic Design' started by Rene, Oct 9, 2012.

  1. Rene

    Rene Guest

    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...
     
  2. 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.
     
  3. Joerg

    Joerg Guest

    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.


    Especially on a dry winter day ... bzzt ... pop.
     
  4. Robert Macy

    Robert Macy Guest

    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.
     
  5. Guest

    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.
     
  6. Joerg

    Joerg Guest

    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.

    [...]
     
  7. Tim Williams

    Tim Williams Guest

    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
     
  8. Nico Coesel

    Nico Coesel Guest

    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.
     
  9. Guest

    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.
     
  10. Rene

    Rene Guest

    Wow, I had expected this many replies, thank you all for your efforts. I
    think I will go the route described with an extra node with protection
    diodes and an extra series resistor. Maybe I'll add an extra resistor.

    Thanks again!

    Yours sincerely,
    Rene
     
  11. Rene

    Rene Guest


    I have read it so many times that my eyes starting hurting ;-).


    I know, it is a capacitive system. However, what I wanted to make after
    giving up on Qtouch, is a sensor that /is/ to be touched.



    That is not correct. The changed capacitance is detected because there
    is a process of charging and discharging of the electrode going on (the
    timing in that process is a function of the capacity) and this can be
    seen on a scope (which is also mentioned in the manual).

    Yours sincerely,
    Rene
     
  12. Rene

    Rene Guest


    To be honest, I had not thought of that. But fortunately that will not
    be a problem.


    What you describe is what is called the Qmatrix method in the Qtouch
    library, there is also the Qtouch method which uses only one electrode.

    I think first I will try to make things work with physical touch and
    later I will sink my teeth into capacitive sensing (and that cursed
    library ;-)) again.

    Thank you!

    Yours sincerely,
    Rene
     
  13. Rene

    Rene Guest


    I would be very gratefull if you could explain to me what a
    well-bypassed power rail means, I do not know what it is.

    Thank you!

    Yours sincerely,
    Rene
     
  14. Guest

    Lots of distributed capacitance to ground. The capacitors should be of
    different sizes (small for high frequency and larger for low).
     
  15. Robert Macy

    Robert Macy Guest

    ?? "The capacitors should be of different sizes..." Did the industry
    change their thinking here?

    I have NOT found that technique effective unless done with EXTREME
    care. Using HFSS to analyze.

    Rather than risk your electronics, just use the IEEE model for a
    'personal' ESD event and model the circuitry using LTspice, or such.

    In other words, pretend you've just attached a 100pF capacitor charged
    to 18kV, and ask yourself, "I wonder what THAT does?" be sure to
    consider all those pesky parasitic paths, too. Oh, and also ask
    yourself what that resulting spike of current might induce into your
    circuit someplace else.
     
  16. Joerg

    Joerg Guest


    With a full plane you can live with a few sprinkled 0.1uF plus on 10uF
    or so. Because the plane itself is a small and very good distributed
    capacitor.


    That was in the last century :)

    Rene, plus one very important thing in addition: If you get a barrage of
    hits and your system is extremely low in power consumption you might
    want to have a limiter that bleeds excess charge. This is because
    regulators can typically only source current but most (except for some
    sync bucks) cannot sink. A TLV431 is nice for this, just set it a few
    hundred mV above your nominal rail voltage. High enough that tolerances
    won't make it come on but low enough so it does come on before chips go
    kaputt.
     
  17. Joerg

    Joerg Guest

    Don't use Schottkys for this.

    The BAV199 is very low leakage and "budget-priced".
     
  18. Guest

    "Few" is left to the engineer.
    Not so much. Still gotta supply current.
    n
    It's easier just to dump through a TVS directly to ground.
     
  19. Joerg

    Joerg Guest

    Or guys like Muntz :)


    That's what the power supply is for. Nowadays many 1uF ceramics are good
    up into the gigeehoitzes.


    That no workie. A TVS has huge tolerances and a large spread between
    when it starts conducting and then conducting some more. On the usual
    logic rail, however, you typically have only 10%-15% margin between
    operational at full clock speed and *PHUT*
     
  20. Joerg

    Joerg Guest


    Make sure to use the BAV199 or something similar. 5nA leakage guaranteed
    at 75V reverse (room temp), tough to beat that and you get a dual-diode
    for under 5c a pop in reels.
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-