Shop OBEX P1 Docs P2 Docs Learn Events
Capacitive switch circuit — Parallax Forums

Capacitive switch circuit

metron9metron9 Posts: 1,100
edited 2008-01-14 08:16 in BASIC Stamp
·I am·testing·an idea of using a capacitor RC circuit for a 30 minute timer to wake up a processor. Testing the voltage leakage using a .01uf capacitor with no resistor to allow the capacitor to discharge only through the input pin is unknown right now as it is over 900 seconds as·I write this. However a new idea I got while touching the leads and thus stopping the timer (discharging the .01 cap) i realized a simple one capacitor touch switch can be made. When you touch the leads the pin can not hold a charge for more than a second, perhaps as little as a few miliseconds, not sure yet.

To use it as a capacitive switch simply charge the cap, wait 1/2 second and test if it is high. If not then someone has their finger on the leads. If it is high, at some point it will go low when the cap finally discharges, simply charge it up again and test if it holds a charge.

I looked at about 4 schematics·that used·all kinds of components used for capacitive switches but I have yet to see one with only 1 capacitor used for the circuit so·I thought it was pretty cool, so give it a try.

I know it is not really a capacitive switch but·I don't know what to call it.

·

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Think Inside the box first and if that doesn't work..
Re-arrange what's inside the box then...
Think outside the BOX!

Post Edited (metron9) : 1/13/2008 7:38:34 AM GMT

Comments

  • Tracy AllenTracy Allen Posts: 6,667
    edited 2008-01-13 20:14
    I think the leakage could go either way, either to discharge the capacitor or to charge it up. The leakage current depends on both the pmos and nmos leakage, as well as temperature, and also critically on circuit board layout, cleaness, and humidity. The effect of touching it the node with a finger might vary too.

    You could make a touchpad with two contacts or interdigitated contacts with one side to the input pin and the other side to ground, so that the finger would bridge the gap reliably. But do include a resistor over to the pin to protect the pin from static discharge. And the contacts would have to remain pretty clean, I think. Moisture or gunk could effectively short circuit the path.

    I've use that sort of circuit and PBASIC with things like rain gages. www.emesys.com/OWL2rain.htm. The capacitor acts as a short term memory for infrequent, short events.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-01-13 20:31
    If you're using a micro, like the Tiny13, that has a built-in A/D, it would be a simple matter to connect two pins to adjacent PCB pads, toggle one of them multiple times in rapid succession, and measure the impressed voltage on the other pin between toggles. The change in voltage, correlated to the toggling, will be a measure of the coupling (capacitive or resistive) between the two pins. To eliminate the resistive component, you can cover the pads with soldermask or an adhesive-backed plastic film.

    I've seen a variant of this technique used in a cheap electronic fish scale. In this case the coupling was mediated by a capacitive load cell which sandwiched a (barely) moving central sending plate between two outside receiving plates. The two received signals were sampled differentially to determine the weight of the suspended fish.

    -Phil
  • Tracy AllenTracy Allen Posts: 6,667
    edited 2008-01-14 08:16
    The effect can be seen even without an ADC or external capacitor. Start with pins p1 and p0 not connected to anything at all, then following program will elicit a sequence of 101010... The signal is read from floating p1 when p0 is toggled up and down. The coupling comes from the internal capacitance between the pins. A finger touched to p1 can disturb the coupling, either by grounding it out, or by coupling in external AC fields.
    DO
      HIGH 0
      DEBUG BIN1 in1
      LOW 0
      DEBUG BIN1 in1
    LOOP
    


    With an ADC, I agree, it could become very sensitive. I think that is the principle behind "capacitance to digital converters" like the AD7143. The excitation is applied to one half of the button or keypad slider or wheel, and the capacitive elements each go to an ADC pin to be read in round robin fashion. Touch disturbs the field and the chip decodes the point where the touch occurred. The chip makes it pretty simple, and the hardest part it takes care of is the self=calibration and adaptation to changing environment. One chip, some patterns on a PCB, and the microcontroller, that's all it takes for some fancy i/o.

    The qprox devices use a slightly different principle, where the external capacitance itself becomes part of a switched capacitor ADC.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
Sign In or Register to comment.