RCTime Touch Sensor
kelvin james
Posts: 531
I can't remember if anyone has suggested this before, so i figured i would post it anyway. It is just a simple way to make a touch switch using the rc circuit and an additional lead.
Basically, when the sensor lead is touched, it changes the normally constant value being read by rctime from the resistor and capacitor combination. That change in value is used to trigger an event.
To get the proper resistor and cap values is from experimenting, though there is a mathematical approach explained in the rctime syntax. I used a 10nf ceramic cap, and a 47k resistor to give a fair, but not large resolution.
The sensor lead itself is a resistor with one end inserted into a piece of conductive foam. It could be just a wire by itself, or attatched to anything conductive.
The constant value of the circuit seems to drift a bit after a period of time, but if the sense threshold is kept fairly wide, it should not matter.
**
Basically, when the sensor lead is touched, it changes the normally constant value being read by rctime from the resistor and capacitor combination. That change in value is used to trigger an event.
To get the proper resistor and cap values is from experimenting, though there is a mathematical approach explained in the rctime syntax. I used a 10nf ceramic cap, and a 47k resistor to give a fair, but not large resolution.
The sensor lead itself is a resistor with one end inserted into a piece of conductive foam. It could be just a wire by itself, or attatched to anything conductive.
The constant value of the circuit seems to drift a bit after a period of time, but if the sense threshold is kept fairly wide, it should not matter.
**
' {$STAMP BS2} ' {$PBASIC 2.5} ' {$PORT COM1} result VAR Word Test: HIGH 0 ' charge the cap PAUSE 1 RCTIME 0, 1, result ' measure RC discharge time DEBUG DEC ? result ' display result PAUSE 500 IF result > 340 OR result < 318 THEN DEBUG " TOUCH DETECTED ",CR END ELSE : GOTO test ENDIF
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Timothy D. Swieter, E.I.
www.brilldea.com - Prop Blade, LED Painter, RGB LEDs, uOLED-IOC, eProto for SunSPOT, BitScope
www.tdswieter.com
Perhaps this could be adjusted just a little bit to become a primitive lie detector?
(IIRC, Galvanic skin response.) Could be a fun project.
OBC
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?
Check out: Protoboard Introduction , Propeller Cookbook 1.4 & Software Index
Updates to the Cookbook are now posted to: Propeller.warrantyvoid.us
Got an SD card connected? - PropDOS