Need help with non-linear(?) Op-Amp circuit

Thread Starter

Jack_K

Joined May 13, 2009
143
I have a motorcycle with a gas gauge. The sending unit for that gauge reads 10 ohms when the tank is full and 215 ohms when the tank is empty. OK so far.

I want to add a second gauge (2 total gauges). The second gauge requires a sending unit that reads 10 ohms when full but only 70 ohms when empty.

So, if I simply parallel the two gauges, the additional one will read empty long before the tank gets empty (70 ohms vs 215 ohms). Also, I suspect that paralleling two gauges will make the original gauge read wrong, too. That really complicates the problem.

I can't install an additional sending unit in a motorcycle tank. No way to do that.

I measured with the second gauge since it's on my workbench. Here's what I got. I connected the 12 volt pin to a 12 volt gel cell battery that measured 12.8 volts. The sensor pin was connected to a 10-turn 100 ohm pot. The other end of the pot was connected to the battery's negative terminal. I then measured the voltage across the resistor (with a DVM).


Voltage across the resistor Voltage across the gauge

10 ohms - 1.06 v = 106 ma 11.74 v
20 ohms - 1.82v = 91 ma 10.98 v
30 ohms - 2.36 v = 78.6 ma 10.44 v
40 ohms - 2.80 v = 70 ma 10.0 v
50 ohms - 3.12 v = 62 9.68 v
60 ohms - 3.41 v = 56.8 ma 9.39 v
70 ohms - 3.63 v = 51.7 ma 9.17 v

You can see it's nonlinear, but not too far off.

I haven't measured the motorcycle's gauge. I'm going to try that ASAP. Then I’ll know the ratio between the two gauges.

Attached is an op-amp circuit that I think will work. The op-amp will input the voltage across Gas Gauge 1 and amplify it to the correct level for Gas gauge 2. Right now I don't know exactly what voltage will be across Gas Gauge 1 since I haven’t measured it yet, but I do know the voltage required for Gas Gauge 2 is approximately 9.2 to 11.74 volts based on V1 being 12.8 volts. Of course V1 will be higher when the motorcycle is running, but I think the ratio will be close enough. After all, it’s just a gas gauge. Anybody ever seen an accurate gas gauge?

I doubt that the two gauges need the same voltage so that would mean I need a non-linear differential amplifier(?) since both gauges need 10 ohms to read full, but they need totally different resistances to read empty (215 vs 70 ohms).

Also, the op-amp will need to be able to source 100 ma or so.

Anyone know how to do that?

Jack
 

Attachments

SgtWookie

Joined Jul 17, 2007
22,230
This topic is a spin-off of this thread:
http://forum.allaboutcircuits.com/showthread.php?t=25706
... to which I'd replied minutes before our OP started this thread.

I feel that attempting to source current to your new gauge is going to complicate things considerably. It's much easier to sink current from the gauge.

As far as linearity goes, the small non-linearity you are seeing in the gauge is nothing compared to what you're going to see from graphing actual quantity of fuel in the tank vs fuel level sensor resistance. I can only surmise that it will be wildly non-linear.

As I mentioned in the other thread, you just haven't provided enough data yet; also, the voltage level of the battery from the first test is still in question.
 

Thread Starter

Jack_K

Joined May 13, 2009
143
"also, the voltage level of the battery from the first test is still in question."

Because of the inherent inaccuracy of gas gauges, I didn't think I need be exact on the voltage level of the test battery. Also, the battery voltage on the motorcycle will not remain constant as I ride.

I'm just looking for a ratio I think. Am I wrong here?
 

SgtWookie

Joined Jul 17, 2007
22,230
"also, the voltage level of the battery from the first test is still in question."

Because of the inherent inaccuracy of gas gauges, I didn't think I need be exact on the voltage level of the test battery.
Well, we really need some baseline numbers here.

You may not have realized it yet, but as the resistance of your simulated sensor increased from 10 Ohms to 70 Ohms, the resistance of the fuel gage also increased; from 110.8 Ohms to 176.8 Ohms. This is assuming that the battery measured exactly 12.8v throughout your test.

Also, the battery voltage on the motorcycle will not remain constant as I ride.
You may be surprised here, too. Don't forget that your generator/alternator has a regulator in it to keep the electrical system at a nominal 13.8v when the engine exceeds about 1,000-1,200 RPM.

I'm just looking for a ratio I think. Am I wrong here?
Basically, yes. However, before we can even venture a guess as to what that ratio might be, it would certainly be nice to have some readings to kick around - preferably, readings that were made under like conditions.
 

John Luciani

Joined Apr 3, 2007
475
As was mentioned you could be a lot better off sinking current. I am wondering if a
current-sink that mirrors but attenuates the current from gauge one would work
(see the attached circuit).

(* jcl *)

NB: This idea was generated B.C. (Before Cappuccino) :)
 

Attachments

Thread Starter

Jack_K

Joined May 13, 2009
143
That sounds like a good idea but the MOS-FET, or whatever it is, is over my head. What connects to the two inputs?

Jack
 

Thread Starter

Jack_K

Joined May 13, 2009
143
I was finally able to measure the voltage across the motorcycle's gas gauge. Using the following resistances I obtained the corresponding voltages:
Ohms Volts
10 --- 7.95 FULL
20 --- 7.57
40 --- 6.80
70 --- 5.81
100 -- 5.00
150 -- 3.97
175 -- 3.55
200 -- 3.15 EMPTY
215 -- 2.95

The gauge I want to add produced the following voltages:
Ohms Volts
10 ---13.4 FULL
20 --- 12.47
30 --- 11.88
40 --- 11.284
50 --- 10.86
60 --- 10.56
70 --- 10.295 EMPTY

So now I need a way to make the 2.95 to 7.95 volts be 10.295 to 13.4 volts for the second gas gauge.

If it were linear I could do it (I think), but it's not linear. The ratio of the voltages goes from approximately 1.685 to 3.5.

Any ideas?
Jack
 
Last edited:

John Luciani

Joined Apr 3, 2007
475
It seems like it is pretty close to linear. A little hard to tell since you
have 8 points for tank1 (E to F) and only 7 for tank2.
Using tank 1 as x and tank 2 as y --

y = mx + b

m is the change in y divided by the change in x.

m = (7.95 - 2.95) / (13.4 - 10.295) ~ 3/5

To find b we will plug in a value for x and y. Let's use the first point --

y = (3/5)x + b
13.4 = (3/5) * 7.95 + b

b = 8.63V

The amplifier needs to have a gain of 3/5 and you need to add 8.63V to the input.
The equation would be

Vtank2 = (3/5) * Vtank1 + 8.63V

The end points are correct. You could test the points in the middle.
They may be close enough. If not I would use a uC and a lookup table.

(* jcl *)
 

Thread Starter

Jack_K

Joined May 13, 2009
143
Thanks! Great information. I was trying to figure out how the slope equation would fit but I was lost (have been out of college for 45 years).

If I take the exact slope, .621, instead of .6, the voltage works out to be 8.46. I'll call it 8.5 volts. That's easier to use.

A gas gauge is not an exact science so I'm sure this will be close enough. It's not worth using a uC.

Thanks again,
Jack
 

Thread Starter

Jack_K

Joined May 13, 2009
143
Sgt Wookie posted this schematic. Now I need to make it have a gain of .6 and add 8.5 volts. I don't know how.

 

John Luciani

Joined Apr 3, 2007
475
It's not worth using a uC.
Probably not in this case since it can be done with a single op-amp and
a handful of resistors.

But a $2 uC would work too. You can get a development board for around
$30 that programs from the USB port of any computer. The software tools
are free.

This would also be a good first program.

1. Read a voltage.
2. Calculate y = mx + b
3. Output a voltage.
4. Go to step 1.

(* jcl *)
 

Thread Starter

Jack_K

Joined May 13, 2009
143
Thanks John. I'd have no problem programming a uC. I'm an Embedded Software Engineer by trade. Been programming everything from 4 to 32 bits for years.

I just don't want to fool with that much circuitry stuck inside the tight confines of a motorcycle.

Jack
 

John Luciani

Joined Apr 3, 2007
475
Use the non-inverting input to perform the summing. A little bit more to
calculate. See if there are some op-amp examples in the AAC text.

(* jcl *)
 

Thread Starter

Jack_K

Joined May 13, 2009
143
Yes. I could use a non-inverting summing amplifier but it would only save two resistors. For some reason I'm more comfortable with inverting op-amp circuits. Am I wrong?

Jack
 

Thread Starter

Jack_K

Joined May 13, 2009
143
I realized that my circuit is backwards. I mean it will convert gauge 2 to gauge 1 but what I need is to convert gauge 1 to gauge 2. So, instead of an adder, I need a subtractor.

I had a lot of trouble doing that with a non-inverting op-amp so I had to put an inverting op-amp in front of it. Will this circuit actually do what my note says?

Jack
 

Attachments

Top