<!--date=20250217 -->


<h1>Operational Amplifiers</h1>
<p>The op-amp is one of the most useful ICs in analog electronics. A single chip gives you a high-gain differential amplifier that, with a few resistors and capacitors, becomes a precision amplifier, active filter, integrator, comparator, signal conditioner, or oscillator. It's the Swiss Army knife of analog design — understanding op-amp circuits means being able to build almost any linear analog function from scratch.</p>

<h2>The Ideal Op-Amp</h2>

<table>
  <thead><tr><th>Property</th><th>Ideal value</th><th>Typical real value</th><th>Impact of non-ideality</th></tr></thead>
  <tbody>
    <tr><td>Open-loop voltage gain (A_OL)</td><td>Infinite</td><td>10,000–1,000,000</td><td>Negligible with negative feedback</td></tr>
    <tr><td>Input impedance</td><td>Infinite</td><td>10 MΩ – 10 TΩ (FET input)</td><td>Loads the signal source slightly</td></tr>
    <tr><td>Output impedance</td><td>Zero</td><td>10–100 Ω open-loop; ~mΩ with feedback</td><td>Limits drive capability</td></tr>
    <tr><td>Bandwidth</td><td>Infinite</td><td>1 MHz – 1 GHz (gain-dependent)</td><td>Gain falls at high frequency</td></tr>
    <tr><td>Input offset voltage (Vos)</td><td>Zero</td><td>0.1–10 mV</td><td>DC error at output = Vos × gain</td></tr>
    <tr><td>Input bias current</td><td>Zero</td><td>1 pA – 1 µA</td><td>Voltage error across source impedance</td></tr>
    <tr><td>CMRR</td><td>Infinite</td><td>60–120 dB</td><td>Common-mode signals leak through</td></tr>
  </tbody>
</table>

<h2>The Golden Rules (for negative feedback circuits)</h2>
<pre>
1. The output does whatever it must to make V+ = V−  (virtual short)
2. No current flows into either input                 (infinite Zin)
</pre>
<p>Apply these two rules to any op-amp circuit in negative feedback and you can derive the gain without knowing anything else about the part.</p>

<h2>Common Circuit Configurations</h2>

<h3>Inverting Amplifier</h3>
<pre>
         R_f
    ┌───[   ]───┐
    │           │
Vin─[R_in]──(−)─┤── Vout
           (+)──GND

Gain = −R_f / R_in    (negative = phase inverted)

R_in=10kΩ, R_f=100kΩ → Gain = −10
1V in → −10V out

Input impedance = R_in
</pre>

<h3>Non-Inverting Amplifier</h3>
<pre>
Vin ─────(+)
         (−)────┬──── Vout
                │
               [R_f]
                │
               [R_g]
                │
               GND

Gain = 1 + R_f / R_g    (positive = same phase)

R_f=9kΩ, R_g=1kΩ → Gain = 10
1V in → +10V out

Input impedance ≈ infinite (looking into + terminal)
</pre>

<h3>Voltage Follower (Unity-Gain Buffer)</h3>
<pre>
Vin ─────(+)
         (−)────── Vout
           └───────┘  (direct feedback)

Gain = 1
</pre>
<p>The output follows the input exactly in voltage but provides current drive. The critical use: isolating a high-impedance source from a low-impedance load without loading the source. The sensor output doesn't care what's downstream.</p>

<h3>Summing Amplifier (Mixer)</h3>
<pre>
V1─[R1]─┐
V2─[R2]─┼──(−)─┤── Vout
V3─[R3]─┘  │   │
           [R_f]
           (+)──GND

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

If R1=R2=R3=R_f:  Vout = −(V1 + V2 + V3)
</pre>
<p>A simple audio mixer. Each input is independent (virtual ground at −). Adding more input resistors doesn't change the others' gain.</p>

<h3>Difference Amplifier (Subtractor)</h3>
<pre>
V1─[R1]──(−)─┤── Vout
             │
            [R_f]
V2─[R2]──(+)─┤
             │
            [R_g]──GND

If R1=R2=R, R_f=R_g:  Vout = (R_f/R) × (V2 − V1)
</pre>
<p>Amplifies the difference between two signals, rejecting common-mode voltage (CMRR). The basis of instrumentation amplifiers for sensor signals.</p>

<h3>Integrator</h3>
<pre>
Replace R_f with capacitor C:

         C
    ┌───||───┐
    │         │
Vin─[R]──(−)─┴── Vout
        (+)──GND

Vout = −(1/RC) × ∫Vin dt
</pre>
<p>Output is the running integral of the input. A square wave in produces a triangle wave out. Used in PID controllers, waveform generators, ADCs, and signal processing. Without a reset switch across C or high-value parallel resistor, DC drift causes the output to rail.</p>

<h3>Differentiator</h3>
<pre>
Replace R_in with capacitor C:

         R_f
    ┌───[   ]───┐
    │           │
Vin─||──(−)────┴── Vout
C      (+)──GND

Vout = −R_f × C × dVin/dt
</pre>
<p>Output proportional to rate of change. Edge detector — a sudden step produces a spike at the output. Sensitive to noise (noise is fast = high derivative); usually needs an input resistor to limit high-frequency gain.</p>

<h3>Comparator (Open-Loop)</h3>
<pre>
No feedback. Output slams to +rail or −rail.
V_ref─(−)
      (+)─── Vout: rail-to-rail depending on which input is higher
Vin──(+)
</pre>
<p>Use a dedicated comparator IC (LM393, LM339, TLV1801) instead of an op-amp for this — comparators have faster response, open-collector outputs, and are designed not to latch. An op-amp used as a comparator often has slow response and can oscillate in the transition region.</p>

<h2>Common Op-Amp ICs</h2>

<table>
  <thead><tr><th>Part</th><th>Supply</th><th>GBW</th><th>Vos</th><th>Notes</th></tr></thead>
  <tbody>
    <tr><td>LM741</td><td>±15V</td><td>1 MHz</td><td>1–6 mV</td><td>Historic, teaching only — poor in modern designs. High offset, limited bandwidth.</td></tr>
    <tr><td>LM358</td><td>3–32V single</td><td>1 MHz</td><td>3 mV</td><td>Single-supply, two channels. Cheap and everywhere. Slow, limited rail-to-rail.</td></tr>
    <tr><td>TL071 / TL081</td><td>±15V</td><td>3 MHz</td><td>3 mV</td><td>JFET input — high input impedance, low bias current. Audio, general analog.</td></tr>
    <tr><td>NE5532</td><td>±5 to ±15V</td><td>10 MHz</td><td>0.5 mV</td><td>Low noise, high drive current. The studio audio standard.</td></tr>
    <tr><td>OPA2134</td><td>±2.5 to ±18V</td><td>8 MHz</td><td>0.05 mV</td><td>Low distortion, JFET input. Hi-fi audio.</td></tr>
    <tr><td>AD8620</td><td>±2.3 to ±16.5V</td><td>25 MHz</td><td>0.025 mV</td><td>Precision FET, very low noise and offset.</td></tr>
    <tr><td>MCP6002</td><td>1.8–6V single</td><td>1 MHz</td><td>3 mV</td><td>Rail-to-rail, microcontroller compatible. Microchip's workhorse for 3.3V/5V systems.</td></tr>
    <tr><td>LMV321</td><td>2.7–5V single</td><td>1 MHz</td><td>7 mV</td><td>Single-supply, tiny packages. Sensor conditioning near microcontrollers.</td></tr>
  </tbody>
</table>

<h2>Gain-Bandwidth Product</h2>
<pre>
GBW = open-loop gain × frequency  (constant for a given op-amp)

A_v_max at frequency f:  A_v = GBW / f

Example: TL071 GBW = 3 MHz
  At f=30 kHz: max gain = 3,000,000 / 30,000 = 100
  At f=300 kHz: max gain = 10
  At f=3 MHz: max gain = 1

Always check: GBW / desired_gain  >  highest signal frequency + margin
</pre>

<h2>Single-Supply Operation</h2>
<p>Many op-amps require dual supplies (±12V, ±15V). For single-supply operation (5V or 3.3V), use a rail-to-rail op-amp and create a virtual ground at V_supply/2 for the signal reference:</p>
<pre>
V_supply ──[R1]──┬── V_ref (= V_supply/2)
                 │
                [R2]
                 │
                GND

Buffer V_ref with a voltage follower to provide low impedance.
AC-couple the input and output with capacitors to block DC bias.
</pre>

<h2>References</h2>
<ul>
  <li>Horowitz &amp; Hill — <em>The Art of Electronics</em>, 3rd ed. Chapters 4–5</li>
  <li>Franco — <em>Design with Operational Amplifiers and Analog Integrated Circuits</em>, 4th ed.</li>
  <li><a href="https://www.ti.com/lit/an/sloa011b/sloa011b.pdf" target="_blank" rel="noopener">Texas Instruments — Op Amp Applications (PDF) ↗</a></li>
  <li><a href="https://www.analog.com/en/education/education-library/op-amp-applications-handbook.html" target="_blank" rel="noopener">Analog Devices — Op Amp Applications Handbook ↗</a></li>
</ul>
