# Fuel Gauge Converter

Hey guys, long time arduino fan but haven't been playing with it recently.

My project is this, i want a device that inputs a certain resistance and outputs another. I have a gas tank in my old car(260z) that is from a more modern car. The gauge on my car reads 90ohms(empty) to 10ohms(full) but the sender in my new tank is from 33ohms(empty) to 270ohms(full)

I was able to use an ohm reading program i got online to read the ohms coming in and was able to modify it a bit to convert that value into an appropriate value for my stock car gauge.

Now i am stuck on how to output that resistance? How i do send this value to the stock car gauge? I plan to use an ATTINY85. Any help is appreciated.

CODE

int analogPin= 2;
int raw= 0;
int Vin= 5;
float Vout= 0;
float R1= 330;
float R2= 0;
float buffer= 0;
float DatOut=0;

void setup()
{

}

void loop()
{
if(raw)
{
buffer= raw * Vin;
Vout= (buffer)/1024.0;
buffer= (Vin/Vout) -1;
R2= R1 * buffer;
DatOut= ((-0.3376*R2)+101.14); //THIS IS THE OUTPUT I NEED TO SEND
}

delay(1000);
}

Digital potentiometer ?

lesson 1 in how to start a fire with electrical/electronic components: you either feed them too much voltage, or draw too much current through them........

O.P. you shouldn't focus on the resistance, but on the current. try and research on how your driven element (the fuel gauge, not the sending unit) works.

Not sure what you mean? It's all 5v system on the fuel sending unit and gauge. Fuel sending unit is a variable resistor and gauge sends 5v and it moves according to how much it receives back?

The gauge on my car reads 90ohms(empty) to 10ohms(full) but the sender in my new tank is from 33ohms(empty) to 270ohms(full)

Are you sure this is right?

It seems the old fuel sender had it's lowest resistance when the tank was full, whereas the new one does the opposite...

Allan

edit:

I don't know about the 260z, but a lot of old cars had a bimetallic strip in the gauge, heated by a resistor.

If yours is like this a mosfet such as a 2N7000 with a resistor of 10 ohms to the gauge, driven by pwm from the arduino would work fine.

Yeah most manufacturers have their own standard range. These are two completely different ones and different century:)

What #2 was trying to point out is the gauge is an ammeter and the series variable pot acts to vary this current.

Try this.
Voltage divider with fuel sender between Ain and ground, and a ~180ohm resistor between Ain and +5volt.
Map the calculated analogue values of both extremes of the sender to two PWM values.
PWM a mosfet with that (source to sender ground, drain with 10ohm in series to fuel meter).
! Never tried this, and untested sketch.
Leo..

``````const byte gatePin = 4;
int fuelValue;

void setup() {
pinMode (gatePin, OUTPUT);
}

void loop() {
fuelValue = map(analogRead(A0), 158, 614, 33, 255);
analogWrite(gatePin, fuelValue);
}
``````