Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Newbie - Needs help with electronic variable resistors - Custom fuel gauge.

Status
Not open for further replies.

Jtegg007

New Member
Let me start by saying I am totally new to circuit and small electronic building. This will be my first DIY type project, and Id like to be at Fry's tonight picking up stuff to play with.

The goal here is to control an OEM fuel gauge via a voltage signal. I have a pressure transducer, reading pressure and outputting a 0-5v signal. I need to build a device that can take that signal, and use it to control a variable resistor. The OEM gauge/computer looks for 50-300 ohms resistance in the fuel level circuit and uses that info to determine fuel level; 50 ohms is full and 4.5v is full. And 300 ohms is empty and 0.7v is empty. Im hoping the device can automatically scale everything in between. Can anyone point me in a good direction to start learning how to accomplish this?
 
It is actually quite difficult to electronically simulate a resistor, and is even more difficult if the circuit isn't clear.

The relationship between resistance and voltage for the figures that you give imply that the variable resistance is normally connected between a supply and the fuel gauge input, because the voltage is higher with a lower resistance. The figures also imply that the fuel gauge input is not a fixed resistance to ground. However the figures are what would be expected if there was a 5.24 V supply on the other end of the resistance and a constant 15.2 mA load. However, that is just one posibility, there may be many more.

What is needed to answer the question is the voltages on all the fuels level sender wires. There are probably just two wires, but there may be more. It would also be a good idea to get several levels, not just full and empty, and the voltage and resistance are needed at each level.
 
With many fuel gauges the 50-300 Ohms is the resistance of a sender having one terminal grounded, the gauge being in series between the other sender terminal and the +12V rail. Is that the arrangement you want to simulate?
What are the voltages at the gauge input when the gauge is powered with +12V, and 50 and 300 Ohms are respectively connected between that input and ground?
 
... Im hoping the device can automatically scale everything in between. Can anyone point me in a good direction to start learning how to accomplish this?

I just posted this on another forum: There the topic was a temp gauge, but the same point applies to fuel gauges, especially since the resistance of the sender is usually non-linear with fuel depth, and likely the tank doesn't have straight sides.

I've been down this road before with airplane gauges and senders.

The only way of solving this is to know two sets of data:

Say you want to make a thermometer.

1. You need a plot of resistance of the sender vs temperature.

2. You need a plot of indicated temperature (what the needle shows) vs current through gauge.

The circuit that goes between the two is very specific to 1. and 2. above. It is not simply a two-point straight line fit, like your posted opamp circuit. You change either one, and you start over. There is no simple circuit (opamp, transistor and a couple of resistors, y=mx+b) that will match unknown senders to unknown gauges. It takes a polynomial or expontial equation to do the fit.

The reason that this problem is such a ***** is because the OEM senders were non-linear, and they compensated for the non-linearity by having non-linear markings on the face of the matching gauge. The two were a matched set. Each is non-linear, but the two non-linearities offset each other.

Now you want to substitute a different sender, with a different non-linearity. That changes everthing.
 
I agree with Mike regarding non-linearities. But you can get an approximate simulated resistance like this :-
SenderSim4.gif
The yellow and blue curves show how the gauge input might vary respectively with a 0-5V control signal applied to the circuit and with a 50-300 Ohm sender change.
 

Attachments

  • SenderSim4.asc
    3.7 KB · Views: 337
I don't want to hijack this thread as it is subtly different having read through, but I'm on a similar/related journey with circuit for matching modern pressure transducers to old bi-metallic pressure gauges. Just to echo what peeps have already said - it is non-trivial if you want a high degree of accuracy - but that's not always required (especially for a fuel gauge)

Just in case it is of help:
https://www.electro-tech-online.com...-circuit-advice-critiques-appreciated.143949/

Not wanting to question your application, but why are you using a pressure transducer for fuel sensing? A fuel tank pressure sensor is part of the evaporative emission control system, it is not used to sense fuel level. Basically, it is usually just there to sense a leak in your fuel tank, below a certain level it triggers an ECS event.
 
Thank you all for the wonderful responses, and I can see how this challenge might be more than I'm prepared for, as a total beginner, but I'm not ready to give up just yet.

Rockrockmcrock, No worries of thread jacking, I'm here to learn so more info in any way is useful.
To answer your question, this vehicles been converted over to Natural Gas. Its tank reads in PSI from 0-3600. I have a digital gauge accurately reading pressure, so I know my fuel level. The state of California requires the OEM gauge to function appropriately as well.

To all the others, Sadly, this went over my head quickly. Anyone wanna recommend a good place to start learning small electronics and math? haha
I understand the fuel curve of the OEM gauge + sender weren't a straight line but curved and therefor would take a more advanced equation to solve for every voltage to resistance value of the new sender. I'm not looking for something that accurate, and I don't mind if its off a ways, as long as full is full and empty is empty. I was thinking Digipot because it sounded like the simplest, smallest form-factor solution to my issue. My overall goal here is to get it working as simply as possible. As an alternative thought, could I pick up a variety of resistors; a few 1 ohm, a pair of 5ohm, a 10, a 25, a 50, a 100 and a 200, stick them all in a board in a matrix and use a controller + programming to step it up 1 ohm at a time? I feel like building a simple program that reads voltage and routes a circuit off of it would be relatively easy. That could potentially result in my OEM gauge going through multiple steps as defined by the program at various voltage inputs. This would be more than accurate enough for my needs.
This idea came up after looking at the OEM sender again yesterday afternoon. It is a two wire sender, with a basic float on an arm that travels across multiple steps from empty to full - its not a constant resistance change. I didn't measure each step, but id say there was about 50.
My goal here is to replicate the OEM set up as close as possible, so I dont have to modify anything, just 'replace' the component I removed.
What potential problems could I see from this type of setup? How hard would it be to set up a board that let me program a circuit to run through multiple steps the way I'm thinking?

The reason I'm trying to keep it so simple- The OEM sending unit was extremely simple. like I said, about 50 different steps of resistance as the fuel level dropped. The OEM computer/gauge side of things is way more complex than I fully understand. Its a 2 wire set up, I can pull a wiring diagram if anyone wants to see. The computer sends a PWM signal and listens for results. It also seems to send a check signal at start up, a slightly larger square wave, and it sets a gauge fault if the resistance is out of range (open/to high/to low). All I had to do to get around that is shove a 120ohm resistor in place of my OEM sender. That gets it through start up, but after about 100 miles of driving with no resistance change it sets a fault for stuck gauge. That brings me to this project.
 
Last edited:
Rockrockmcrock, No worries of thread jacking, I'm here to learn so more info in any way is useful.
To answer your question, this vehicles been converted over to Natural Gas. Its tank reads in PSI from 0-3600. I have a digital gauge accurately reading pressure, so I know my fuel level. The state of California requires the OEM gauge to function appropriately as well.

Ahhh - makes sense now - there are loads of solutions already out there for this application, so I guess you're sure you can't use an existing OTS gauge/sender set? I'm UK based, but I suspect Cal can't be too different - find out whether they really do require the OEM gauge to function, most just require 'a functioning gauge' and some countries don't even require it to be on the dash (i.e. put a mechanical on the tank) - in fact UK was one of them until the SVA came in.

The reason I'm trying to keep it so simple- The OEM sending unit was extremely simple. like I said, about 50 different steps of resistance as the fuel level dropped. The OEM computer/gauge side of things is way more complex than I fully understand. Its a 2 wire set up, I can pull a wiring diagram if anyone wants to see. The computer sends a PWM signal and listens for results. It also seems to send a check signal at start up, a slightly larger square wave, and it sets a gauge fault if the resistance is out of range (open/to high/to low). All I had to do to get around that is shove a 120ohm resistor in place of my OEM sender. That gets it through start up, but after about 100 miles of driving with no resistance change it sets a fault for stuck gauge. That brings me to this project.

OK - listen to others more than me as my expertise is in hacking micro-controllers and programming, but what you're asking can be done ....I can just give you my 'programmers' experience:

You'll need a lot of kit if you're not already into MC programming and the learning curve is steep. That said don't let me put you off - I did a similar project as my first some years back, I interfaced with a custom I2C bus using a PIC to provide USB access and SD FAT compatible memory storage for a transmitter, where before there was only eeprom. However, it was not cheap and it took 6 months, plus there were loads of timing/reponse issues to overcome. The circuit however was simple and already in the datasheet :D

To get started, look at some arduino projects - they'll already be reference boards you can buy for sensing voltage on the analogue pin. You're biggest issue as a newbie will be the PWM comms. I don't know the specs of your gauge but you will probably have issues in getting the communication working properly (I did) - you'll need a logic analyser/logger for this so you know whats going wrong and where when things don't work (don't try and get away without one as its just not worth it - cheap ones are around $50, but they are very DIY). I'm not an arduino fan or expert myself - but I have often found that knowing ASM as well as C has stood me in very good stead for comms projects!
 
50-300 puts it in slightly wierd mode. The gauge wiring helps somewhat. It's important the get some V, I R (can be derived) and % Full scale data. Your meter could introduce 10 ohms or more into the circuit unless you use a zero resistance ammeter, It's also important to get the open circuit voltage.

Suppose for a moment that your guage went from 500 to 1000 ohms. An OPTO-FET, basically a LED shining on a FET which can vary the resistance from about 300 to 300 M ohms. So a computer could drive the LED until a certain voltage was across the FET which translates to a resistance.

The 50-200 ohms makes it more difficult to get there, but it's still possible. The point being, you would be able to "dial in" whatever "voltage you wanted" to appear across the "resistor". "resistor" in this case is not a simple resistor. Simulating ohms is hard, creating current and measuring the the resultant voltage is much easier and placing that in an analog feedback loop is MUCH easier.

Unless the transfer function was extremely simple, e.g. 1-5 V is 0 to 100% then it could be done analog. If it were 1-5 V is 100% to 0% that's more difficult.
A processor and a look-up table can work out the non-linearities.

From scratch, you might want to look at www.picaxe.com. The Arduino though is much more powerful platform. Interfacing is another hurdle. The I2C bus is a common way of interfacing chips to a processor.

You really do need the input to output transfer function and more importantly the transfer function of the current gauge.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top