Shop OBEX P1 Docs P2 Docs Learn Events
Force sensor help — Parallax Forums

Force sensor help

rrrr Posts: 63
edited 2007-11-30 03:34 in BASIC Stamp
Hello,
·
·
I have a force sensor that·I am trying to use in a project. It is basically just a variable resistor, when you touch it lightly it measures about 1M Ohms and as you press harder it goes all the way down to about 1K Ohms. What is the best way to get data from this sensor into my stamp (OEM BS2)?·I tried an RC time circuit with a .01 cap and it seems like it doesn’t measure well. One of the problems is that the data received·is more than a Word variable can handle. Anyone got any ideas how to do this right.
·
·
Thanks for the help.
rr
·

Comments

  • sdysdy Posts: 40
    edited 2007-11-30 01:48
    Use an A/D to measure a voltage drop across it.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-11-30 03:34
    RCTIME is more than adequate for such a task. I tried it myself with a similar force sensor (>2M max resistance), and it works fine. The trick is to put a 100K resistor in parallel with the sensor leads, as the attached schematic shows. Here's the code I used to test it:

    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    
    io    PIN 0
    
    value VAR Word
    
    DO
      HIGH io
      PAUSE 7
      RCTIME io, 1, value
      DEBUG DEC value, CR
    LOOP
    
    
    



    It's relatively insensitive to an extremely light touch, though. If you need that extra sensitivity, you can use a higher-value parallel resistor and a smaller cap to keep your values in range.

    -Phil
    320 x 140 - 1K
Sign In or Register to comment.