Operational amplifiers

Amplification & analog design · tree view

An op-amp is a differential amplifier with a huge internal gain; negative feedback forces its two inputs to almost equal voltages (the "virtual short"), and that one fact predicts inverting amps, summers, comparators and integrators.

Prerequisites

op-amp symbol
op-amp
resistor symbol
resistor
capacitor symbol
capacitor
inverting-noninverting.svg
inverting-noninverting.svg
summer.svg
summer.svg
integrator.svg
integrator.svg

The operational amplifier is arguably the most useful single device in analog electronic circuitry. With only a handful of external components, it can be made to perform a wide variety of analog signal processing tasks.

— Tony R. Kuphaldt, Lessons In Electric Circuits, Vol. III (Semiconductors), Chapter 8, section “Introduction” source

For all practical purposes, we can say that the output of an op-amp will be saturated fully positive if the (+) input is more positive than the (-) input, and saturated fully negative if the (+) input is less positive than the (-) input.

— Tony R. Kuphaldt, Lessons In Electric Circuits, Vol. III (Semiconductors), Chapter 8, section “The ‘operational’ amplifier” (comparator) source

Let's say that our op-amp has a differential voltage gain of 200,000. If Vin equals 6 volts, the output voltage will be 5.999970000149999 volts. This creates just enough differential voltage (6 volts - 5.999970000149999 volts = 29.99985 µV) to cause 5.999970000149999 volts to be manifested at the output terminal, and the system holds there in balance.

— Tony R. Kuphaldt, Lessons In Electric Circuits, Vol. III (Semiconductors), Chapter 8, section “Negative feedback” (the virtual short) source

By grounding the noninverting input, the negative feedback from the output seeks to hold the inverting input's voltage at 0 volts, as well. For this reason, the inverting input is referred to in this circuit as a virtual ground, being held at ground potential (0 volts) by the feedback, yet not directly connected to (electrically common with) ground.

— Tony R. Kuphaldt, Lessons In Electric Circuits, Vol. III (Semiconductors), Chapter 8, section “Divided feedback” (virtual ground) source

However, with all resistor values equal to each other, the currents through each of the three resistors will be proportional to their respective input voltages. Since those three currents will add at the virtual ground node, the algebraic sum of those currents through the feedback resistor will produce a voltage at Vout equal to V1 + V2 + V3, except with reversed polarity. The reversal in polarity is what makes this circuit an inverting summer:

— Tony R. Kuphaldt, Lessons In Electric Circuits, Vol. III (Semiconductors), Chapter 8, section “Averager and summer circuits” source

However, if we apply a constant, positive voltage to the input, the op-amp output will fall negative at a linear rate, in an attempt to produce the changing voltage across the capacitor necessary to maintain the current established by the voltage difference across the resistor. Conversely, a constant, negative voltage at the input results in a linear, rising (positive) voltage at the output. The output voltage rate-of-change will be proportional to the value of the input voltage.

— Tony R. Kuphaldt, Lessons In Electric Circuits, Vol. III (Semiconductors), Chapter 8, section “Differentiator and integrator circuits” source

So, an op-amp with positive feedback tends to stay in whatever output state its already in. It "latches" between one of two states, saturated positive or saturated negative. Technically, this is known as hysteresis.

— Tony R. Kuphaldt, Lessons In Electric Circuits, Vol. III (Semiconductors), Chapter 8, section “Positive feedback” source
Show alternative explanations

Practical operational amplifier voltage gains are in the range of 200,000 or more, which makes them almost useless as an analog differential amplifier by themselves.

— Tony R. Kuphaldt, Lessons In Electric Circuits, Vol. III (Semiconductors), Chapter 8, section “The ‘operational’ amplifier” source

When the output of an op-amp is directly connected to its inverting (-) input, a voltage follower will be created. Whatever signal voltage is impressed upon the noninverting (+) input will be seen on the output.

— Tony R. Kuphaldt, Lessons In Electric Circuits, Vol. III (Semiconductors), Chapter 8, “Negative feedback” (review: the voltage follower) source

An op-amp with negative feedback will try to drive its output voltage to whatever level necessary so that the differential voltage between the two inputs is practically zero. The higher the op-amp differential gain, the closer that differential voltage will be to zero.

— Tony R. Kuphaldt, Lessons In Electric Circuits, Vol. III (Semiconductors), Chapter 8, “Negative feedback” (review) source

Negative feedback creates a condition of equilibrium (balance). Positive feedback creates a condition of hysteresis (the tendency to "latch" in one of two extreme states).

— Tony R. Kuphaldt, Lessons In Electric Circuits, Vol. III (Semiconductors), Chapter 8, “Positive feedback” (review) source

Gain prediction from the virtual short: inverting vs non-inverting

Ideal rule: negative feedback drives the two inputs to (almost) the same voltage, so treat V+ = V− and take no input current. Rails ±15 V (assume output clamps there). Inverting stage: input resistor R_in from v_in to the − node, feedback R_f from − node to v_out, + grounded. Non-inverting stage: v_in straight to +, divider R_f (out→−) and R_g (−→ground). Final row is the book's finite-gain check: A_ol = 200,000 follower.

To predict the outcome:

  1. Assume the virtual short: V− = V+ (inverting stage: V− = 0 V, a virtual ground).
  2. Inverting: the current V_in/R_in must all flow through R_f, so V_out = −(R_f/R_in)·V_in.
  3. Non-inverting: the divider forces V− = V_out·R_g/(R_f+R_g); setting V− = V_in gives V_out = (1 + R_f/R_g)·V_in.
  4. Follower: R_f = 0 → gain exactly 1. Clamp any prediction to the ±15 V rails.
  5. Finite-gain check: a real A_ol needs a tiny differential; V_out = V_in·A_ol/(1+A_ol) for the follower.
configurationa_olr_in_r_gr_fpredicted_gainv_inpredicted_v_out
invertingideal10 kΩ100 kΩ−10.0+0.50 V−5.00 V
invertingideal1 kΩ4.7 kΩ−4.7−0.20 V+0.94 V
inverting (unity)ideal22 kΩ22 kΩ−1.0+1.20 V−1.20 V
non-invertingideal10 kΩ (R_g)100 kΩ+11.0+0.50 V+5.50 V
non-invertingideal1 kΩ (R_g)4.7 kΩ+5.7+0.50 V+2.85 V
follower (R_f = 0)ideal—0 Ω+1.0+0.50 V+0.50 V
follower, finite gain200,000—0 Ω0.9999950+6.000000 V+5.999970 V (inputs differ by 29.99985 µV)

Comparator output verdicts

No feedback at all: the bare op-amp compares its two inputs with gain ≈200,000. With ±15 V rails it slams to +15 V (a 741 actually reaches only about +14 V/−13 V) whenever the inputs differ by more than a hair (15 V / 200,000 = 75 µV decides the state).

To predict the outcome:

  1. Identify what is on the noninverting (+) input and what is on the inverting (−) input.
  2. If V+ > V− the output saturates HIGH (+V_sat); if V+ < V− it saturates LOW (−V_sat).
  3. If they are within tens of µV of each other, the state is indeterminate — noise decides, and the output may chatter.
  4. Feed a ramping wave (sine, triangle) into one input and a fixed reference into the other: the output is a square wave whose timing is set by the crossing points.
conditionv_plusv_minusoutput_stateoutcome
comparator3.0 V1.0 V+15 V (HIGH)Verdict: V+ above V− → logic/alarm ON
comparator0.5 V2.7 V−15 V (LOW)Verdict: V+ below V− → output OFF
comparator, inputs equal2.500 V2.500 VindeterminateVerdict: ±75 µV of noise flips the state — add hysteresis (positive feedback)
square-wave converter0 V (reference)1 V-peak sinesquare waveVerdict: output flips each zero crossing → 50% duty square wave at the sine's frequency
low-battery alarm8.5 V (reference)V_bat+15 V at V_bat = 8.2 VVerdict: battery sags below 8.5 V → V+ > V− → alarm LED lights
low-battery alarm, battery healthy8.5 V (reference)V_bat = 9.0 V−15 V (LOW)Verdict: V− above V+ → no alarm

Inverting summer (audio mixer) output prediction

Inverting configuration with several input resistors tied to the same virtual-ground − node; feedback resistor R_f from − node to output. Each input contributes its own current independently — the op-amp node adds them. Rails ±15 V.

To predict the outcome:

  1. Because the − node is a virtual ground, each input drives current V_i/R_i into the node with no interaction between inputs.
  2. All of that current must flow through R_f, so V_out = −R_f·(V_1/R_1 + V_2/R_2 + V_3/R_3).
  3. Equal resistors give V_out = −(V_1+V_2+V_3) — the average-times-3 trick with a passive averager feeding a gain-of-3 stage.
  4. Clamp to the rails: if the demanded sum exceeds ±15 V the output clips and the mix distorts.
v_1v_2v_3resistorspredicted_v_outoutcome
+1.00 V+2.00 V+3.00 Vall 10 kΩ, R_f = 10 kΩ−6.00 Vclean sum, inverted
+0.70 V−0.30 V+1.50 Vall 10 kΩ, R_f = 10 kΩ−1.90 Valgebraic sum — opposite inputs cancel
+2.00 V+2.00 V+2.00 Vall 10 kΩ, R_f = 10 kΩ−6.00 Vequal inputs: passive average 2 V × gain 3 = 6 V
+1.00 V (10 kΩ)+0.50 V (20 kΩ)+2.00 V (10 kΩ)weighted, R_f = 10 kΩ−3.25 Vchannel 2 mixed at half level — resistors set the mix
+5.00 V+5.00 V+5.00 Vall 10 kΩ, R_f = 10 kΩdemands −15 Vclips at −V_sat — the mix saturates instead of summing

Integrator ramp prediction

Integrator: R = 10 kΩ from v_in to the − node, C = 100 nF from the − node to v_out (last row uses R = 47 kΩ, C = 10 µF). A constant input forces a constant current V_in/R through the capacitor, so the output ramps linearly at dV_out/dt = −V_in/(RC). Rails ±15 V.

To predict the outcome:

  1. Compute the capacitor current: I = V_in / R (the − node is a virtual ground).
  2. The output moves just fast enough to keep that current flowing: rate = −I/C = −V_in/(RC).
  3. Multiply the rate by elapsed time to get V_out(t) = −V_in·t/(RC); stop at the rails.
  4. Flip the input polarity and the ramp direction flips; a 0 V input freezes the output wherever it is.
v_inr_and_cramp_ratev_out_after_5_msv_out_after_10_msoutcome
−1.00 V10 kΩ, 100 nF+1000 V/s+5.00 V+10.00 Vrises until it clamps at +15 V at t = 15 ms
+0.50 V10 kΩ, 100 nF−500 V/s−2.50 V−5.00 Vnegative-going ramp, slope scales with input
−2.00 V47 kΩ, 10 µF+4.26 V/s+0.02 V+0.04 Vbig RC → slow totalizer-style ramp
0 V10 kΩ, 100 nF0 V/sholdsholdsno current, no charge, output frozen (at whatever it had reached)

Candidate projects — awaiting review

  • Build a 3-input inverting audio mixer (summing amp): mix two phone/music sources plus a mic through 10 kΩ input resistors, predict the combined output level, then check the sum and the clipping point on a scope. (r/AskElectronics — “Op-amps for audio applications” (small audio mixer + synth plans), community)
  • Comparator alarm bank: a low-battery/light-level comparator with an LED, then add a feedback resistor for hysteresis and watch the chatter disappear. (r/AskElectronics — “Looking for project ideas using OP-AMPS”, community)
  • Bargraph light meter: five op-amp comparators with staggered reference voltages driving five LEDs — the classic stereo-tuner bargraph, built and calibrated on the bench. (Kuphaldt, Lessons In Electric Circuits Vol. III Ch. 8 (comparator bargraph driver, flash converter), book)
  • Function generator: an op-amp Schmitt trigger (positive feedback) feeding an integrator, producing square and triangle waves whose frequency you can dial with one resistor. (Kuphaldt, Lessons In Electric Circuits Vol. III Ch. 8 (integrator + positive-feedback oscillator), book)