|
|
| Author |
Message |
GTBecker
Joined: 18 Jan 2006
Posts: 457
Location: Cape Coral
|
|
Posted: 26 January 2010, 18:11 PM Post subject: Joystick touch sensing |
|
|
I want to detect when a small joystick is touched or grabbed. I'm working on a differential-pulse-delay method, in essence a capacitance sensor.
Has anyone succeeded with touch detection schemes? |
|
| Back to top |
|
 |
Don_Kirby
Joined: 15 Oct 2006
Posts: 329
Location: Long Island, New York
|
|
Posted: 27 January 2010, 2:25 AM Post subject: |
|
|
| Have you looked at the QT series from Atmel? |
|
| Back to top |
|
 |
GTBecker
Joined: 18 Jan 2006
Posts: 457
Location: Cape Coral
|
|
Posted: 27 January 2010, 3:46 AM Post subject: |
|
|
| Don_Kirby wrote: | | Have you looked at the QT series from Atmel? |
Yes, and the AD7746. Both are way overkill for what I want to do.
I whipped up a pulse race into a 74HC74 that seems to work well so far. It takes just a few components and a D-flop to compare two paths of a processor-generated pulse. It even shows hysteresis and is pretty sensitive.
Note that my finger is not touching the isolation capacitor lead once the LED fires here. http://rightime.com/images/Misc/Touch.asf That can't be but a few picofarad coupling. |
|
| Back to top |
|
 |
twesthoff
Joined: 17 Mar 2006
Posts: 191
Location: Fredericksburg, VA
|
|
Posted: 27 January 2010, 15:44 PM Post subject: Joystick touch sensing |
|
|
Tom,
How sensitive does it need to be? If you have a couple of pins on the processor available, put a square wave on one as an output, and the other as an input (protected with a zener diode) and put the leads near each other. When your hand touches both leads, you should be able to read a signal on the input pin. Try different frequencies.
Tom W.
On 1/26/2010 10:46 PM, General wrote: | Quote: | Don_Kirby wrote: Have you looked at the QT series from Atmel?
Yes, and the AD7746. Both are way overkill for what I want to do.
I whipped up a pulse race into a 74HC74 that seems to work well so far. It takes just a few components and a D-flop to compare two paths of a processor-generated pulse. It even shows hysteresis and is pretty sensitive.
Note that my finger is not touching the isolation capacitor lead once the LED fires here. http://rightime.com/images/Misc/Touch.asf That can't be but a few picofarad coupling.
Tom
|
|
|
| Back to top |
|
 |
GTBecker
Joined: 18 Jan 2006
Posts: 457
Location: Cape Coral
|
|
Posted: 27 January 2010, 16:49 PM Post subject: |
|
|
> ... When your hand touches both leads...
I could do that but it requires two leads to a split contact area. The joystick I'm using has a metallic stick tip so a single flexible conductor to it through the X/Y gimbal seems best for a single-ended solution - either capacitive or field sensing, like detecting ambient powerline hum or the vertical electric field. Since the application is recreational marine, though, hum detection won't work and the vertical gradient, a very high-impedance solution, likely wouldn't be reliable in dampness. |
|
| Back to top |
|
 |
twesthoff
Joined: 17 Mar 2006
Posts: 191
Location: Fredericksburg, VA
|
|
Posted: 27 January 2010, 17:20 PM Post subject: Joystick touch sensing |
|
|
I didn't know any details of your application until now. It depends on if you want to use a dedicated chip to do the sensing, or as I had thought, you wanted some simple way to make it work. Just throwing out the concept in case it gives you an idea you could use. If it will be wet or damp, that limits most resistive or conductive methods. Hope you figure out a good solution.
On 1/27/2010 11:49 AM, General wrote: | Quote: | > ... When your hand touches both leads...
I could do that but it requires two leads to a split contact area. The joystick I'm using has a metallic stick tip so a single flexible conductor to it through the X/Y gimbal seems best for a single-ended solution - either capacitive or field sensing, like detecting ambient powerline hum or the vertical electric field. Since the application is recreational marine, though, hum detection won't work and the vertical gradient, a very high-impedance solution, likely wouldn't be reliable in dampness.
Tom
|
|
|
| Back to top |
|
 |
GTBecker
Joined: 18 Jan 2006
Posts: 457
Location: Cape Coral
|
|
Posted: 28 January 2010, 21:19 PM Post subject: |
|
|
Here's a working solution.
A positive processor-generated pulse (I used a ~200Hz repeating PulseOut but a continuous PWM, or a hardware pulse source would work, too) passes through two similar RC paths, one fixed and one loaded by the joystick shaft. The pot provides for trimming the resulting loaded RC to match the fixed path. When the 74HC74 clock has risen to its threshold, the level at the D input is clocked into the latch; the pot is adjusted so the D input level is just above its threshold, so the latch Q output is normally high and /Q, pin 6, is latched low. When the joystick is touched the additional capacitance yields a longer RC period for that path so the D input pulse is delayed and is below its threshold when the clock latches it; Q is then low and /Q is latched high.
The joystick assembly I used was removed from a cheap Vex RC transmitter. It is entirely plastic except for small bearing pins and a metal control shaft that's covered with a slip-on plastic boot. I disassembled the assembly, passed a length of flexible copper braid through the gimbal and secured it under the push-in shaft and under a screw on the back, providing a connection to the shaft. The boot is non-conductive so I textured the surface a little and rubbed graphite into it; it became sufficiently conductive (I measured about 1meg end-to-end) to act as a capacitor. I suspect because of its larger surface area, in fact it is more sensitive than the metal shaft without the boot. How it will behave in dampness remains to learn, but I plan on mounting the sensitivity pot knob near the stick so it can be adjusted if required.
| Code: | const pinPulseOut as byte = 10
const pinTouched as byte = 11
const RLED as byte = 25
const LEDOn as byte = 0
const LEDOff as byte = 1
dim Touched as boolean
dim PulseTaskStack(1 to 50) as byte
sub Main()
call sleep(0.5)
call putpin(pinTouched, zxInputPullup)
calltask "PulseTask", PulseTaskStack
do
if Touched then
call putpin(RLED, LEDOn) ' LED on
else
call putpin(RLED, LEDOff) ' LED off
end if
loop
end sub
sub PulseTask()
do
call pulseout(pinPulseOut, 20.0e-6, 1) ' 20uS positive pulse
call sleep(0.005) ' pulse at ~200Hz
' test touch latch after delay since the latch glitches briefly after pulse
if cbool(getpin(pinTouched)) then ' if touch
Touched = True
else
Touched = False
end if
loop
end sub
|
Boot partially removed shows braid connection.
 |
|
| Back to top |
|
 |
GTBecker
Joined: 18 Jan 2006
Posts: 457
Location: Cape Coral
|
|
Posted: 29 January 2010, 17:21 PM Post subject: |
|
|
Not surprisingly, the graphite didn't take long to wear off and become less effective, so last night I repeatedly dipped the plastic joystick boot in Rustoleum Cold Galvanizing Compound, a fine zinc dust in a thin epoxy resin, allowing it to briefly dry between coats and thoroughly dry overnight. The result, the product data says, is a 93% zinc coating.
The resistance of the coating is higher than I can measure but it, nevertheless, works. We'll see if this is more durable. |
|
| Back to top |
|
 |
GTBecker
Joined: 18 Jan 2006
Posts: 457
Location: Cape Coral
|
|
Posted: 20 March 2010, 20:04 PM Post subject: |
|
|
A few months later: the plastic-booted joystick has been replaced with a brass one, turned by a friend with a lathe. Its conductivity makes touch sensing much easier, requiring less sensitivity and producing more positive control. Overall, the scheme works well so far.
Here is the completed device, a Bluetoothed vibrating joystick:
 |
|
| Back to top |
|
 |
twesthoff
Joined: 17 Mar 2006
Posts: 191
Location: Fredericksburg, VA
|
|
Posted: 20 March 2010, 20:19 PM Post subject: Joystick touch sensing |
|
|
Beautiful job Tom...
On 3/20/2010 4:04 PM, General wrote: | Quote: | A few months later: the plastic-booted joystick has been replaced with a brass one, turned by a friend with a lathe. Its conductivity makes touch sensing much easier, requiring less sensitivity and producing more positive control. Overall, the scheme works well so far.
|
|
|
| Back to top |
|
 |
GTBecker
Joined: 18 Jan 2006
Posts: 457
Location: Cape Coral
|
|
Posted: 21 March 2010, 19:22 PM Post subject: |
|
|
Thanks. It is nice when something builds well.
One downside of the brass stick, I'm realizing, is that the vibration sensation is significantly reduced by the much-larger stick mass. I might need to relocate the vibrator motor to better couple it to the stick.
Maybe aluminum next time, too. |
|
| Back to top |
|
 |
|