Skip to main content

๐Ÿงฎ Op-Amp Applications: Mathematical Operations

We've learned the basics of op-amps. Now let's see how they can perform actual math operations on signals.

These circuits don't just amplify. They add, subtract, integrate, and differentiate.

And they do it continuously, in real-time, with analog voltages.


โž• Summing Amplifier โ€“ Adding Voltagesโ€‹

The Problemโ€‹

You have multiple input signals and need their weighted sum.

Examples:

  • Audio mixing
  • Multi-sensor averaging
  • Control systems

The Circuitโ€‹

The Mathโ€‹

Using virtual ground at the inverting input:

Vout=โˆ’Rf(V1R1+V2R2+V3R3)V_{out} = -R_f \left( \frac{V_1}{R_1} + \frac{V_2}{R_2} + \frac{V_3}{R_3} \right)

Simple Case: Equal Resistorsโ€‹

If R1=R2=R3=RR_1 = R_2 = R_3 = R and Rf=RR_f = R:

Vout=โˆ’(V1+V2+V3)V_{out} = -(V_1 + V_2 + V_3)

Perfect adder! (with inversion)


๐ŸŽš๏ธ Weighted Summing Exampleโ€‹

Audio mixer with 3 channels:

  • Voice: V1=1VV_1 = 1V, R1=10kฮฉR_1 = 10k\Omega
  • Music: V2=0.5VV_2 = 0.5V, R2=20kฮฉR_2 = 20k\Omega (quieter)
  • Effects: V3=0.2VV_3 = 0.2V, R3=50kฮฉR_3 = 50k\Omega (background)

With Rf=10kฮฉR_f = 10k\Omega:

Vout=โˆ’10k(1V10k+0.5V20k+0.2V50k)V_{out} = -10k \left( \frac{1V}{10k} + \frac{0.5V}{20k} + \frac{0.2V}{50k} \right) Vout=โˆ’(1V+0.25V+0.04V)=โˆ’1.29VV_{out} = -(1V + 0.25V + 0.04V) = -1.29V

Each channel has its own "volume control" via resistor selection!


Real-World Tip

The summing amplifier is the heart of analog audio mixers. Professional mixing consoles use hundreds of these circuits.


โž– Difference Amplifier โ€“ Subtracting Voltagesโ€‹

The Problemโ€‹

You need Vout=V2โˆ’V1V_{out} = V_2 - V_1

Why?

  • Sensor differential measurements
  • Noise cancellation
  • Bridge circuits

The Circuitโ€‹

The Mathโ€‹

For a unity-gain difference amplifier where R1=R2=Rf=RR_1 = R_2 = R_f = R:

Vout=V2โˆ’V1V_{out} = V_2 - V_1

Perfect subtraction!

General Case (with gain)โ€‹

If Rf=R1โ‹…AR_f = R_1 \cdot A and R3=R2R_3 = R_2:

Vout=A(V2โˆ’V1)V_{out} = A(V_2 - V_1)

You get amplified difference.


๐ŸŒก๏ธ Temperature Differential Exampleโ€‹

Two temperature sensors:

  • Sensor A: 2.5V2.5V (Room temp)
  • Sensor B: 2.7V2.7V (Near heat source)

Difference amplifier with gain = 10:

Vout=10(2.7Vโˆ’2.5V)=10ร—0.2V=2VV_{out} = 10(2.7V - 2.5V) = 10 \times 0.2V = 2V

Now your ADC can easily measure the temperature difference with high resolution!


Watch Out

The difference amplifier is sensitive to resistor matching. Use 1% tolerance resistors or better for accurate subtraction.


๐Ÿ“ˆ Integrator โ€“ The Accumulatorโ€‹

What It Doesโ€‹

The output is the time integral (accumulation) of the input.

If input is constant โ†’ output ramps linearly
If input is zero โ†’ output holds value
If input reverses โ†’ output ramps in opposite direction

The Circuitโ€‹

The Mathโ€‹

Vout(t)=โˆ’1RCโˆซ0tVin(ฯ„)โ€‰dฯ„V_{out}(t) = -\frac{1}{RC} \int_0^t V_{in}(\tau) \, d\tau

Simpler Understandingโ€‹

The rate of change of output voltage:

dVoutdt=โˆ’VinRC\frac{dV_{out}}{dt} = -\frac{V_{in}}{RC}
  • Positive input โ†’ output ramps down
  • Negative input โ†’ output ramps up
  • Larger input โ†’ faster ramp

โšก Integrator Example: Converting Current to Voltageโ€‹

Current source: Iin=1mAI_{in} = 1mA (constant)

Integrator with R=10kฮฉR = 10k\Omega, C=1ฮผFC = 1\mu F:

Time constant: RC=10kร—1ฮผF=10msRC = 10k \times 1\mu F = 10ms

dVoutdt=โˆ’VRRC=โˆ’Iinร—RRC=โˆ’IinC\frac{dV_{out}}{dt} = -\frac{V_R}{RC} = -\frac{I_{in} \times R}{RC} = -\frac{I_{in}}{C} dVoutdt=โˆ’1mA1ฮผF=โˆ’1000โ€‰V/s=โˆ’1V/ms\frac{dV_{out}}{dt} = -\frac{1mA}{1\mu F} = -1000 \, V/s = -1V/ms

After 5ms: Vout=โˆ’5VV_{out} = -5V

Perfect for measuring total charge!


๐ŸŽฏ Real Applications of Integratorsโ€‹

ApplicationWhy Integration?
Charge amplifierConvert sensor current to voltage
Waveform generationConvert square wave โ†’ triangle wave
Control systemsPI controllers need integration
Analog computersSolving differential equations
Signal processingArea under curve measurement

Practical Issue

Real integrators drift due to:

  • Op-amp input bias current
  • DC offsets

Solution: Add a large resistor (Mฮฉ range) in parallel with capacitor to provide DC feedback without affecting AC integration.


๐Ÿ“‰ Differentiator โ€“ The Rate Detectorโ€‹

What It Doesโ€‹

Output is proportional to the rate of change of input.

Slow changes โ†’ small output
Fast changes โ†’ large output
Constant input โ†’ zero output

The Circuitโ€‹

The Mathโ€‹

Vout(t)=โˆ’RCdVindtV_{out}(t) = -RC \frac{dV_{in}}{dt}

The output is the derivative (rate of change) of the input!


๐Ÿƒ Differentiator Example: Edge Detectionโ€‹

Input: Square wave (0Vโ†’5V0V \to 5V step in 1ฮผs)

Differentiator with R=10kฮฉR = 10k\Omega, C=100pFC = 100pF:

Vout=โˆ’RCdVindt=โˆ’10kร—100pFร—5V1ฮผsV_{out} = -RC \frac{dV_{in}}{dt} = -10k \times 100pF \times \frac{5V}{1\mu s} Vout=โˆ’1ฮผsร—5ร—106V/s=โˆ’5VV_{out} = -1\mu s \times 5 \times 10^6 V/s = -5V

At the rising edge, you get a sharp spike!

This is how edge detectors work.


โš ๏ธ Problem with Practical Differentiatorsโ€‹

Differentiators amplify noise.

Why?
High-frequency noise has rapid changes โ†’ large derivatives โ†’ huge noise at output.

Solutionโ€‹

Add a small resistor in series with the capacitor to limit high-frequency gain.

(Add a small resistor (100ฮฉ - 1kฮฉ) in series with the input capacitor to limit high-frequency gain and prevent instability)

This creates a band-pass differentiator that works on your signal frequencies but ignores high-frequency noise.


๐ŸŽฏ Real Applications of Differentiatorsโ€‹

ApplicationWhy Differentiation?
Velocity from positionRate of change = speed
Edge detectionFind transitions in signals
High-pass filteringBlock DC, pass AC changes
Frequency doublingIn FM demodulation
Acceleration sensingRate of velocity change

Stability Warning

Differentiators are inherently unstable and noisy in pure form. Always add damping (series resistor) in practical circuits.


๐Ÿ“Š Comparison Tableโ€‹

CircuitFunctionInput-Output RelationshipKey Component
Summing AmplifierAdditionVout=โˆ’(V1+V2+...)V_{out} = -(V_1 + V_2 + ...)Multiple input resistors
Difference AmplifierSubtractionVout=V2โˆ’V1V_{out} = V_2 - V_1Balanced resistor network
IntegratorAccumulationVout=โˆ’1RCโˆซVindtV_{out} = -\frac{1}{RC}\int V_{in} dtFeedback capacitor
DifferentiatorRate of changeVout=โˆ’RCdVindtV_{out} = -RC \frac{dV_{in}}{dt}Input capacitor

๐Ÿ”ฌ Design Guidelinesโ€‹

For Summing Amplifiersโ€‹

  1. Use resistors in 1% tolerance range
  2. Keep input impedances similar (unless weighting is desired)
  3. Consider input bias current effects with high-value resistors

For Difference Amplifiersโ€‹

  1. Match resistor ratios precisely (this is critical!)
  2. Use resistor networks for better matching
  3. Consider instrumentation amplifier for better CMRR

For Integratorsโ€‹

  1. Add parallel resistor for DC stability (typically 1-10 Mฮฉ)
  2. Add reset switch to discharge capacitor
  3. Use low-leakage capacitors (polypropylene or polystyrene)

For Differentiatorsโ€‹

  1. Always add series input resistor for stability
  2. Limit bandwidth to avoid noise amplification
  3. Consider using RC high-pass filter instead for simple applications

๐Ÿงช Lab Exercise Ideasโ€‹

  1. Build a 3-input audio mixer

    • Use potentiometers for volume control
    • Mix three audio sources
    • Observe how resistor values affect mixing
  2. Temperature difference monitor

    • Use two temperature sensors
    • Build difference amplifier
    • Measure temperature gradient across a heatsink
  3. Triangle wave generator

    • Square wave input to integrator
    • Observe triangle wave output
    • Change RC values to modify frequency
  4. Edge detector

    • Practical differentiator circuit
    • Square wave input
    • Observe output spikes at edges

โœ… Key Takeawaysโ€‹

  • Summing amplifiers add multiple signals with individual gain control
  • Difference amplifiers subtract signals and reject common-mode noise
  • Integrators accumulate signals over time (area under curve)
  • Differentiators detect rate of change (slope)
  • Each circuit has practical limitations that must be addressed
  • These form the basis of analog computers and signal processing

๐ŸŽ“ Looking Aheadโ€‹

These mathematical operations are building blocks for:

  • Active filters (our next topic!)
  • Control systems (PID controllers)
  • Analog signal processing
  • Instrumentation amplifiers
  • Waveform generators

Master these, and you're ready to design sophisticated analog systems! ๐Ÿš€


๐Ÿ“š Further Readingโ€‹

  • Experiment with different RC time constants
  • Try cascading integrators and differentiators
  • Research analog computers (they used these extensively!)
  • Look into practical considerations for precision applications