Maker Pro
Maker Pro

Volts to ohms for fuel sender

hevans1944

Hop - AC8NS
Jun 21, 2012
4,880
Joined
Jun 21, 2012
Messages
4,880
This kind of question has been asked a few times. I think it is based on the (mis?)conception that a true resistor is required to operate this kind of gauge.

Has anybody considered Adam's post #7? ...
I did consider it, and @Alec_t's post#13 (LM3914 bar-graph driver) too. It is quite likely that the commercial fuel gauge, which does display fuel levels on an LED bar-graph, uses an LM3914 to perform its function. I was under the misinformed impression that the fuel-gauge was an analog meter movement. So it is probably very feasible to convert an analog output from an ultrasonic-based fuel-level sender to a range of voltages that the instrumentation fuel gauge will interpret correctly. However, without the gauge in-hand or a schematic of its internal construction, some experimentation would be required.

If the OP wants to experiment, it may turn out that a simple op-amp is all that is required. Or, depending on the source impedance of the voltage sender, perhaps just a resistor divider to scale the output of the sender. If linearization is desirable or required (I doubt that it would be) a few diode-resistor networks in the feedback path of a cheap op-amp will do that in a piece-wise linear fashion.

... I'm pretty sure the gauge doesn't really "measure" the resistance. Either:
  • It sends a constant current to the load and measures the voltage drop. Although I acknowledge that this is a way of measuring resistance, what counts is the voltage drop (that's how multimeters work).When you connect a voltage source that is capable of sinkingthe sense current while maintaining a stable and controllable output voltage, you can control the display of the gauge by setting the appropriate voltage.
  • It outputs a (not necessarily constant) voltage to the load and senses the current that flows. Imho this is less common, but technically easily done. In this case a current source can be connected to the gauge's sensor input and the current needs to be controlled by the output voltage of the fuel sender. This is easily done by a volteg controlled current source (1 opamp required). ...
Yes, it has to be a voltage source or a current source to determine resistance. If I were guessing, it's just an internal resistive divider connected between the battery supply and ground. The external variable-resistance sender is connected across one of the internal resistors and causes the divider ratio to change. But we don't know the details of that, or what the end-user does to select a 200 to 33 ohm range versus a 73 to 10 ohm range or what is required to select a custom range. That last part, custom range, offers hope for a simple solution where the voltage sender can just be connected directly to the fuel gauge! Sure would be nice to know more about the actual fuel gauge before trotting off to explore more complicated solutions.

... Depending on the accuracy required it may make sense to insert a small microcontroller between fuel sender and volteg/current source to linearize the characteristic, allowing for a more accurate display of fuel level by the gauge. However, inmy experience fuel gauges aren't among the most precise instruments anyway, so a rough trimming (without a microcontroller) for reasonable display of empty and full may be sufficient. Any fuel level in between wil be approximated. A driver normally gets a feeling for the quirks of the fuel gauge of his vehicle anyway.
I agree 100% with this philosophy. When I was riding motorcycles I always kept an eye on my trip odometer to "gauge" how much fuel was left in the tank because my Honda ACE didn't have a fuel gauge. However, if that "odometer fuel gauge" failed there was the "reserve" tank that would (hopefully) get me to the nearest gas station if the engine ran out of fuel during a run. Problem with relying on the reserve is the selection valve must be restored to its normal position after re-fueling. Forget to do this and the next time you have to switch to the reserve you will find you have been running on reserve all the time and the gas tank is now truly empty. Embarrassing.

Hop
 

Gryd3

Jun 25, 2014
4,098
Joined
Jun 25, 2014
Messages
4,098
I did consider it, and @Alec_t's post#13 (LM3914 bar-graph driver) too. It is quite likely that the commercial fuel gauge, which does display fuel levels on an LED bar-graph, uses an LM3914 to perform its function. I was under the misinformed impression that the fuel-gauge was an analog meter movement. So it is probably very feasible to convert an analog output from an ultrasonic-based fuel-level sender to a range of voltages that the instrumentation fuel gauge will interpret correctly. However, without the gauge in-hand or a schematic of its internal construction, some experimentation would be required.

If the OP wants to experiment, it may turn out that a simple op-amp is all that is required. Or, depending on the source impedance of the voltage sender, perhaps just a resistor divider to scale the output of the sender. If linearization is desirable or required (I doubt that it would be) a few diode-resistor networks in the feedback path of a cheap op-amp will do that in a piece-wise linear fashion.


Yes, it has to be a voltage source or a current source to determine resistance. If I were guessing, it's just an internal resistive divider connected between the battery supply and ground. The external variable-resistance sender is connected across one of the internal resistors and causes the divider ratio to change. But we don't know the details of that, or what the end-user does to select a 200 to 33 ohm range versus a 73 to 10 ohm range or what is required to select a custom range. That last part, custom range, offers hope for a simple solution where the voltage sender can just be connected directly to the fuel gauge! Sure would be nice to know more about the actual fuel gauge before trotting off to explore more complicated solutions.


I agree 100% with this philosophy. When I was riding motorcycles I always kept an eye on my trip odometer to "gauge" how much fuel was left in the tank because my Honda ACE didn't have a fuel gauge. However, if that "odometer fuel gauge" failed there was the "reserve" tank that would (hopefully) get me to the nearest gas station if the engine ran out of fuel during a run. Problem with relying on the reserve is the selection valve must be restored to its normal position after re-fueling. Forget to do this and the next time you have to switch to the reserve you will find you have been running on reserve all the time and the gas tank is now truly empty. Embarrassing.

Hop
I'm all for using a bar-graph driver.... but as far as correcting for non-linear output of the sensor, you would need to calibrate it to the shape of the tank. If you are selling the product, you may need a different 'map' for different models.
It would be nice though... I have a bar display on my bike, and the first bar or two gets me 90-110km, Considering there are 8 bars, and I have only ever gotten 230km on my bike on a single tank, it's gross how fast the remaining bars drop... to the inexperienced, an odometer reading of 100k and a 3/4 full tank looks great! Too bad that last "3/4" dries up so fast.
 

hevans1944

Hop - AC8NS
Jun 21, 2012
4,880
Joined
Jun 21, 2012
Messages
4,880
And now i wonder why no one has mounted motorcycle fuel tanks on miniature load cells. This arrangement would not be sensitive to volume variations as a function of depth, as float-based or ultrasonic-based transducers are. Measuring the weight of the fuel remaining in the tank is a more accurate gauge of fuel supply.
 

Colin Mitchell

Aug 31, 2014
1,416
Joined
Aug 31, 2014
Messages
1,416
No experimenting needed.
You just create a table of 8 and divide the input voltage into 8 sections.
Then fill and empty tank as see when the first LED comes on. Change the table value and start again.
Continue until all 8 values are as required.
 
Last edited by a moderator:

Calabashmc

Jan 18, 2016
13
Joined
Jan 18, 2016
Messages
13
I'd love to do these suggestions but I am a total newb to electronics. As stated this is my first project. So detailed instructions are much appreciated!
I have some MOSFET's, some resistors and an Arduino which I bought because the dude at the electronics shop said that's what I'd need. if not I'll go buy more stuff if someone can give me a shopping list and some pics on how to put it all together. Yep, total newb.
 

Alec_t

Jul 7, 2015
3,590
Joined
Jul 7, 2015
Messages
3,590
And now i wonder why no one has mounted motorcycle fuel tanks on miniature load cells.
I suspect vehicle vibration would cause havoc with that. There might be safety issues too, with fuel tanks flopping around on hinges or springs or whatever.
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,722
Joined
Nov 17, 2011
Messages
13,722
And now i wonder why no one has mounted motorcycle fuel tanks on miniature load cells. This arrangement would not be sensitive to volume variations as a function of depth, as float-based or ultrasonic-based transducers are. Measuring the weight of the fuel remaining in the tank is a more accurate gauge of fuel supply.
I guess that's because this method would interfere with the use of "Tank rucksacks" (I beg to excuse my lack of the prope English word) and would also be sensitive to any weight put on top of the tank, e.g. a biker leaning over te tank.
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,722
Joined
Nov 17, 2011
Messages
13,722
We're all doing lots of guesswork here.
Let's re-start by getting some hard facts from @Calabashmc :
Can you do some measurements and provide the results to us?
  1. put an amperemeter (or multimeter in mA range) in series with the fuel gauge's sensor input.
  2. connect the other end of the amperemeter to a variable resistor (potentiometer) or use different resistor values for the following measurements, the other end of the resistor to ground (0V)
  3. optionally connect a voltmeter in parallel to the resistor (or from the gauge's output to ground, for this measurment it shouldn't matter). this isn't quite necesayr aas we can get V from I*R.
  4. measure voltage and current for a few different resistances in the range 0Ω...90Ω (or whatever range you've set the gauge to)

From this data we should be able to judge whether the gauge uses constant current, constant voltage or a resistive divider (as has been suggested by several posters in this thread). Once we know that, we should be better prepared to help you. Can you also post the model of the gauge? Maybe we can find a schematic for this model.
 

Calabashmc

Jan 18, 2016
13
Joined
Jan 18, 2016
Messages
13
We're all doing lots of guesswork here.
Let's re-start by getting some hard facts from @Calabashmc :
Can you do some measurements and provide the results to us?
  1. put an amperemeter (or multimeter in mA range) in series with the fuel gauge's sensor input.
  2. connect the other end of the amperemeter to a variable resistor (potentiometer) or use different resistor values for the following measurements, the other end of the resistor to ground (0V)
  3. optionally connect a voltmeter in parallel to the resistor (or from the gauge's output to ground, for this measurment it shouldn't matter). this isn't quite necesayr aas we can get V from I*R.
  4. measure voltage and current for a few different resistances in the range 0Ω...90Ω (or whatever range you've set the gauge to)

From this data we should be able to judge whether the gauge uses constant current, constant voltage or a resistive divider (as has been suggested by several posters in this thread). Once we know that, we should be better prepared to help you. Can you also post the model of the gauge? Maybe we can find a schematic for this model.
Will do - will take me a few days.
 

hevans1944

Hop - AC8NS
Jun 21, 2012
4,880
Joined
Jun 21, 2012
Messages
4,880
I guess that's becasue this method would interfere with the use of "Tank rucksacks" (I beg to excuse my lack of the prope English word) and would also be sensitive to any weight put on top of the tank, e.g. a biker leaning over te tank.
Or a young passenger riding on the tank. So, never mind! Tank rucksacks or tank saddlebags are common accessories.
 

Gryd3

Jun 25, 2014
4,098
Joined
Jun 25, 2014
Messages
4,098
I'd love to do these suggestions but I am a total newb to electronics. As stated this is my first project. So detailed instructions are much appreciated!
I have some MOSFET's, some resistors and an Arduino which I bought because the dude at the electronics shop said that's what I'd need. if not I'll go buy more stuff if someone can give me a shopping list and some pics on how to put it all together. Yep, total newb.
Let's call those good parts to have for now.
There are numerous ways to do this. You could very well use the Arduino and a single mosfet with PWM, or you may need additional components and numerous resistors. It all depends on the amount of info we can gather, what you are comfortable with and what can easily/reliable be assembled.
 

Calabashmc

Jan 18, 2016
13
Joined
Jan 18, 2016
Messages
13
I have done some measurements:
The fuel gauge outputs 4.9 volts. The setup of the gauge is 100ohms is full tank, 10 ohms empty tank.
I had a bunch of resistors which measured resistance with ohm meter then put ammeter in line to measure mA and I got the following:
  • 10Ω 28.6mA 6 bars
  • 12.4Ω 28.2mA 6 bars
  • 15Ω 27mA 5 bars
  • 18.7Ω 27.2mA 5 bars
  • 22Ω 26.7mA 4 bars
  • 27Ω 26mA 4 bars
  • 33.2Ω 25.1mA 3 bars
  • 39.6Ω 24.3mA 2 bars
  • 46Ω 23.5mA 1 bar
  • 47.5Ω 23.3mA 1 bar
  • 55.6Ω 22.5mA 1 bar
  • 68.8Ω 21.1mA 0 bars
  • 74Ω 20.6mA 0 bars

The fuel level sensor outputs 0.9v full tank to 3.8v empty tank. Ammeter in line with no resisters show 50mA with the tank about 1/2 full @ 1.2V
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
that's interesting the voltage across the resistor is about 0.25V when showing full and 1.5V when empty.

I would suggest that an op amp capable of 30mA or so with a gain of about 0.4 would do the trick. Probably best to have the op amp drive a mosfet.

this has the advantage of being fairly simple. Lashing up a proof of concept for this wouldn't be too hard. Of course the final circuit would require protection from noise and spikes, but there would be little chance of it locking up (like a uP might)
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,722
Joined
Nov 17, 2011
Messages
13,722
Your measurements are consistent with a 4.5 V source and a 145Ω series resistor. I'd guess theres an LM3914 or similar in the bar graph display with a series resistor to a 4.5V source (ref adjusted?), feeding the sensor as a load, using the resulting voltage on the sensor to drive the sig-input of the display driver.
For a simple test, use an adjustable voltage source with current limiting (anywhere near 30mA as Steve suggested) and connect it to the sensor input of the gauge. Vary the voltage from 0V to 1.5V and watch the display of the gauge. If this works well, Steve's suggestion is completely viable.
 

Calabashmc

Jan 18, 2016
13
Joined
Jan 18, 2016
Messages
13
I contacted the fuel gauge manufacturer and they provided the following:

The fuel input is approximately 4.5V through 150 ohm.

73 ohm sender voltage would be 4.5*73/(150+73) = 1.5V

10 ohm sender voltage would be 4.5*10/(150+10) = 0.3V

240 ohm sender voltage would be 4.5*240/(150+240) = 2.8V

33 ohm sender voltage would be 4.5*33/(150+33) = 0.8V
 

Colin Mitchell

Aug 31, 2014
1,416
Joined
Aug 31, 2014
Messages
1,416
Instead of messing around with all these values, you simply get a LED bargraph driver and connect the output of the sender to the input of the chip via resistors and a trim pot.
Now fill the tank and watch the LEDs increase. See how linear the results are.
You can design the bargrah to show from full to empty or from half-full to empty.
 

Gryd3

Jun 25, 2014
4,098
Joined
Jun 25, 2014
Messages
4,098
Instead of messing around with all these values, you simply get a LED bargraph driver and connect the output of the sender to the input of the chip via resistors and a trim pot.
Now fill the tank and watch the LEDs increase. See how linear the results are.
You can design the bargrah to show from full to empty or from half-full to empty.
You encouraged something similar not long ago...
No experimenting needed.
You just create a table of 8 and divide the input voltage into 8 sections.
Then fill and empty tank as see when the first LED comes on. Change the table value and start again.
Continue until all 8 values are as required.

There are always numerous ways to solve a problem. We have the math now to know what value resistor is in series with the fuel tank. This should allow a simpler design to allow a different sender to be used.
I think they are making good progress on their current track.
 
Top