Operational Amplifiers

The op-amp is one of the most useful ICs in analog electronics. A single chip gives you a high-gain differential amplifier that, combined with a few resistors, becomes a precision amplifier, filter, integrator, comparator, or oscillator. The classic LM741 taught a generation of engineers op-amp circuits, though the TL071, LM358, and TLV2371 are better choices for most modern work.

The Ideal Op-Amp

Two inputs: inverting (−) and non-inverting (+). One output. The output tries to be whatever voltage makes the two inputs equal — that's negative feedback in action. The ideal op-amp has:

  • Infinite open-loop gain (in practice: 100,000 to 1,000,000)
  • Infinite input impedance — draws no current from the inputs
  • Zero output impedance — can drive any load
  • Infinite bandwidth — in practice, limited by the gain-bandwidth product (GBW)

Real op-amps don't hit these ideals, but for most audio and low-frequency work, the ideal assumptions are close enough.

The Golden Rules (for negative feedback circuits)

1. The output does whatever it must to make V+ = V−
2. No current flows into either input

Apply these two rules to any op-amp circuit and you can derive the gain formula without knowing anything else about the device.

Inverting Amplifier

         R_f
    ┌───[   ]───┐
    |           |
Vin─[R_in]─────●──── Vout
            V− |
               (−) op-amp (+)──── GND
                    |
                   Vout
Gain = −R_f / R_in

Example: R_in=10kΩ, R_f=100kΩ
Gain = −100k/10k = −10

A 1V input gives −10V output (inverted and amplified)

The minus sign means the output is 180° out of phase with the input — an inverting amplifier. If you don't want the inversion, use a non-inverting configuration.

Non-Inverting Amplifier

Vin ─────────(+) op-amp (−)─────── Vout
                        |
                       [R_f]
                        |
                       [R_g]── GND

Gain = 1 + R_f / R_g
Example: R_f=9kΩ, R_g=1kΩ
Gain = 1 + 9k/1k = 10

A 1V input gives +10V output (same phase)

Voltage Follower (Unity Gain Buffer)

Vin ─────(+) op-amp (−)─── Vout
                  └──────────┘
                  (output fed back directly to −)

Gain = 1

The output follows the input exactly. This sounds useless but it's very useful — the op-amp's high input impedance doesn't load the source, and its low output impedance can drive a low-impedance load. It's an impedance buffer.

Summing Amplifier

V1─[R1]─┐
V2─[R2]─┼────(−) op-amp (+)─GND─── Vout
V3─[R3]─┘         |
                  [R_f]
                   |
                  Vout

Vout = −R_f × (V1/R1 + V2/R2 + V3/R3)

If all resistors are equal: Vout = −(V1 + V2 + V3). A mixer — combines signals. Used in audio mixers, DACs, and analog computers.

Comparator

No negative feedback — run the op-amp open-loop. The output goes to the positive rail if V+ > V−, and to the negative rail if V+ < V−. Use for threshold detection: "is this voltage above 2.5V?"

In practice, use a dedicated comparator IC (LM393, LM339) rather than a general-purpose op-amp for this. Comparators are optimised for fast switching and usually have open-collector outputs that work well with logic levels.

Integrator

Replace R_f with a capacitor:

         C
    ┌───||───┐
    |         |
Vin─[R]──────(−) op-amp (+)─GND─── Vout

Vout = −(1/RC) × ∫Vin dt

The output is the integral of the input. Used in signal processing, waveform generators, and PID controllers. Needs a reset switch across C or it drifts to the supply rail on DC inputs.

Gain-Bandwidth Product

The open-loop gain of a real op-amp falls with increasing frequency. The gain-bandwidth product (GBW) is constant: if you configure for gain=10, the usable bandwidth is GBW/10. A TL071 with GBW=3MHz configured for gain=100 is only useful to 30kHz. Check the datasheet and make sure GBW/gain > your required bandwidth with margin.