Shop OBEX P1 Docs P2 Docs Learn Events
Capacitive Touch Buttons on the QuickStart — Parallax Forums

Capacitive Touch Buttons on the QuickStart

lonesocklonesock Posts: 917
edited 2012-05-17 08:18 in Propeller 1
Hi, All.

I was trying to get the little touch buttons on the QuickStart to work when reliably covered with a thin sheet of plastic. However the PCB seems to be set up as resistive touch sensors, not capacitive. So, what I did was just pair them up and connect a 1 MOhm resistor between adjacent pairs (so one resistor for 2 pads) by jumpering P0 and P1 with a resistor using the little header up top (P2 & P3, etc.). The resulting schematic looks like this:

[Sense0]--P0--/\/\/\/--P1--[Sense1]

If I want to read [Sense0], I force P0 high, P1 low, then tristate P0 and time how long it takes to go low bleeding the cap through the resistor. Then I switch pin functions to read [Sense1]. If the capacitance of the pad is ~15pF, and the capacitance of my finger is ~0.5pF, I expect about a 3% change in counts. Note, I just start a PASM cog to do the timing for me, then it exits. Code attached.

Jonathan

Comments

  • RaymanRayman Posts: 14,829
    edited 2012-05-16 20:33
    interesting idea... Does it work?
  • lonesocklonesock Posts: 917
    edited 2012-05-16 22:16
    Yep, seems to. I'm getting clocks on the order of 1500 jumping to about 1650 when my finger is over the pad, with a plastic bag (not sure of the material) between me and the pad. (The resistive mode registers no change.) I need to figure out a nice clean way of auto-determining the threshold (tracking with humidity and temperature changes, etc.), then crank out a little demo.

    Jonathan
  • Mike GreenMike Green Posts: 23,101
    edited 2012-05-17 08:18
    Here are some capacitive touch sensing programs I posted in the past, one in Spin and the other in PASM.
Sign In or Register to comment.