A subtracting op amp—more formally known as a difference amplifier—is an operational amplifier circuit configured to output a voltage strictly proportional to the difference between its two input signals, while actively rejecting any voltage common to both inputs. The direct answer for the standard unity-gain configuration is that the output voltage is calculated as Vout = Vnon-inv - Vinv. When scaled by resistor ratios, the formula becomes Vout = (Rf / Rin) × (V2 - V1).

This topology is the backbone of high-side current sensing, bridge sensor readouts, and ground-loop isolation. However, building one that actually works on the bench requires more than just copying a textbook schematic; it requires selecting the right silicon, matching your resistors, and understanding the input common-mode voltage limits.

The Subtracting Op Amp: Core Concept and Pinout Topology

Unlike an inverting or non-inverting amplifier that grounds one of the op amp's inputs, the subtracting configuration feeds active signals into both the inverting (-) and non-inverting (+) pins. The feedback network and the ground-reference network must be perfectly balanced to achieve high Common-Mode Rejection Ratio (CMRR).

Bench Tip: The "subtraction" happens because the inverting input processes V1 with a negative gain, while the non-inverting input processes V2 with a positive gain (attenuated by the input divider). When superimposed, the common-mode voltages cancel out, leaving only the differential voltage multiplied by the gain.

For standard dual-op-amp ICs in an 8-pin DIP or SOIC package, the pinout you will be working with is:

  • Pin 1: Output A (Channel 1)
  • Pin 2: Inverting Input (-) A
  • Pin 3: Non-Inverting Input (+) A
  • Pin 4: V- (Negative Supply or Ground)
  • Pin 5: Non-Inverting Input (+) B
  • Pin 6: Inverting Input (-) B
  • Pin 7: Output B (Channel 2)
  • Pin 8: V+ (Positive Supply)

When wiring a single subtracting stage, you will typically use Channel A (Pins 1, 2, 3) and tie the unused Channel B inputs to ground or the appropriate supply rail to prevent high-frequency oscillation.

Safe Default Part Numbers and Operating Regions

Selecting the right op amp for a subtracting circuit depends entirely on your supply rails and the common-mode voltage of the signal you are measuring. If you try to measure a 12V motor current shunt using an op amp powered by a single 5V rail, the input stage will saturate, and the circuit will fail. Always check the Texas Instruments LM358 Datasheet or equivalent to verify the "Input Common-Mode Voltage Range" (VCM).

Here are the safe default part numbers for 2026, categorized by their operation regions and typical bench applications:

Part NumberSupply Region (V)Quiescent Current (Iq)Gain Bandwidth (GBW)Best Application
LM358Single 3V-32V / Dual ±1.5V-16V~0.7 mA per channel1 MHzLow-cost, single-supply general purpose. Inputs can swing to the negative rail (ground).
TL072Dual ±5V to ±18V~1.4 mA per channel3 MHzAudio, high-impedance sensors. JFET inputs offer very low bias current.
OPA211Dual ±4.5V to ±18V~3.6 mA per channel45 MHzPrecision DC, low-noise strain gauges. Extremely low offset voltage (50 µV max).
INA138Single 2.7V to 36V~25 µA400 kHzSpecialized high-side current sense (internal matched resistors).

How to bias and select: If your signal sits on top of a high DC voltage (like a 24V battery pack), you must use an op amp rated for high common-mode voltage, or use a dedicated difference amplifier IC with internal precision resistors. As detailed in the Analog Devices Difference Amplifier Guide, discrete resistor mismatches will destroy your CMRR, making dedicated ICs preferable for high-voltage industrial loops.

Complete Application Circuit: High-Side Current Shunt Monitor

The most common real-world use for a subtracting op amp is measuring the voltage drop across a high-side shunt resistor to monitor load current without breaking the ground plane. Below is a complete, bench-tested design for measuring a 0A to 10A load on a 12V nominal system.

Component List

  • U1: OPA211 (Precision, dual supply or single high-voltage supply op amp)
  • Rshunt: 0.05Ω, 5W power resistor (Yields 0V to 0.5V drop at 10A)
  • R1, R3 (Input Resistors): 10kΩ, 0.1% tolerance, metal film
  • R2, R4 (Feedback/Ground Resistors): 10kΩ, 0.1% tolerance, metal film
  • C1: 100nF (0.1µF) X7R ceramic capacitor
  • C2: 10µF tantalum or low-ESR electrolytic capacitor

Wiring and Assembly Steps

  1. Place the Shunt: Insert Rshunt in series with the positive supply line going to your load. The side closest to the power source is V2; the side closest to the load is V1.
  2. Wire the Non-Inverting Input: Connect V2 to Pin 3 (IN+) through R3 (10kΩ). Connect a 10kΩ resistor (R4) from Pin 3 to circuit ground.
  3. Wire the Inverting Input: Connect V1 to Pin 2 (IN-) through R1 (10kΩ). Connect the feedback resistor R2 (10kΩ) from Pin 2 to Pin 1 (Output).
  4. Power the IC: Connect Pin 8 (V+) to a 12V or 15V clean supply. Connect Pin 4 (V-) to circuit ground (if single supply) or a negative rail (if dual supply). Note: The OPA211 requires a minimum of ±4.5V or a single 9V supply. If you only have 5V, substitute the OPA211 with an LMV321 (single supply, rail-to-rail).
  5. Decouple the Rails: Solder C1 (100nF) and C2 (10µF) directly across Pin 8 and Pin 4, as physically close to the IC as possible.
  6. Verify Output: With 0A load, Vout should be 0V. At 10A load, the shunt drops 0.5V. With a gain of 1 (R2/R1 = 10k/10k), Vout will read exactly 0.5V, which is perfect for feeding into a 3.3V microcontroller ADC.

Bench Testing: Failure Modes and Multimeter Diagnostics

When a subtracting op amp fails on the bench, it rarely explodes. Instead, it silently outputs garbage data. Here is how to diagnose it with a standard digital multimeter (DMM).

Warning: The LM358 Phase Reversal Trap
If you use an LM358 and the input voltage drops below the negative rail by more than 0.3V (e.g., during a ground fault or transient spike), the internal parasitic diodes forward-bias, and the output will violently snap to the positive voltage rail. If your output is pegged high when it should be near zero, check for negative transients on your inputs.

Step-by-Step Multimeter Diagnostics

  1. Power-Off Continuity Check: With the circuit de-energized, set your DMM to resistance mode. Measure across R1 and R2 to ensure they haven't drifted or opened. Measure from Pin 2 and Pin 3 to ground to ensure no accidental solder bridges are shorting the inputs.
  2. Verify Supply Rails: Power the circuit. Set the DMM to DC Voltage. Probe Pin 8 and Pin 4. You must read the exact expected supply voltage. If Pin 8 reads low, the op amp may be shorted internally, or your decoupling caps are failing.
  3. Check Common-Mode Voltages: Probe Pin 2 and Pin 3 relative to ground. Both pins should sit at roughly half the common-mode voltage of your signal (due to the resistor dividers). If one pin reads 0V while the other reads 6V, a trace is broken or a resistor is missing.
  4. Measure the Output Offset: Short V1 and V2 together (0V differential input). Probe Pin 1. A healthy precision op amp will read < 1mV. If you read 50mV or more, your 1% resistors are mismatched, or the op amp's input offset voltage (Vos) is too high for your application.

Frequently Asked Questions

Why is my subtracting op amp output pegged to the positive rail?

This almost always means you have exceeded the Input Common-Mode Voltage Range (VCM). If you are measuring a 24V signal but your op amp is powered by a 5V single supply, the internal input transistors will saturate. The fix is to either use an op amp rated for high common-mode voltages (like the LM358, which tolerates up to 32V on the inputs regardless of the supply), or use a high-voltage resistor divider before the op amp inputs to scale the common-mode voltage down while preserving the differential difference.

Can I use an LM358 for high-precision subtracting applications?

No. While the LM358 is cheap and robust, its maximum input offset voltage (Vos) is 3mV to 5mV depending on the manufacturer and temperature. In a high-side current sense circuit with a 50mΩ shunt, a 10A load generates a 500mV signal. A 3mV offset introduces a 0.6% error at full scale, but at a 1A load (50mV signal), that same 3mV offset creates a massive 6% error. For precision subtraction, use a chopper-stabilized op amp like the OPA2188 or a dedicated instrumentation amplifier.

How do I calculate the input impedance of a subtracting op amp?

The input impedance of a standard difference amplifier is simply the value of the input resistors (R1 and R3). If you use 10kΩ resistors, your circuit presents a 10kΩ load to the signal source. This can be problematic if you are measuring a high-impedance source like a piezo sensor or a thermistor bridge, as the op amp will load the source and cause measurement errors. To fix this, you must add unity-gain buffer op amps to both inputs before the subtraction stage, creating a standard 3-op-amp instrumentation amplifier topology.

What happens if the resistors in the difference amplifier are not perfectly matched?

Resistor mismatch destroys the Common-Mode Rejection Ratio (CMRR). If R1/R2 does not perfectly equal R3/R4, a portion of the common-mode voltage will leak through to the output as an error voltage. Using standard 1% tolerance resistors yields a worst-case CMRR of roughly 48dB. Upgrading to 0.1% precision resistors pushes the CMRR to about 60dB. If you need >80dB of CMRR to reject 50/60Hz mains hum in an industrial environment, discrete resistors will not suffice; you must use a monolithic difference amplifier IC where the resistors are laser-trimmed on the silicon die.