The Core Formula: Gain of a Differential Op Amp Explained

The gain of a differential op amp is determined entirely by its external feedback and input resistor network, provided the internal open-loop gain is sufficiently high. In a standard differential configuration, the circuit amplifies the voltage difference between its two inputs while rejecting any voltage common to both (Common-Mode Rejection, or CMRR).

For a standard 8-pin DIP dual op-amp (like the ubiquitous LM358 or TL072), the pinout is standardized: Pin 1 is Output A, Pin 2 is Inverting Input A, Pin 3 is Non-Inverting Input A, Pin 4 is Vee (Ground or negative rail), Pin 5 is Non-Inverting Input B, Pin 6 is Inverting Input B, Pin 7 is Output B, and Pin 8 is Vcc (positive rail).

When calculating the gain of a differential op amp, the fundamental assumption is that your resistor pairs are perfectly matched. If we define the input resistors as $R_1$ (connected to the inverting input) and $R_2$ (connected to the non-inverting input), and the feedback/ground resistors as $R_f$ and $R_3$ respectively, the output voltage formula is:

$V_{out} = \left( \frac{R_f}{R_1} \right) \times \left( \frac{R_2 + R_3}{R_3} \right) \times V_2 - \left( \frac{R_f}{R_1} \right) \times V_1$

If you match the ratios so that $R_1 = R_2$ and $R_f = R_3$, the equation collapses to the much cleaner form:

$V_{out} = (V_2 - V_1) \times \left( \frac{R_f}{R_1} \right)$

The differential gain ($A_d$) is simply $R_f / R_1$. For example, if you use 10kΩ for $R_1$ and $R_2$, and 100kΩ for $R_f$ and $R_3$, your gain is exactly 10. A 50mV difference between $V_2$ and $V_1$ yields a 500mV output.

Operation Regions and Safe Default Part Numbers

An op-amp doesn't just blindly multiply; it is constrained by its power rails and internal transistor physics. Here is how the device behaves across its three distinct operation regions, assuming a standard dual-supply ±15V configuration.

Op-Amp Operation Regions and Typical Bench Measurements
Region Input Differential ($V_2 - V_1$) Output Voltage ($V_{out}$) Practical State
Linear (Active) Microvolts to low millivolts Tracks $(V_2 - V_1) \times Gain$ Normal amplification; feedback loop is stable.
Positive Saturation > +2mV (depends on gain) Clamped to $V_{cc} - 1.5V$ (approx +13.5V) Output stage transistors fully on; acts as a comparator.
Negative Saturation < -2mV (depends on gain) Clamped to $V_{ee} + 1.5V$ (approx -13.5V) Output pulled to negative rail; clipping occurs.

Selecting the right part number prevents you from fighting the silicon. Here are the safe defaults for 90% of bench and DIY projects, complete with their hard ratings:

  • LM358 (Dual, Single-Supply): The ultimate beginner and general-purpose part. Max supply is 32V (or ±16V dual). Gain-Bandwidth Product (GBW) is 1MHz. Input offset voltage is typically 2mV (can be up to 7mV max). Cost: ~$0.15 each. It cannot swing its output all the way to the positive rail, but it pulls down to 0V on the negative rail.
  • TL072 (Dual, Low-Noise): The default for audio and precision DC. Max supply is 36V. GBW is 3MHz. Input offset is typically 3mV, but it features JFET inputs, giving it incredibly low input bias current (picoamps). Cost: ~$0.50 each.
  • INA128 (Instrumentation Amp): When discrete resistor matching ruins your CMRR, use an instrumentation amp. Max supply 36V. CMRR is up to 120dB. Gain is set by a single external resistor ($R_g$) via the formula $G = 1 + (50k\Omega / R_g)$. Cost: ~$6.00 each.

Step-by-Step: Building a 10x Gain Current Sense Circuit

Let's build a practical circuit. We want to measure the current drawn by a 12V DC motor using a 0.1Ω shunt resistor. At a peak current of 5A, the shunt drops 500mV ($V = I \times R$). We want to feed this into a 5V Arduino ADC, so we need to map 0-500mV to 0-5V. That requires a differential gain of 10.

Biasing for Single Supply: Because we are measuring a shunt on the low side (between the motor and ground), both inputs will sit near 0V. A standard LM358 can handle input voltages down to the negative rail (0V), making it perfect for single-supply low-side sensing without needing a negative voltage bias.
  1. Select Precision Resistors: For a gain of 10, choose $R_1 = R_2 = 10k\Omega$ and $R_f = R_3 = 100k\Omega$. Use 1% tolerance metal film resistors minimum. If you use 5% carbon film, your CMRR will plummet, and common-mode noise from the motor will bleed into your output.
  2. Wire the Shunt: Place the 0.1Ω 5W power resistor in series with the motor's ground return. Connect $V_1$ (inverting input via $R_1$) to the high side of the shunt, and $V_2$ (non-inverting input via $R_2$) to the low side of the shunt.
  3. Close the Feedback Loop: Connect $R_f$ between the LM358 output (Pin 1) and the inverting input (Pin 2). Connect $R_3$ from the non-inverting input (Pin 3) to ground (0V).
  4. Power the IC: Connect Pin 8 (Vcc) to your 5V or 12V supply (LM358 handles up to 32V). Connect Pin 4 (Vee) to system ground.
  5. Add Decoupling: Solder a 100nF ceramic capacitor directly across Pin 8 and Pin 4 to filter high-frequency motor noise.

According to Analog Devices' analysis of differential amplifiers, the physical layout of these four resistors is just as critical as their values. Keep the traces from the shunt to the op-amp inputs as short and symmetrical as possible to prevent parasitic thermocouple effects and trace resistance from unbalancing your $R_1/R_2$ ratio.

Troubleshooting: How Differential Op Amps Fail and How to Test Them

Op-amps rarely die of old age; they die from Electrical Overstress (EOS). Connecting an input to a voltage higher than the supply rail, or shorting the output to a low-impedance source, will fry the internal silicon. Here is how to test a suspected dead op-amp using a standard digital multimeter (DMM).

Test 1: The Power Rail Short Check
Set your DMM to resistance mode. Measure between Vcc (Pin 8) and Vee (Pin 4). You should read in the megaohms or an open loop (OL). If you read less than 50Ω, the internal power bus is shorted. Throw it away.

Test 2: The Input Diode Test
Op-amps have internal ESD protection diodes connecting the inputs to the supply rails. Set your DMM to Diode Test mode. Place the red probe on Vee (Pin 4) and the black probe on an input pin (e.g., Pin 2). You should read a forward voltage drop between 0.5V and 0.8V. Reverse the probes; it should read OL. If it reads 0.0V in both directions, the input stage is shorted.

Test 3: The Output Stage Check
With the circuit powered on and no input signal (inputs grounded), measure the DC voltage at the output pin. It should sit near 0V (or your virtual ground reference). If the output is slammed to the positive rail and won't move when you inject a test signal, the output pull-up transistor has likely failed short.

Frequently Asked Questions About Differential Op Amp Gain

Why is my differential op amp gain lower than calculated at high frequencies?

This is dictated by the Gain-Bandwidth Product (GBW). An op-amp's open-loop gain rolls off at 20dB per decade. If your LM358 has a GBW of 1MHz, and you set your closed-loop differential gain to 100 (40dB), your maximum usable bandwidth drops to 10kHz. Above 10kHz, the op-amp physically lacks the internal gain to sustain your external resistor ratio, and the output amplitude will drop. For high-frequency differential gain, you must select an op-amp with a higher GBW, like the OPA2134 (8MHz) or an RF-specific part.

How does resistor tolerance affect the CMRR and gain of a differential op amp?

Resistor mismatch is the primary killer of Common-Mode Rejection Ratio (CMRR) in discrete differential circuits. If $R_1$ and $R_2$ differ by even 1%, your CMRR degrades to roughly 40dB, meaning common-mode noise (like 50/60Hz mains hum) will be amplified alongside your differential signal. The gain error will also skew by up to 2%. For precision DC measurements, always use 0.1% tolerance resistors, or use a matched resistor network IC (like the Vishay ACAS series) which guarantees tight ratio tracking over temperature.

Can I use a single-supply op amp for a differential gain circuit measuring negative voltages?

Generally, no. Even 'single-supply' op-amps like the LM358 have an Input Common-Mode Voltage Range that does not extend below the negative rail (Vee). If you are measuring a shunt on the high side of a grounded load, and the load pulls the shunt voltage near or below ground, the input transistors will cut off, causing phase reversal or output lock-up. To measure signals that swing below ground on a single supply, you must either bias the non-inverting input to a mid-rail virtual ground (e.g., 2.5V) or use a specialized 'beyond-the-rails' input op-amp like the LT1078.

For a deeper dive into input stage limitations and phase reversal, the Electronics Tutorials differential amplifier guide provides excellent schematic breakdowns of how internal transistor pairs behave when pushed outside their common-mode limits.