# Subtractor op-amp configuration to find the diference of 2 signals

Electrical Engineering Asked by MetrryBoros on August 27, 2020

How can a differential op-amp be configured in a way that it doesn’t amplify but only takes the difference between the signals at the inverting and non inverting input? ## First story

The best way to reveal the idea of this clever circuit solution, is to show how it was invented (this approach is suitable for explaining every unknown circuit).

• Probably, some tried to convert the humble non-inverting amplifier into a differential amplifier by connecting the second voltage to the unused inverting input. But it turned out the gain of the inverting input is one unit smaller than the gain of the non-inverting input. So they connected an amplifier between the second input source and the inverting input.

• Probably, others tried to convert the humble inverting amplifier into a differential amplifier by connecting the second voltage to the unused non-inverting input. But now it turned out the gain of the non-inverting input is one unit larger than the gain of the inverting input. So they connected an attenuator between the second input source and the non-inverting input.

Of course, the second solution turned out to be simpler ...

## Second story

The idea of this clever circuit solution is to equalize the gains of its two inputs since the gain of the non-inverting input is one unit larger than the gain of the inverting input. We can do it in two ways:

• By connecting a non-inverting amplifier before the inverting input (it needs another op-amp and resistors).

• By connecting an attenuator before the non-inverting input (it needs only two resistors).

Of course, we choose the second solution...

## Third story

But at some point they realized that the simple 4-resistor solution had a significant drawback - it was influenced by the internal resistance of the input sources. Then they remembered the more complex solution with an additional op-amp... and decided to use it. They called it "instrumentation amplifier": Answered by Circuit fantasist on August 27, 2020

It is not hard to show that the output voltage of your circuit is:

$$text{V}_text{out}=text{V}_2cdotfrac{text{R}_text{g}}{text{R}_2+text{R}_text{g}}cdotfrac{text{R}_1+text{R}_text{f}}{text{R}_1}-text{V}_1cdotfrac{text{R}_text{f}}{text{R}_1}tag1$$

So, when we make $$text{R}:=text{R}_text{f}=text{R}_1$$ we get:

$$text{V}_text{out}=text{V}_2cdotfrac{text{R}_text{g}}{text{R}_2+text{R}_text{g}}cdotfrac{text{R}+text{R}}{text{R}}-text{V}_1cdotfrac{text{R}}{text{R}}tag2$$

Simplifying gives:

$$text{V}_text{out}=text{V}_2cdotfrac{2text{R}_text{g}}{text{R}_2+text{R}_text{g}}-text{V}_1tag3$$

So, we need:

$$frac{2text{R}_text{g}}{text{R}_2+text{R}_text{g}}=1spaceLongleftrightarrowspace2text{R}_text{g}=text{R}_2+text{R}_text{g}spaceLongleftrightarrowspacetext{R}_text{g}=text{R}_2:=text{k}tag4$$

So, we get:

$$text{V}_text{out}=text{V}_2cdotfrac{2text{k}}{text{k}+text{k}}-text{V}_1tag5$$

Simplifying gives:

$$text{V}_text{out}=text{V}_2-text{V}_1tag6$$

So, we need $$text{R}_text{g}=text{R}_2$$ and $$text{R}_text{f}=text{R}_1$$.

Answered by Jan on August 27, 2020 Using the superposition theorem: -

The gain through the inverting "channel" is $$dfrac{R_f}{R_1}$$

So, make $$R_f = R_1$$ to get an amplification of minus one.

The gain through the non-inverting "channel" is $$dfrac{R_g}{R_2+R_g}cdot (1+dfrac{R_f}{R_1})$$

So, if $$R_f = R_1$$ (as per above) then the non-inverting gain is $$dfrac{2cdot R_g}{R_2+R_g}$$

Hence for a non-inverting unity gain, make $$R_2 = R_g$$

Answered by Andy aka on August 27, 2020

We set the gain of a differential amplifier to unity (well, +1 from non-inverting input, -1 from inverting input), so that it 'doesn't amplify', while taking the difference between its inputs. For a conventional diff-amp, this means all four resistors equal.

Answered by Neil_UK on August 27, 2020

## Related Questions

### How to calculate the needed capacitance of a start capacitor for a 12V 10A DC motor?

1  Asked on January 20, 2021 by unobianconero

### mesh analysis question with dependent current source

4  Asked on January 20, 2021 by seph22

### Measuring/confirming voltage and current

2  Asked on January 19, 2021 by ccandy

### Best way to charge 750mAh in portable device

0  Asked on January 19, 2021 by amill

### LM317 regulator with NPN pass transistor alternatives and ripple consideration

2  Asked on January 18, 2021 by nahero

### Does adding a line impedance stabilisation network reduce the output of buck converter in simulation in LTSPICE?

0  Asked on January 18, 2021 by catharine-aji

### Building a “if” statement circuit where i can control different light diodes

0  Asked on January 18, 2021 by frans-myrberg

### 5V 4A power supply for simple circuit

2  Asked on January 18, 2021 by therealjoe

### Does an isolation transformer make CRTs any safer to work with?

4  Asked on January 18, 2021 by user148298

### Calculate LifePo4 charging amps

1  Asked on January 18, 2021

### What’s the point in a preamp?

6  Asked on January 17, 2021 by jacob-garby

### In magnetically coupled coils, what is the difference between coefficient of coupling and the percentage of a flux linked to the other coil?

1  Asked on January 17, 2021

### How to use USB 3.0 inner cables by color?

0  Asked on January 16, 2021

### Mechanical vibrations picked by an audio amplifier (Strange microphone efect when there is no microphone)

2  Asked on January 14, 2021 by ultralisk

### Degradation of resonant sine wave signal in coil/solenoid after adding second layer

1  Asked on January 13, 2021 by justin-kennedy

### Difference between fuse diode and diode – is there is any?

0  Asked on January 12, 2021 by mark-crowder

### Phase margin is 90 degrees but transient step response shows overshoot

1  Asked on January 12, 2021 by sbo