# Need help with op-amp circuit

Discussion in 'The Projects Forum' started by Jack_K, Sep 4, 2009.

1. ### Jack_K Thread Starter Senior Member

May 13, 2009
140
0
This is a spin-off of an earlier post I made since the title didn’t get me the response I had hoped for. The problem involves paralleling two gas gauges that each require different resistance sending units.
The current gauge has a sending unit that reads 10 ohms when full and about 210 ohms when empty. The one I want to parallel reads 10 ohms when full but only 70 ohms when empty. That means the problem ends up being how to convert one series of voltages to a lower series of voltages and maintain a semblance of linearity (it’s only a gas gauge).

I was able to measure the voltage across the motorcycle's gas gauge sending unit.
Ohms Volts
10 --- 5.85
20 --- 6.23
40 --- 7.00
70 --- 7.99
100 -- 8.80
150 -- 9.83
175 -- 10.25
200 -- 10.65
215 -- 10.85

The other gauge I want to add produced the following voltages:
Ohms Volts
10 --- 0.40
20 --- 1.33
30 --- 1.92
40 --- 2.52
50 --- 2.94
60 --- 3.24
70 --- 3.50

I’ve attached the circuit I built to convert the higher voltages to the lower ones. Unfortunately it doesn’t work.
1) With no op-amp in the socket all voltages are as expected
a) 5.85 v on V1
b) 4.3 v at V2
c) 1.85 v at pin 3
d) 3.32 v at pin 2
e) 3.32 v at pin 1
2) With an LF353/TL082 op-amp (direct replacement for LM358) plugged in I got
a) 5.85 v on V1
b) 4.22 v at V2
c) 1.85 v at pin 3
d) 2.054 v at pin 2
e) 1.443 v at pin 1

The circuit is supposed to be a non-inverting op-amp with inverting positive reference.
http://focus.ti.com/lit/an/slod006b/slod006b.pdf A.3.5
That means it should subtract the voltage on pin 2 from two times the voltage on pin 3. That’s all just great but why did the voltage on pin 2 drop from 3.32 to 2.054 volts when I plugged in the op-amp? What have I done wrong?

Jack

File size:
29.1 KB
Views:
78
2. ### SgtWookie Expert

Jul 17, 2007
22,201
1,809
Jack,
While the LF353/TL082 may be pin-for-pin compatible, with the LM358, they are not the same electrically.
The LM358's input common mode includes the negative rail (in your case, sensing to ground.)
The LF353/TL082's input common mode is a couple of volts above the negative rail.
The LM358's output can go within 10mV of the negative rail (in your case, ground.)
The LF353/TL082's output can only get within a couple of volts of the negative rail.
This last item will cause considerable difficulties trying to emulate a low value (10 Ohms) of the intended fuel level sender. For example, if the lowest that the output of the LF353/TL082 can go is +2v, then the 2N2907's emitter will be at least 0.7v above that, or 2.7v.

It seems that you need a different class of amplifier altogether. Take a look at the L2722 low drop dual power opamp that ST Microelectronics makes.
Newark stocks them: http://www.newark.com/jsp/search/productdetail.jsp?SKU=89K0725&CMP=AFC-OP&CMP=AFC-OP

The common mode inputs range from V+ to V-. The output can source or sink current up to 1A; when sinking 500mA current the output can go as low as 0.5v, or 0.3v when sinking 100mA.

Having the opamp capable of sinking all the current you'll need eliminates the necessity of the 2N2907 transistor.

Last edited: Sep 4, 2009
3. ### Jack_K Thread Starter Senior Member

May 13, 2009
140
0
Thanks. Does the rest of the circuit look OK? I'll get some of the L2722 amps and try it.

Jack

4. ### Jack_K Thread Starter Senior Member

May 13, 2009
140
0
How does this look? I decided to use the second op-amp as a buffer rather than just tieing its inputs to ground.

Jack

File size:
23.6 KB
Views:
42
5. ### SgtWookie Expert

Jul 17, 2007
22,201
1,809
You could do that (use the 2nd half of the opamp as a buffer). Keep in mind that the L2722 has a fairly high input offset voltage; up to 10mV. When you're using opamps in series, it's cumulative. Since the L2722 is beefy in comparison to the other opamps that were being considered, it really doesn't need a buffer. Just wire the output of the 1st opamp to the noninverting input of the spare amp, and the output of the 2nd amp to its' inverting input.

I put together a simulation of your circuit without the voltage follower. When your input voltage is 10.85v (the pot is 215 Ohms*), your output voltage is correct at about 3.5v.

However, when your input voltage is 5.85v (pot is 10 Ohms) your output voltage is too high at around 1.19v; it should be 0.4v. This will cause your secondary fuel gauge to show less than full when full, but as the fuel level falls, it will more accurately reflect the fuel level shown on the primary gauge.

*In my simulation, I simply used a triangle wave that varied from 5.85 to 10.85v for an input.

[eta]
The problem is occurring due to trying to use a voltage divider off the 1N749 Zener (R4, R5) instead of just using a 3.3v Zener to begin with.

Replacing the 1N749 with a 1N746 3.3v Zener, R4 with a 0 Ohm resistor (piece of wire) and removing R5 takes care of the problem.

If you want to leave the circuit basically like it is, then replace R4 with a 1.5k resistor, R5 with a 5.1k resistor, and replace R6 and R7 with 100k resistors. This won't be quite as good as the prior fix, but you won't have to get a different Zener. It will also increase the effect of the L2722's input impedance.

Instead of using fixed values for R1/R2, you may want to replace them with a 50k 21-turn trimpot. This will give you some "fine tuning" ability. The L2722 has an input impedance of around 500k Ohms or so, which is enough to throw off your calculations.

You could also replace the Zener with a TL431 (adjustable Zener) or LM317L and associated resistors; this would also give you some "tweaking" room.

Last edited: Sep 6, 2009
6. ### SgtWookie Expert

Jul 17, 2007
22,201
1,809
See the attached for the simplified circuit.
The floating multimeter is measuring the junction of D1/R3/R6; 3.233v. Note that most Zeners have a +-5% tolerance, and the 1N746 is no exception. Digikey stocks them:
http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=1N746A-ND
\$0.59 for 10, no minimum order, and they'll ship SMALL orders via USPS 1st Class, which will save you money. You might as well get a number of them and test them to see which is closest to 3.23v with a 1.8k resistor (R3) when supplied by 13.8v.

Digikey DOES stock the L2722:
http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=497-1384-5-ND
More expensive than Newark, but when you look at the difference in shipping and handling for such a small order, you'll likely come out well ahead with Digikey.

In this simulation, I don't show the original gas gauge or the new one, either - not even the 2nd half of the opamp. The junction of the level sensor pot and the original gauge is replaced by the signal generator box labeled FuelSnd, which outputs a single triangle wave that starts at 5.85v and ends at 10.85v.

Since my library didn't have an L2722, I just used an LM358 to illustrate that it works. The simulated O-scope display shows the opamp output ramping from around 410mV to around 3.55v; plenty close enough for your purposes.

R98 and R99 represent an approximation of the input resistance of the L2722. They would not physically exist in your circuit, as they are a property of the opamp itself.

File size:
62.5 KB
Views:
34
7. ### Jack_K Thread Starter Senior Member

May 13, 2009
140
0
Wow Sarge, that's great! I was also working on this over the weekend and, after measuring, I realized the LM358 could not drive the 2N2907 low enoughto get 0.4 out. So I took your advice and ordered some L2722 amps. I also ordered some 3.3 volt zeners.

I really learned a lot from your posts. Thanks a million.

Here's what I came up with. How does it look?

Whoops. It doesn't show pins 3 and 7 connected. They will be.

Jack

• ###### Gas Gauge Circuit-Subtract-New-4a.jpg
File size:
28 KB
Views:
38
Last edited: Sep 8, 2009
8. ### SgtWookie Expert

Jul 17, 2007
22,201
1,809
330 Ohms for R3 is too low. You originally had it as 1.8k. If the electrical system is at 13.8v, a 525 Ohm resistor would cause a 20mA current to flow through the Zener:
I(Zener) = (Vsupply - V(Zener)) / R3 = (13.8 - 3.3) / 525 = 10.5/525 = 20mA
However, you're really looking for 3.233v. Decreasing the current a bit more will lower the Vf a bit, but you really don't want to go below about 5mA.

That's why I suggested getting a bunch of the Zeners and measuring them for Vf. They're cheap.

[eta]
Don't forget to calculate the wattage requirement for R3. P = (Vsupply - V(Zener)) x I. Double the actual wattage requirement, and select a resistor with >= that number.

Last edited: Sep 8, 2009
9. ### Jack_K Thread Starter Senior Member

May 13, 2009
140
0
The 1N5226 has a zener current of 20 ma. I was unable to find a 1N746. I'm looking into the TL431 to see what it has to offer.

10. ### SgtWookie Expert

Jul 17, 2007
22,201
1,809
I posted a link to it at Digikey in my reply #6:
http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=1N746A-ND
They have 4,916 in stock as of this reply. No big deal, the other Zener is very similar.
It's an "Adjustable Zener", a variable shunt regulator.

Have a look on page 23, figure 17, the "Shunt Regulator" application.
"R" can be a 1.5k resistor.
R1 & R2 could be replaced by a 2k Ohm 21-turn trim pot, wiper tied to Vref.
Set the R1 side of the pot to 450 Ohms to get it in the ballpark.

11. ### Jack_K Thread Starter Senior Member

May 13, 2009
140
0
Thanks again. I also found an Excel spreadsheet that automatically calculates the Rs for me.

12. ### Jack_K Thread Starter Senior Member

May 13, 2009
140
0
Thanks to Sergeant Wookie, the circuit has really been simplified and it might even work. As soon as my parts arrive I'll find out.

Jack

File size:
27.5 KB
Views:
39
13. ### SgtWookie Expert

Jul 17, 2007
22,201
1,809
Oops - you have pin 8 (inverting input) connected to Vcc instead of pin 1 (output).

Other than that, looks good.

14. ### Jack_K Thread Starter Senior Member

May 13, 2009
140
0
My bad! That's what I get for day dreaming while I'm drawing lines. Thanks for all the great help.

Jack