Shop OBEX P1 Docs P2 Docs Learn Events
Tracy Allen capacitor plate — Parallax Forums

Tracy Allen capacitor plate

alnajjar1alnajjar1 Posts: 110
edited 2013-03-24 17:44 in BASIC Stamp
I am still working on a touch sensing switch and stumbled on a response from Tracy to a similar question from 2010 in this forum. She suggested connecting a capacitor plate directly to the Stamp pin and Ground. it works really well. the IN value goes to 1 when I touch the plate (a 1/4" plexi plate (3"x3" with AL foil strips on both sides). The problem is stability. In the same post I mentioned, she Tracy suggested hooking an LED to another pin on the stamp. That doesn't seem to stabilize the circuit but rather increase sensitivity. She made additional remarks about 60Hz noise but didn't elaborate on how that impacts the capacitance or the electric field of the plates or the Stamp's response.

I hope she reads this post and shed some more light on how to improve this great and simple solution. It is extremely simple and effective if I can somehow improve stability and reliability.

I read all kind of posts on using qProx, QT113 etc but require additional ICs and circuitry and all pale in comparison to Tracy's simple and elegant solution.

hope to get some insights or other experts ...

Al

Comments

  • mindrobotsmindrobots Posts: 6,506
    edited 2013-03-22 11:05
    Tracy is a HE but other than that, he reads posts and is most helpful and very knowledgeable!!
  • PropNut1960PropNut1960 Posts: 23
    edited 2013-03-22 11:27
    Have you tried incorporating some type of debounce code for the input?
  • alnajjar1alnajjar1 Posts: 110
    edited 2013-03-22 15:24
    My apologies to Tracy!!!

    I have tried a de-bounce routine where the code count several "on" before giving a positive reading. This helps somewhat but clunky and not a 100% reliable, there is simple too much noise! I am hoping for an electronic solution to stabilize the circuit. I tried to find the QT113 or QT160 but the only supplier, DigiKey, doesn't have them in stock and after calling them they said there is an indefinite lead time.

    I did find a similar chip from (http://www.hobbytronics.co.uk/manufacturer-hobbytronics/touch-switch-ic) but I am not sure this will be the solution..

    thanks...
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2013-03-23 10:59
    No apology necessary. It is a common assumption, she, but I am in good company with my brothers, Tracy Kidder and Tracy Morgan (aka Jordan) to name two.

    There are a couple of forms of coupling that can happen. In an urban environment, we are bathed in a 60Hz electric field from the surrounding electrical wiring. When you touch a plate or bring a hand next to it, the field couples into the input pin of the Stamp and it bounces up and down through its switching threshold. This can be detected by looking for a string of 0s and 1s at the input, or by the COUNT or PULSIN commands. However if the input pin is not connected to anything at all, it will drift up and down and will give false indications. The solution is to attach a very high resistance leakage path to the input pin. A reverse biased diode or back-to-back pair of diodes can do that, just a few picoamps of leakage, or a multi MΩ resistor if the fields are strong. That can be connected to ground, or, it can be connected to the wiper of a potentiometer if you need a sensitivity adjustment.

    The above depends on having a consistent 60Hz electric field. But often that is not the case and what works one day will not work the next, as circuits are activated or deactivated. Just have to try and see. Another approach is to use two plates or interdigitated wires, one driven by something like a 555 timer at some frequency, like 100 Hz, and the other configured as above with a leakage path. When a third plate in the form of a hand links the two, the signal is coupled across. Have to adjust sensitivity to a threshold that is crossed when the hand is present.

    The QT sensors used a different principle, Q stands for charge, and T stands for transfer. A switch to a voltage source first charges up the capacitor formed by the plate + unknown body in relation to the rest of the universe, and then that first switch opens and a second switch closes that transfers the charge to a reference capacitor. The unknown capacitance or presence of the body is measured by the rate of charge transfer. It can be done on a Stamp, but requires external parts. Other chips now integrate QT switches or similar techniques for touch pad scanning.
  • alnajjar1alnajjar1 Posts: 110
    edited 2013-03-23 13:26
    Thanks for your understanding a careful explanation. The 60Hz makes a lot of sense and explains the erratic behavior of the BS2. I will try the QT chip to see of if that gives better results. The other main problem is creating a capacitance plate that is some 9" sq. that is back-lit and 1/4: think. That means I can't cover much of the translucent surface and have to stick to the edges only. Smaller surfaces are easier, but as the area increases, I get substantially (square) less sensitivity.

    I may have to figure out an IR method or even a mechanical switching, each of which presents significant challenges as well.

    many thanks again,

    Al
  • ercoerco Posts: 20,257
    edited 2013-03-23 14:44
    How about fine-mesh metal screening for a capacitance plate? Full size that on the back of the panel. That will still let most of the light through and likely be unnoticeable.
  • alnajjar1alnajjar1 Posts: 110
    edited 2013-03-23 17:50
    Wouldn't I need to have the mesh on both sides? How could one mesh create a capacitive plate? I can see how the electric field/charges can change on the mesh but would that be sufficient to trigger the BS2? Make has a demo on making a 3D sensor with 3 AL foils hooked to an Adruino. It looks fascinating, but I am not sure the BS2 can do that?
  • ercoerco Posts: 20,257
    edited 2013-03-23 20:28
    I was referencing a single capacitive plate, as I mentioned in your other thread. The PicAxe referenced there can read a metal plate or mesh, insulated from direct touch through your quarter-inch plex.
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2013-03-24 12:34
    In the scheme that uses passive pickup up 60Hz AC fields, the mesh is one plate, and the childs hand is the other plate. The child's entire body forms a third capacitor in series in relation to electric fields in the the local universe.

    I should add that your BASIC Stamp might want to be well grounded to the ground prong of an outlet. That would give it a stable reference point to the local electric fields.
  • alnajjar1alnajjar1 Posts: 110
    edited 2013-03-24 13:50
    Thanks Erco and Tracy, I will try the mesh idea and report back.
  • ercoerco Posts: 20,257
    edited 2013-03-24 17:44
    No grounding necessary using an M2... http://www.youtube.com/watch?v=_11hcEvfICs
Sign In or Register to comment.