Conversion
Lizzy1118
Posts: 3
I created a Program in Basic Stamp which has to be used to run a FlexiForce Sensor...I need to know how can I convert the output from time to force???
Comments
If you're referring to the use of RCTIME to measure the resistance of the sensor where RCTIME provides a time value, you'll have to calibrate your system using test weights. The BASIC Stamp Syntax and Reference Manual discusses the use of RCTIME to measure resistance and shows how the resistance can be calculated from the capacitance used and the time measured. Look at this article from the manufacturer's FAQs. In addition to using curve fitting to get an equation for force vs. resistance, you can use the Stamp's LOOKDOWN statement.
Code:
' {$STAMP BS2}
' {$PBASIC 2.5}
time VAR Word
sensorPin CON 15
DO
HIGH sensorPin
PAUSE 100
RCTIME sensorPin,1,time
DEBUG HOME, "time = ", DEC5 time, CR
IF time>10 THEN
HIGH 14
PAUSE 500
ELSE
LOW 14
PAUSE 500
ENDIF
LOOP
The program objective is detect the force applied on a flexiforce sensor, if the force applied is greater than the number assigned then power on a LED, I need to convert the RCTIME into force.