| Author |
Message |
nigelmercier
Joined: 03 Nov 2009 Posts: 1 Location: United Kingdom
|
03 Nov 2009 18:24 Measuring resistance with a PIC microcontroller? |
|
|
|
|
I want to make a replacement fuel gauge display for a boat, using a PIC microcontroller.
The sensor is a variable resistor activated by a float in the fuel tank; one terminal is connected to the 0V rail (although it may be possible to isolate it if necessary). The resistance of the sensor is to to be verified, but is likely to be either 0 Ohm to 180 Ohm, or 0 Ohm to 300 Ohm.
The existing display is a moving coil meter in series with the sensor and the 12V rail.
What would be the best way to use the existing sensor?
|
|
| Back to top |
|
 |
kender
Joined: 19 Jun 2005 Posts: 1231 Helped: 88 Location: Stanford, SF Bay Peninsula, California, Earth, Solar System, Milky Way
|
03 Nov 2009 18:45 Re: Measuring resistance with a PIC microcontroller? |
|
|
|
|
Here's a couple of pic-friendly methods for resistance measurement.
- Make a voltage divider consisting of the variable resistor (sensor) and a fixed resistor. Measure the voltage at the center of the divider with ADC.
- Run constant current through the sensor. Measure the voltage on the high side of the resistor with an ADC. You'll need a constant current source circuit.
Since the sensor resistance is relatively small, you may need to amplify the voltage before the ADC.
I guess, the existing meter is an ampere-meter in disguise. Constant voltage is applied across the level sensor resistance changes. The current varies linearly with resistance, which in turn varies with liquid level. Probably, the resistance of the ampere-meter is negligible.
|
|
| Back to top |
|
 |
glenjoy
Joined: 01 Jan 2004 Posts: 1028 Helped: 47 Location: Philippines
|
03 Nov 2009 23:08 Measuring resistance with a PIC microcontroller? |
|
|
|
|
| To amplify it, you need to design a good instrumentaion amplifier.
|
|
| Back to top |
|
 |
Google AdSense

|
03 Nov 2009 23:08 Ads |
|
|
|
|
|
|
| Back to top |
|
 |
kender
Joined: 19 Jun 2005 Posts: 1231 Helped: 88 Location: Stanford, SF Bay Peninsula, California, Earth, Solar System, Milky Way
|
04 Nov 2009 2:50 Re: Measuring resistance with a PIC microcontroller? |
|
|
|
|
| glenjoy wrote: |
| To amplify it, you need to design a good instrumentaion amplifier. |
InAmp and Kelvin connection to the sensor, is more accurate approach to a measurement like this. But if some error is tolerated, say 1% then, a simpler connection with a resistor referenced to common ground could work too. 1% translates to 2Ω for resistance of the wires, or about 100m of 18AWG wire.
|
|
| Back to top |
|
 |