PIC - resistance

Discussion in 'Embedded Systems and Microcontrollers' started by wcavanagh, Aug 27, 2007.

  1. wcavanagh

    Thread Starter New Member

    Aug 27, 2007
    Hi people,
    New round here, and after some help from you lovely people. Working on a small project for the car, and new on the PIC front. What I need is the following.

    To have a kind of lookup table that will take a resistance at the input, and output a different resistance depending on the input resistance. Hope that makes sence.


    10 Ohm ----- 25 Ohms
    20 Ohm ----- 40 Ohms
    30 Ohm ----- 65 Ohms

    Basicly I am taking a reading from an LPG guage that has a range of 10 - 200 Ohms, depending on how full the tank is, and interfacing this with the cars petrol guage that runs on a different range, yet to find out.

    I was thinking of using a 12F675 as I have a few of these nocking around. Any help would be tops.

  2. beenthere

    Retired Moderator

    Apr 20, 2004
    You really can't output a resistance as such. I take it that you are trying to make your car's fuel gauge do double duty and indicate LPG as well as gasolene?

    You could let the PIC read in the LPG sensor and translate it by a lookup table, but the output might have to be a control signal to a digitally controlled potentiometer. Then I suppose you could switch the gas gauge to the DCP and have it indicate the LPG quantity.
  3. wcavanagh

    Thread Starter New Member

    Aug 27, 2007
    Yep thats exactly what I was thinking. I have the switching circuit sorted so can feed the cars guage either data from the petrol sender, or the new PIC. Yep, was thinking DigPot to do the output, but have never used them before.
  4. Art

    AAC Fanatic!

    Sep 10, 2007
    So with these fixed three values you're looking at a meter that only shows three fixed levels?
    ie low medium full.

    Your pic IO pin output is eith on or off, that's right, but you can switch a transistor
    with a pic pin that in turn switches the signal line through a resistor.
    add another two resistors and transistors and you can route the signal
    through any of three resistors, and by now you can have more values by turning on
    more than a single transistor at one time.

    But by that development stage you might have implemented a digital pot at
    the output, and used all available digital pic pins as input through resistors,
    or a sinle analogue input.