Interfacing old car fuel gauge

Thread Starter

ucf_pirate

Joined Jul 24, 2006
2
I've got a project that I'm working on. I've got ahold of an old car fuel gauge and I want to interface it to a PIC microcontroller to display. The fuel gauge is set by resistance, 10 ohms at the low end and 90 ohms at the high end (@ 12V). I'm wondering how you all would do this... So far, I've come up with a couple ideas such as directly driving transistors with stacked resistances which when all on, equal the full or using an LM3914 with the microcontroller driving the signal and different resistances on the outputs. The problem is that there is a hefty amount of components required to do this. Anyone got a better idea on how to go about this?
 

beenthere

Joined Apr 20, 2004
15,819
Hi,

Your PIC should have an A to D converter built into it. If not, get a better version. Put a voltage across the fuel gauge and send the pickoff voltage to the A to D.
 

n9352527

Joined Oct 14, 2005
1,198
Shouldn't he need a DAC instead of an ADC? I think he wants to drive the gauge with a PIC instead of reading the gauge.

A DAC is certainly easier to work with, but if you really want to save cost and your PIC doesn't have a DAC, then you could use the PIC to generate a PWM signal. Smooth the signal with a simple filter (RC) and then connect to the gauge. You'd probably need to use a series resistor to set the maximum range.
 

Thread Starter

ucf_pirate

Joined Jul 24, 2006
2
Thanks for the suggestions, but you're right; I've thought about using an DAC with the LM3914. I think I've solved it by using a transistor and the PWM output on a PIC 18F2320. A TIP31C transistor modulates the 12V and 10 ohm resistor to create an "empty" gauge effect when the PWM is at full value and then decreasing the pwm value slowly moves the gauge from empty to full. Seems like it's working, although the PWM cycling frequency has to be very high (40-50khz) so that no needle bob shows.
 
Top