# How do I get a DC difference amplifier working?

• Voltux
In summary: I have answered my own question after further research. Removing the resistors gives an ideal op amp infinite voltage gain operating "Open Loop".If I only vary the V2-V1 by 5mV (1v-0.995v) output will be 0.005*10^5 = 500v [(V2-V1)*Gain] and since the rails are 10v it will be saturated and given that the LM358 is 1 diode drop + a little below Vin that accounts for why I was getting between 9.6v and 8.9v the op amps saturation point.
Voltux
I've been trying to figure out why my DC subtraction amplifier is not working, and am completely baffled. I have set up an op amp with no feedback resistors with voltages applied to both the inverting and non-inverting inputs as specified below. I previously had the op amp setup with a 10x gain differential op amp following this circuit and obtained similar results. I tried searching and attempting the calculations for the op amp, and reading up on them in a couple books I had but I can find no explanation as to why this would not work. I used values of 5v, and 1v so that it would not be operating near the rail, and should have a gain of 1 since no resistors are added.

The Op amp output voltage should be Vo = Av*V1-V2 where V1 is the noninverting, and V2 is the inverting inputs. Av (Voltage Gain) = 1; therefore 5v-1v = 4 Vout is expected.

Op Amp: TL072CP & LM358
Supply Voltage +10v (Single Supply)
Inverting Input Voltage Applied: 1v DC
Non-Inverting Input Voltage Applied: 5v DC
Output Voltage Measured: 9.6V DC for TL072CP, 8.9v for LM358

You say you have set up the circuit with no feedback resistors yet the schematic shows it. Are all resistor of the same value?

I have answered my own question after further research. Removing the resistors gives an ideal op amp infinite voltage gain operating "Open Loop".

The LM358 for example has approximately 100dB of gain which is 10^5*(V2-V1) since the op-amp responds only to the difference signal (V2-V1) where V2 = Non-Inverting input voltage, and V1 = Inverting input voltage and hence ignores any signal common to both inputs (Common mode rejection)

If I only vary the V2-V1 by 5mV (1v-0.995v) output will be 0.005*10^5 = 500v [(V2-V1)*Gain] and since the rails are 10v it will be saturated and given that the LM358 is 1 diode drop + a little below Vin that accounts for why I was getting between 9.6v and 8.9v the op amps saturation point.

I simply replaced the resistors with all 1k giving me 1x gain, and now am getting the expected result.

At this point I will consider this question answered, and thanks for the reply.

Last edited:
I often tell folks this very basic and easy to remember rule

An operational amplifier "operates" by forcing its inputs equal.
It is the job of the circuit designer to surround the amplifier with a circuit that allows it to do that.
Else it cannot "operate".

easy to remember 3 step method to evaluate an opamp circuit

1. write KVL for voltage at noninverting input.
2. write KVL for voltage at inverting input.
3. Set 1 equal to to 2 and solve for Vout

Voltux said:
Supply Voltage +10v (Single Supply)
I suppose thats the problem. Try split supply - and it will work.

sophiecentaur
LvW said:
I suppose thats the problem. Try split supply - and it will work.

Alternatively, set your amplifier 'Ground' to half way between supply + and supply ground, using a potential divider and decoupling Capacitors and that will give you +/- 5V supply to the chip. You can then do your analogue arithmetic calculations using volts relative to the amplifier local ground (at +5V, absolute). (Saves getting hold of another power supply and would prove the point)

Voltux said:
I simply replaced the resistors with all 1k giving me 1x gain, and now am getting the expected result.

At this point I will consider this question answered, and thanks for the reply.

i think he realized he'd have to add those resistors he showed us in first post ?

jim hardy said:
i think he realized he'd have to add those resistors he showed us in first post ?
There must still be a problem with the single sided supply and the implied reference of 0V (R4)
I can't understand why a simple virtual Earth amp needs to be using 1k Resistors in order to (appear to) work. I think it could be because of the large bias current to earth.

jim hardy
sophiecentaur said:
There must still be a problem with the single sided supply and the implied reference of 0V (R4)
I can't understand why a simple virtual Earth amp needs to be using 1k Resistors in order to (appear to) work. I think it could be because of the large bias current to earth.

Good thinking . May be...

By my simple old man's method , the opamp 'operates' by forcing its inputs equal

if all 4 resistors are equal,
Va = (V1 + Vout )/2
Vb = V2/2

equating Va and Vb gives
V2/2 = (V1 + Vout )/2
multiply both sides by 2
V2 = V1 + Vout

Vout = V2 - V1

with Va and Vb both V2/2

Voltux said:
I used values of 5v, and 1v so that it would not be operating near the rail,

but i notice he swapped inverting and noninverting inputs in this sentence
Voltux said:
The Op amp output voltage should be Vo = Av*V1-V2 where V1 is the noninverting, and V2 is the inverting inputs. Av (Voltage Gain) = 1; therefore 5v-1v = 4 Vout is expected.
and he got his V2 and V1 in this term reversed :: Vo = Av*V1-V2

so if, with single sided supply he applied 5 volts to V1 and 1 volt to V2
the amplifier would have to drive output beyond the negative rail to "operate" .

And it looks like he might have done that

Voltux said:
Op Amp: TL072CP & LM358
Supply Voltage +10v (Single Supply)
Inverting Input Voltage Applied: 1v DC
Non-Inverting Input Voltage Applied: 5v DC
Output Voltage Measured: 9.6V DC for TL072CP, 8.9v for LM358
If he applied his voltages correctly it should work fine.

Now that begs the question why did his output go to positive saturation instead of negative ?
Pure speculation follows...

It'd be interesting to repeat that test.
That opamp's datasheet does not mention "latchup" from overdrive
but it does have this cryptic note regarding "lateral NPN parasitic transistor action"

I wonder whether the relatively low 1kohm input resistors might allow enough current to trigger that action. Would absence of resistors allow input current ? He didn't say under which condition he saw saturation, did he,,, resistors or no resistors ?

What would that opamp do with its inputs forced 4 volts apart with say 50 milliamps of current capability?(That's datasheet absolute maximum number for input current)

. i don't know.

Only mention i could find of latchup in LM358 was when it's exposed to radiation. It's a lot tougher than humans.

It looks like by post 3 he had things more straight:

Voltux said:
the op-amp responds only to the difference signal (V2-V1) where V2 = Non-Inverting input voltage, and V1 = Inverting input voltage
That time he called V1 inverting and V2 non-inverting.

The feedback will be pulling Va to Vb and Vb is the result of V2 being potted down by R2 and R4. This is not the way a virtual Earth adder is supposed to be working because the input sensitivity of each input will be different, due to the pull down resistor R4. When the circuit is working between + and - supplies, R4 is connected to mid-rail Ground and would have a high value (?). The fact that it needs such low resistors in the circuit to get it look like it's working implies that something is wrong and the first things that's wrong is the single sided power supply. It's only a matter of kindness to the chip to give it the right food. There seems to me to be pointless to operate it away from the proper conditions. R4 should be connected to a (near) 'half rail' point and the voltages should be measured with respect to that point. Where's the problem in that? It's telling you it's not happy so be nice to it.

Weelll,

if it's a TI LM358, http://www.ti.com/lit/ds/symlink/lm158-n.pdf
it ought to be capable of single supply differencing

1k is too low for his feedback resistor R3 because of its output sinking capacity

hence the 100k in TI's datasheet application circuit
but as you say it'd work fine with split supply.

i too had a hard time adjusting to single supply opamps. They're sure nice when all you've got is +5 or +12.

old jim

jim hardy said:
Using a single rail is useful but you always have to be careful about where the single volts are all referenced to. Single sided outputs are often all you need but not the best configurations to cut your teeth on op amps with. Most op amp work has the luxury of ignoring the power supply/ies because they are usually not included in the functional diagrams. In this case, it is a serious omission from the diagram, I would say. (Despite the note underneath it)

sophiecentaur said:
Single sided outputs are often all you need but not the best configurations to cut your teeth on op amps with.
Agree wholeheartedly .
sophiecentaur said:
Most op amp work has the luxury of ignoring the power supply/ies because they are usually not included in the functional diagrams.

In 1970's National Semiconductor was getting so many inquiries from people complaining their circuits didn't work that they published an application note explaining 'you have to connect the power '.

sophiecentaur
jim hardy said:
Agree wholeheartedly .

In 1970's National Semiconductor was getting so many inquiries from people complaining their circuits didn't work that they published an application note explaining 'you have to connect the power '.
From anyone else I would call B.S.!

Averagesupernova said:
From anyone else I would call B.S.!

I haven't yet exhumed that one. Will continue looking.

Anybody here old enough to remember Signetics "Write Only Memory" ?

whole page here http://www.ti.com/ww/en/bobpease/assets/www-national-com_rap.pdf#page=128&zoom=130,0,775

from page 14 here http://www.ti.com/ww/en/bobpease/assets/www-national-com_rap.pdf

old jim

Yes I remember that WOM. I always got a charge out of the 6 volt supply required for filaments. I recently tossed a beat up copy of that datasheet. It had never occurred to me to get a fresh one from the web.

## 1. How do I choose the correct values for the resistors in a DC difference amplifier?

The values of the resistors in a DC difference amplifier can be calculated using the following formula: R = (Vout / Vin) * Rf, where R is the desired resistor value, Vout is the desired output voltage, Vin is the input voltage, and Rf is the feedback resistor. It is important to choose values that will provide the desired amplification and stability for the circuit.

## 2. Can I use any op-amp for a DC difference amplifier?

No, not all op-amps are suitable for use in a DC difference amplifier. It is important to choose an op-amp with a high gain and low offset voltage to ensure accurate amplification of the input signal. Additionally, the op-amp should have a high input impedance and low output impedance for optimal performance.

## 3. How do I ensure stability in my DC difference amplifier circuit?

To ensure stability in a DC difference amplifier, it is important to choose resistor values that provide proper feedback and avoid using high gain values. Additionally, using decoupling capacitors and keeping the circuit layout compact can help prevent unwanted oscillations.

## 4. What is the purpose of a DC biasing circuit in a difference amplifier?

A DC biasing circuit is used in a difference amplifier to set the output voltage at a specific level, typically half of the supply voltage. This allows for the amplification of both positive and negative input signals, as the amplifier can only output voltages within the supply range.

## 5. How can I troubleshoot my DC difference amplifier if it is not working?

If your DC difference amplifier is not working properly, check the resistor values and op-amp specifications to ensure they are suitable for the circuit. You can also check for loose connections or faulty components. Additionally, using an oscilloscope to monitor the input and output signals can help identify any issues with the circuit.

Replies
2
Views
907
Replies
3
Views
2K
Replies
9
Views
3K
Replies
11
Views
2K
Replies
5
Views
2K
Replies
11
Views
2K
Replies
5
Views
2K
Replies
12
Views
2K
Replies
5
Views
7K
Replies
50
Views
6K