Interfacing old car fuel gauge

Discussion in 'The Projects Forum' started by ucf_pirate, Jul 24, 2006.

  1. ucf_pirate

    Thread Starter New Member

    Jul 24, 2006
    2
    0
    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?
     
  2. beenthere

    Retired Moderator

    Apr 20, 2004
    15,815
    282
    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.
     
  3. Gadget

    Distinguished Member

    Jan 10, 2006
    613
    0
    even the basic 4 bit A-D converter on some low end PICs, is gonna have a little more resolution than an LM3914
     
  4. mrmeval

    Distinguished Member

    Jun 30, 2006
    833
    2
  5. n9352527

    AAC Fanatic!

    Oct 14, 2005
    1,198
    4
    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.
     
  6. ucf_pirate

    Thread Starter New Member

    Jul 24, 2006
    2
    0
    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.
     
Loading...