The Matched Differential Amplifier Formula

The differential amplifier subtracts two input voltages and scales the difference by a resistor ratio. For the standard four-resistor operational amplifier configuration, assuming the resistor ratios are perfectly matched, the output voltage is calculated as:

Vout = (Rf / Rin) × (V2 - V1)

This simplified equation is the workhorse of current shunt monitors, Wheatstone bridge interfaces, and balanced audio line receivers. However, it strictly requires the non-inverting voltage divider ratio to match the inverting feedback ratio. Below is the complete symbol map and the matching constraints you must observe on the bench.

SymbolDefinitionTypical Bench Values
VoutOutput voltage referenced to circuit ground0.5V to 4.5V (for 5V ADC headroom)
RfFeedback resistor (Output to Inverting Input)10kΩ to 1MΩ
RinInput resistor (Signal V1 to Inverting Input)1kΩ to 100kΩ
V2Voltage applied to the non-inverting input networkSensor high-side or bridge leg
V1Voltage applied to the inverting input networkSensor low-side or bridge leg
R3Non-inverting series resistor (V2 to Non-Inv Pin)Must equal Rin
R4Non-inverting shunt resistor (Non-Inv Pin to GND)Must equal Rf

If Rf/Rin does not exactly equal R4/R3, the circuit will amplify the common-mode voltage (the average of V1 and V2), destroying your measurement accuracy. For precision work, use 0.1% tolerance resistors (like Susumu RG series) or switch to a dedicated instrumentation amplifier.

Real-World Op-Amp Specifications for Differential Circuits

The formula assumes an ideal op-amp. In reality, the component you choose dictates whether your circuit rejects noise or amplifies it. The critical metric here is CMRR (Common-Mode Rejection Ratio), which measures how well the chip ignores voltages common to both inputs. Here is a data-dense comparison of standard bench and precision parts.

Part NumberCMRR (Typical)Input Offset VoltageSlew RateBest Application
LM35885 dB3.0 mV0.6 V/μsLow-side shunts, non-critical DC
TL072100 dB3.0 mV13.0 V/μsBalanced audio, AC signals
INA128120 dB50 μV1.2 V/μsHigh-side current sensing, bridges
AD620130 dB125 μV1.2 V/μsStrain gauges, medical sensors
LT1990130 dB25 μV50.0 V/μsHigh-speed differential ADC drivers

Source data aggregated from Texas Instruments LM358 Datasheet and Analog Devices AD620 Datasheet.

Bench Tip: If you are measuring a 50mV shunt drop sitting on top of a 12V common-mode voltage using an LM358, the 85 dB CMRR means the 12V common mode will leak through as an error of roughly 2.1 mV at the input. That is a 4% error before you even factor in resistor mismatch. Use an INA128 for high-side sensing.

Rearranged Forms and Unit Pitfalls

When designing the circuit from scratch, you rarely start with Vout. You usually know your sensor's differential swing and your ADC's target voltage. Here are the rearranged forms for design calculations:

  • Solve for Required Gain (Av): Av = Vout / (V2 - V1)
  • Solve for Feedback Resistor (Rf): Rf = (Vout × Rin) / (V2 - V1)
  • Solve for Unknown Input (V1): V1 = V2 - (Vout × Rin / Rf)
  • Solve for Input Resistor (Rin): Rin = (Rf × (V2 - V1)) / Vout

Unit Mistakes That Break the Math

  1. Mixing Millivolts and Volts: Shunt voltages are usually in mV, while ADC references are in V. If V2 - V1 = 50mV and you plug in '50' while targeting a '3.3' V output, your calculated gain will be off by a factor of 1,000. Always convert inputs to base Volts before calculating.
  2. AC RMS vs. Peak-to-Peak: The formula calculates instantaneous DC or peak AC values. If your oscilloscope reads 2.0Vpp (peak-to-peak), the peak amplitude is 1.0V. Using 2.0V in the formula will result in an output that clips against the supply rail.
  3. Ignoring Resistor Absolute Values: The ratio Rf/Rin is unitless, but the absolute ohmic values matter. Using 10Ω and 100Ω gives a gain of 10, but will draw massive current from your op-amp's output stage and overload the signal source. Stick to the 1kΩ to 1MΩ range.

What a Realistic Answer Magnitude Looks Like

If your calculation yields a Vout of 18V, but you are powering the op-amp with a single 5V USB supply, the math is correct but the physics will fail. A realistic Vout must sit at least 0.5V to 1.5V below the positive supply rail (depending on whether the op-amp is 'rail-to-rail' output). For a 5V system, realistic target outputs are 0.2V to 4.5V. For a ±15V dual-rail bench supply, realistic outputs are ±13V.

Worked Bench Problems with Unit Tracking

Let's apply the formula to two common scenarios, tracking units at every step to prevent scaling errors. For deeper theoretical background on how these nodes interact, refer to the All About Circuits differential amplifier tutorial.

Problem 1: Low-Side DC Motor Current Shunt

Scenario: You are monitoring a 12V DC motor. You place a 0.05Ω shunt resistor on the low side (between the motor and ground). The motor draws 4.0A. You want to feed the resulting voltage to an Arduino Nano's 5V ADC, targeting a maximum reading of 3.5V to leave headroom for startup spikes.

  1. Calculate the differential input voltage (V2 - V1):
    Using Ohm's Law: V = I × R
    Vdiff = 4.0 [A] × 0.05 [Ω] = 0.20 [V]
    Since it is low-side, V1 (ground side) = 0.00V, and V2 (load side) = 0.20V.
  2. Determine required Gain (Av):
    Av = Vout / Vdiff
    Av = 3.5 [V] / 0.20 [V] = 17.5 [unitless]
  3. Select Resistor Values:
    We need Rf / Rin = 17.5. Let's choose a standard Rin = 10,000 [Ω] (10kΩ).
    Rf = 17.5 × 10,000 [Ω] = 175,000 [Ω] (175kΩ).
    Bench fix: 175kΩ is not a standard E24 value. Use a 160kΩ resistor in series with a 15kΩ resistor, or use a 100kΩ pot to trim.
  4. Verify with the main formula:
    Vout = (175,000 [Ω] / 10,000 [Ω]) × (0.20 [V] - 0.00 [V])
    Vout = 17.5 × 0.20 [V] = 3.5 [V]

Problem 2: Wheatstone Bridge Strain Gauge

Scenario: A 5V-excited load cell outputs a differential signal. Under a specific load, the non-inverting leg (V2) sits at 2.512V and the inverting leg (V1) sits at 2.488V. You need to amplify this to 2.0V for an ESP32 ADC.

  1. Calculate the differential input:
    Vdiff = 2.512 [V] - 2.488 [V] = 0.024 [V] (24 mV)
  2. Determine required Gain:
    Av = 2.0 [V] / 0.024 [V] = 83.33 [unitless]
  3. Select Resistor Values (Mind the Input Impedance!):
    A load cell has a high output impedance. If we use Rin = 1kΩ, the input impedance on the V2 node (R3 + R4) will be roughly 84kΩ, which might load the bridge and cause non-linearity. Let's use higher values.
    Set Rin = R3 = 10,000 [Ω] (10kΩ).
    Rf = R4 = 83.33 × 10,000 [Ω] = 833,300 [Ω].
    Bench fix: Use an 820kΩ standard resistor and a 20kΩ trimmer potentiometer in series for Rf and R4 to dial in the exact gain and match the ratios perfectly.
  4. Verify with the main formula:
    Vout = (833,300 [Ω] / 10,000 [Ω]) × (2.512 [V] - 2.488 [V])
    Vout = 83.33 × 0.024 [V] = 1.999 [V]

Assumptions, Edge Cases, and CMRR Reality

The formula Vout = (Rf/Rin) × (V2 - V1) is mathematically pure, but the physical world introduces three major edge cases that will ruin your day if you ignore them.

1. Input Common-Mode Voltage Range (ICMR)
Op-amps cannot read voltages outside their power supply rails, and most cannot even read all the way up to the positive rail. If you are powering an LM358 with 5V and 0V, and you try to measure a shunt sitting at 12V (high-side), the op-amp's internal transistors will break down or saturate. The formula will output garbage (usually clipping near 0V or the rail). Solution: Ensure V1 and V2 are within the op-amp's specified ICMR, or use a dedicated high-side current monitor like the INA180.

2. Resistor Thermal Drift
Even if you buy 0.1% resistors, they have a Temperature Coefficient of Resistance (TCR), usually around 25 ppm/°C. If Rf heats up from ambient temperature changes while Rin stays cool, the ratios unmatch. The circuit will suddenly start amplifying the common-mode voltage. Solution: Use matched resistor networks (like the Vishay ACAS series) where all four resistors are printed on the same silicon substrate, guaranteeing they drift together.

3. Input Bias Current Offsets
The formula assumes infinite input impedance. Real op-amps draw a tiny 'input bias current' into their pins. If your Rf and Rin values are massive (e.g., 10MΩ), this tiny current creates a voltage drop across the resistors, generating a phantom offset voltage at the inputs. Solution: Keep resistor values under 100kΩ for bipolar op-amps, or use FET-input op-amps (like the TL072) which have bias currents in the picoamp range.