Alternative mode for the QuickStart touch buttons
Phil Pilgrim (PhiPi)
Posts: 23,514
I've discovered that, if you cover the touch buttons with a thin layer of Kapton tape to insulate them completely, they still function -- sort of -- and are impervious to moisture effects. I say "sort of" because they only activate momentarily when released. But the effect is quite dependable with the stock button software. This effect appears to be capacitive in nature and unrelated to any 60 Hz e-field pickup. I can say this with some assurance, because when I place a 1/4" disk of brass shim atop one of the insulated buttons and tilt the board to let it slide off, the LED flashes when it slides off.
Perhaps this phenomenon could be accentuated by a software modification and harnessed for a different kind of button response.
-Phil
Addendum: To increase the reliability of this effect, it's helpful to increase the wait time to 1/20th sec and decrease COUNT to 8.
Perhaps this phenomenon could be accentuated by a software modification and harnessed for a different kind of button response.
-Phil
Addendum: To increase the reliability of this effect, it's helpful to increase the wait time to 1/20th sec and decrease COUNT to 8.
Comments
I did some experimenting with your idea and this code seems to detect the buttons with high reliablity.
The code turns on all LEDs when no button is sensed (so you can see if it is sensed intermittently).
Bean
I tried your program, and all eight LEDs come on, but no button touches are detected.
-Phil
That's weird. I only have one board at the moment, I wonder if it is variances in the PCB or what ???
Bean
It may have something to do with the choice of tape (dielectric+adhesive) and the environment. For me:
--2.5 mil Scotch magic tape: does not work
--3 mil Kapton film (not tape, just laid on top of pads): does not work
--3.5 mil pink polyethylene (bag the quickstart came in, one thickness: works on --p7..p4 but on p3..p0. Needs lots of pressure.
--1 mil pink polyethylene (antistat, laid on top of pads): works on p7..p5 but not p4..p0
--0.5 mil polyethylene (white translucent kitchen bag, laid on top): works on all, more pressure required on p0 than on p7.
--no insulation: works fine, sensitive on all pins.
If I'm not mistaken, your program does a simple RCtime on all the pins (like the demo) and then goes into a debounce/confirm loop when it finds one pin low. I simply don't see the physics of it. The whole thing depends on having some physical principle to move charge off of the combined capacitance of the Prop pin gate and the pcb traces. The way David intended for that to happen is supposed to be the ohms of resistance provided by your fingertip. But it could also be displacement current (capacitance) through an insulator, and that could be AC electric fields, or static electricity from your body, or charge on the plastic itself, or even perhaps piezoelectricity. Results would vary. The standard demo program does not work anything like Bean's when the 0.5 polyethylene is in place. With the standard program lights occasionally flicker.
For reliable capacitive sensing, the resistive-sensing circuit topology is not optimal. Something like the following might give better results:
Here, each button is excited by a frequency, in turn, with the capacitively-coupled signal referred to a common sigma-delta-like structure. The I/O pins are coupled to a counter with negative feedback, as with a sigma-delta ADC, but a separate counter with logic inputs is used as a synchronous detector. This would work similarly to the way my AM radio detector works, except that there's no need for quadrature detection, since we already know the phase of the incoming signal. Using synchronous detection like this should also cancel out any effects of 60 Hz e-field pickup or static electricity.
To detect a button press, you'd have to compare the incoming signal strength to a predetermined background level.
-Phil
http://www.microchip.com/en_us/technology/mtouch/
The pads on the QS board won't be suitable, although it might be possible to modify them.
The unknown capacitor (finger on pad + strays) is Cx, a small value in the pF to nF range, and CA is a much larger accumulation capacitor. Sw is a mosfet switch, for charge transfer. Cx is repeatedly charged by CPU pin p0 as a output, which then becomes an input, and then pin p1 causes Sw to close and transfer the charge on Cx over to CA. Pin p2 monitors the voltage on CA. Since CA is much larger than Cx it takes many charge transfer cycles to bring it up to threshold. The count of how many is inversely proportional to Cx. By playing with the pulse widths and spacing, it can account for leakage and soakage in Cx, factors which are important in some practical applications.
There is a writeup in the QT113 data sheet.
This technique is not applicable to the quickstart board pads, as is. I've used the technique with the SX20 chip, which was well suited to quick manipulation of the pins in firmware. The Prop could do that too, for DIY simple capacitive buttons.
-Phil