Shop OBEX P1 Docs P2 Docs Learn Events
Reading ohm values — Parallax Forums

Reading ohm values

Series8217Series8217 Posts: 16
edited 2006-08-02 21:03 in BASIC Stamp
I would like to use my BS2p to read resistance-based temperature, fuel level and oil pressure sensors on a car engine. These are one wire sensors that are self grounded to the engine block so the BS2p would have to be able to measure resistance through a pin to ground. What's the easiest way to do this?
The temperature sensor resistances are generally 100 ohms (low temp) - 100k ohms (high temp) and the fuel level is from 0 ohms (empty) to 90 ohms (full).
I do have some ADCs if that helps, though I have never used them before so I'm not sure what sort of circuitry is required.
I don't need more accuracy than what would put the range of the sensor into a byte.

Comments

  • Bruce BatesBruce Bates Posts: 3,045
    edited 2006-08-01 07:15
    Series8217 -

    Take a look at the PBASIC RCTIME command, which should give you the facility for what you're looking to do. Both the PBASIC Help file, and the PBASIC Reference Manual have excellent examples and descriptions of how the RCTIME command can be used.

    Unlike many simpler PBASIC Commands, you will need to study this rather sophisticated command, and how there are different circuits which can be used to structure the necassary external R-C circuit. It may also take a moment for you to realize how TIME (the result provided by RCTIME) is related to the variable external resistance via that R-C circuit.

    Please pay CAREFUL attention to the necessity for the specific series of instructions which must be used in order, to effect a proper result. You (the progrmmer) are responsible for charging or discharging the capacitor (as may be appropriate) used in the external circuit.·Once you've used RCTIME a couple of times, the entire thing will almost become second nature, and many of your ADC's may end up gathering dust!

    It probably goes without saying, but the precision (1%, 5%, 10%, etc) of the external components will effect the accuracy of the final results. You have no control over the resistance (the gauges) but you do have control over which capacitor you use.

    Regards,

    Bruce Bates
  • Series8217Series8217 Posts: 16
    edited 2006-08-02 05:37
    Thank you, Bruce! I missed that function when browsing through the manual. I'll give it a try.
  • Series8217Series8217 Posts: 16
    edited 2006-08-02 21:03
    Ok I got it to work. I had to add a 4.6k ohm resistor in series with my sensor to bump the resistance accross the capacitor up higher than it was with the sensor alone. The BS2p couldn't charge the capacitor up to 5V otherwise (actually it still doesn't, but its close enough for how "accurate" the sensor has to be).
Sign In or Register to comment.