N5JLD dot NET

What I do in my Spare Time

User Tools

Site Tools


electronics:components:ops

Electronics Reference: Operational Amplifiers (Op-Amps)

OP-AMP DESIGN MANDATE: Operational amplifiers are high-gain differential voltage amplifiers used for sensor signal conditioning, active filtering, current sensing, and analog math. Always verify whether your circuit uses dual split supplies ($\pm V$) or a single supply ($+V_{CC}$ / `GND`), check Input Common-Mode Voltage Range ($V_{CM}$), and never leave unused op-amp channels floating.

1. Ideal Op-Amp Golden Rules

An op-amp has two inputs—the Non-Inverting input ($V_+$) and the Inverting input ($V_-$)—and one Output ($V_{OUT}$). When configured with Negative Feedback (connecting $V_{OUT}$ back to $V_-$ through a resistor or network), an ideal op-amp obeys two fundamental rules:

  1. Zero Input Current: Virtually zero current flows into or out of the $V_+$ and $V_-$ input terminals because input impedance ($Z_{in}$) is extremely high ($10^6\ \Omega$ to $10^{12}\ \Omega$).
  2. Virtual Short Rule ($V_+ = V_-$): The op-amp continuously adjusts its output voltage so that the voltage difference between the two input terminals is zero ($V_+ - V_- \approx 0\text{ V}$).
OPEN-LOOP / POSITIVE FEEDBACK EXCEPTION: If an op-amp has no negative feedback (open-loop) or uses positive feedback (output fed back to $V_+$), the Golden Rules do not apply. The output will slam into either the positive supply rail ($+V_{sat}$) or negative supply rail ($-V_{sat}$), acting as a Comparator or Schmitt Trigger.

2. Essential Op-Amp Topologies & Gain Formulas

Use the reference matrix below to build standard analog signal-conditioning stages:

Circuit Topology Input Terminal Used Closed-Loop Gain ($A_v$) / Output Formula Input Impedance ($Z_{in}$) Primary Applications
Voltage Follower (Unity-Gain Buffer) $V_+$ (Output tied directly to $V_-$) $V_{OUT} = V_{IN}$ ($A_v = 1$) Extremely High ($> 109\ \Omega$) Isolating high-impedance sensors (pH probes, piezo, voltage dividers) from heavy ADC loads
Non-Inverting Amplifier $V_+$ (Feedback divider $R_f, R_g$ on $V_-$) $V_{OUT} = V_{IN} \left(1 + \frac{R_f}{R_g}\right)$ Extremely High Amplifying weak positive sensor signals without loading the source; preserves signal phase
Inverting Amplifier $V_-$ through $R_{in}$ ($V_+$ tied to `GND` or $V_{ref}$) $V_{OUT} = -V_{IN} \left(\frac{R_f}{R_{in}}\right)$ Equal to $R_{in}$ Precision scaling, attenuating signals ($R_f < R_{in}$), virtual-ground summing
Inverting Summing Amplifier Multiple inputs ($V_1, V_2 \dots$) through $R_1, R_2 \dots$ into $V_-$ $V_{OUT} = -R_f \left(\frac{V_1}{R_1} + \frac{V_2}{R_2} + \dots\right)$ $R_1, R_2 \dots$ per channel Audio/signal mixing, adding DC offset bias to AC signals, simple R-2R DACs
Differential Amplifier Both $V_+$ and $V_-$ via matched resistor pairs ($R_1, R_2$) $V_{OUT} = \frac{R_2}{R_1}(V_2 - V_1)$ Moderate ($R_1$ / $R_1 + R_2$) High-side shunt current sensing, Wheatstone bridge amplification, rejecting common-mode noise
Integrator (Active Low-Pass) $V_-$ through $R_{in}$; capacitor $C_f$ in feedback loop $V_{OUT} = -\frac{1}{R_{in}C_f} \int V_{IN}\,dt$ Equal to $R_{in}$ Triangle/ramp wave generation, analog PID controllers, charge integration
Differentiator (Active High-Pass) $V_-$ through $C_{in}$; resistor $R_f$ in feedback loop $V_{OUT} = -R_f C_{in} \frac{dV_{IN}}{dt}$ Capacitive Edge detection, rate-of-change sensing (requires small series input resistor to prevent oscillation)

3. Critical Datasheet Specifications

Selecting the wrong op-amp for a low-voltage or single-supply circuit is a common source of clipping and offset errors. Always check these five parameters:

  • Rail-to-Rail Input & Output (RRIO):
    • Legacy op-amps (such as `LM741`, `TL072`, or `LM358`) cannot swing their outputs all the way to the positive supply rail—they typically stop `1.2 V` to `2.0 V` below $+V_{CC}$.
    • For `3.3 V` or `5.0 V` microcontroller ADC interfacing, choose a Rail-to-Rail Input/Output (RRIO) op-amp (e.g., `MCP6002`, `TLV9062`, `OPA344`) so signals can swing within millivolts of both `GND` and $+V_{CC}$.
  • Input Common-Mode Voltage Range ($V_{CM}$): Specifies the allowable voltage range at $V_+$ and $V_-$. Exceeding $V_{CM}$ on certain op-amps (e.g., `TL072`) causes Phase Reversal, where the output suddenly flips to the opposite supply rail.
  • Input Offset Voltage ($V_{OS}$): The tiny internal mismatch between input transistors (typically `1 mV – 5 mV` on general-purpose chips; `< 50 µV` on precision zero-drift/chopper op-amps like `OPA333`). Remember that DC offset is multiplied by your closed-loop noise gain ($V_{out(error)} = V_{OS} \times [1 + R_f/R_g]$).
  • Gain-Bandwidth Product (GBWP): Defines the frequency trade-off between gain and bandwidth (`Bandwidth = GBWP ÷ Closed-Loop Gain`). Example: A `1 MHz` GBWP op-amp configured for a gain of `100` has a `-3 dB` bandwidth of only `10 kHz`.
  • Slew Rate ($SR$ — measured in `V/µs`): The maximum rate at which the output voltage can change. If an op-amp's slew rate is too slow for a high-frequency, large-amplitude signal, a sine wave distorts into a triangle wave.

4. Single-Supply vs. Dual-Supply Operation

Op-amps do not have a dedicated “Ground” pin—they only see the total voltage difference between their $+V$ and $-V$ power pins:

4.1 Dual-Supply ($\pm 12\text{ V}$ or $\pm 15\text{ V}$)

  • Allows AC signals (audio, bipolar sensors) to swing symmetrically above and below `0 V GND` without needing DC bias networks.

4.2 Single-Supply ($+3.3\text{ V}$ or $+5.0\text{ V}$ and `GND`)

When powering an op-amp from a single positive supply and `GND`, negative output voltages are impossible (`0 V` is the floor):

  1. Create a Virtual Ground ($V_{ref} = V_{CC}/2$): Use two equal precision resistors (e.g., two `10 kΩ` `1%` resistors) between $+V_{CC}$ and `GND`, bypassed to ground with a `10 µF` capacitor (and buffered with a spare op-amp voltage follower if driving multiple stages).
  2. AC-Couple Inputs & Outputs: Place series DC-blocking capacitors (`1 µF – 10 µF`) at the input and output, referencing the op-amp's non-inverting bias point to $V_{CC}/2$ so AC waveforms swing cleanly around mid-supply (`1.65 V` on a `3.3 V` rail).

5. Common Op-Amp Families & Selection Guide

Part Number Supply Range Architecture / Specialty Rail-to-Rail? Typical Applications
`LM358` / `LM324` `3 V – 32 V` (Single/Dual) General-purpose bipolar (Dual / Quad) Input includes `GND` (not $+V$); Output swings to `GND` Low-cost DC sensor amplification, battery monitors, basic voltage followers
`TL072` / `TL082` `7 V – 36 V` ($\pm 3.5\text{ V}$ to $\pm 18\text{ V}$) JFET-input, low noise, high slew rate (`13 V/µs`) No (needs ≥ `1.5 V – 2 V` headroom from rails) Audio preamps, active filters, high-impedance instrumentation
`MCP6002` / `MCP6004` `1.8 V – 6.0 V` (Single) Low-power CMOS (`1 MHz` GBWP) Yes (Full RRIO) `3.3 V` / `5.0 V` Arduino/STM32/ESP32 sensor conditioning & ADC buffers
`OPA2134` / `NE5532` `5 V – 36 V` ($\pm 2.5\text{ V}$ to $\pm 18\text{ V}$) Ultra-low distortion (`0.00008%` THD), high-current drive No Hi-Fi audio, precision active crossovers, studio line drivers
`INA219` / `INA180` `2.7 V – 5.5 V` (Senses up to `26 V+`) Dedicated Current-Sense Amplifier (matched internal resistors) Yes High-side battery current monitoring in drones, robotics, and power supplies
`LM393` / `LM339` `2 V – 36 V` (Single/Dual) Dedicated Voltage Comparator (Open-Collector output) Input includes `GND` Zero-crossing detectors, window comparators, over-voltage trip circuits (requires output pull-up resistor)

6. Practical PCB Layout & Stability Rules

  1. Properly Terminate Unused Op-Amp Channels: On dual (`8-pin`) or quad (`14-pin`) IC packages, never leave unused channels unconnected. Floating inputs pick up noise and can send the unused stage into high-frequency oscillation, corrupting the active channels.
    • Correct Termination (Single or Dual Supply): Wire the unused channel as a Unity-Gain Buffer (tie $V_{OUT}$ directly to $V_-$) and connect $V_+$ to a valid mid-rail DC voltage (such as `GND` on dual supply or $V_{CC}/2$ on single supply).
  2. Prevent Capacitive Load Oscillation: Driving long coaxial cables or large capacitive loads (`> 100 pF`) directly from an op-amp output reduces phase margin and causes ringing/oscillation. Place a small `10 Ω` to `100 Ω` isolation resistor in series directly at the op-amp output pin.
  3. Keep Feedback Traces Short: Keep $R_f$ and $R_g$ physically close to the inverting ($V_-$) pin. Stray trace capacitance at $V_-$ creates an unwanted pole that can destabilize high-speed op-amps.
  4. Power Decoupling: Place a `0.1 µF` ceramic capacitor right next to $+V_{CC}$ (and $-V_{EE}$ on split supplies) to `GND`.

7. Op-Amp Bench Troubleshooting Checklist

  1. [ ] Check Supply Rails First: Measure voltage directly on the IC's $+V$ and $-V$ power pins (confirm `LM358` Pin 8 = $+V$, Pin 4 = `GND`).
  2. [ ] Test the Virtual Short ($V_+ \approx V_-$): Measure DC voltage at both $V_+$ and $V_-$ with respect to `GND`.
  3. [ ]If $V_+$ and $V_-$ are equal (within a few millivolts), the feedback loop is healthy and active.
  4. [ ]If $V_+$ and $V_-$ differ by hundreds of millivolts or volts, the op-amp is saturated against a rail (check for an open feedback resistor, exceeded input common-mode range, or incorrect resistor gain ratio).
  5. [ ]Verify Resistor Values & Output Clipping: Confirm $V_{OUT}$ does not exceed the op-amp's maximum output swing rating (e.g., an LM358 powered at 5.0 V clips around 3.5 V – 3.7 V).
  6. [ ]Check for High-Frequency Oscillation: Probe $V_{OUT}$ with an oscilloscope—if a thick, fuzzy band or multi-megahertz sine wave rides on top of your DC signal, add a small feedback capacitor (10 pF – 47 pF) in parallel with $R_f$ and check power decoupling.

Electronics Reference: 1. Diodes & Transistors | 2. Integrated Circuits (ICs) | 3. Communication Buses (UART, SPI & I2C) | 4. Voltage Regulators & Power Supply Design | 5. Operational Amplifiers (Op-Amps)

electronics/components/ops.txt · Last modified: by Jon