ENع
←Op-amp circuits
Lesson 40 · AC power, frequency response and op-amp circuits

Op-amp circuits: summing, difference, integrator

14 min12 steps5 questionsAdvanced
About this lesson

Two ideal rules, no current into the inputs and v− = v+ under negative feedback, are enough to design with an op-amp. Follow one board with one op-amp in three settings. As a summing amplifier, 0.5 V and 1 V make 50 µA + 50 µA meet at a virtual ground, and Rf = 20 kΩ turns the sum into vo = −2 V. As a difference amplifier, inputs of 2.5 V and 3 V give vo = 1 V: only their difference counts. As an integrator, a capacitor in the feedback path turns a steady 0.5 V into a ramp of −5 V/s, until the supply stops it. It builds on the Hardware lessons on op-amps, Ohm's law, and resistors and capacitors.

You'll learn to

Tick what you feel confident about. These self-checks do not affect your lesson score.

Fig 40 · Interactive
01 / 12

Two rules of an ideal op-amp

An op-amp multiplies the voltage between its + and − inputs by a huge gain. Two ideal rules follow. No current flows into either input. With negative feedback, a path from the output back to −, the output adjusts until v− = v+.

ideal op-amp

  rule 1   i+ = i− = 0      (inputs draw no current)
  rule 2   v− = v+          (only with negative feedback)

Why rule 2: vo = A(v+ − v−) with A about 10^5
or more. vo stays a few volts, so v+ − v− must
be tiny: tens of microvolts. We call it zero.

Rf (or C) from vo back to − is the negative
feedback in every circuit of this lesson.
Loading figure…
or ← →
Read the lesson step by step
  1. Two rules of an ideal op-amp

    An op-amp multiplies the voltage between its + and − inputs by a huge gain. Two ideal rules follow. No current flows into either input. With negative feedback, a path from the output back to −, the output adjusts until v− = v+.

    ideal op-amp
    
      rule 1   i+ = i− = 0      (inputs draw no current)
      rule 2   v− = v+          (only with negative feedback)
    
    Why rule 2: vo = A(v+ − v−) with A about 10^5
    or more. vo stays a few volts, so v+ − v− must
    be tiny: tens of microvolts. We call it zero.
    
    Rf (or C) from vo back to − is the negative
    feedback in every circuit of this lesson.
  2. A virtual ground

    R4 joins the + input to ground. No current enters the input, so R4 drops no voltage: v+ = 0 V. Rule two holds v− at 0 V too. The − input is a virtual ground: at 0 V, yet not wired to ground.

    + input   i4 = 0, so v+ = 0 − 0 × R4 = 0 V
    − input   v− = v+ = 0 V   (rule 2)
    
    virtual ground: a node held at 0 V by the
    op-amp's feedback, not by a wire.
    
    No current flows from − to ground: rule 1
    says the op-amp input takes none.
  3. Input 1 makes a current

    V1 = 0.5 V sits across R1 = 10 kΩ, because R1's right end is the virtual ground at 0 V. Ohm's law gives i1 = 0.5 V / 10 kΩ = 50 µA. That current depends only on V1 and R1.

    i1 = (V1 − v−) / R1
       = (0.5 − 0) V / 10 kΩ
       = 50 µA
    
    1 µA = 10^-6 A. The arrow is the reference
    direction: V1's + terminal → R1 → − input.
  4. Input 2 adds its own

    V2 = 1 V drives i2 = 1 V / 20 kΩ = 50 µA through R2 into the same node. The inputs do not disturb each other: the node stays at 0 V, so each current is set by its own source and resistor.

    i2 = (V2 − v−) / R2
       = (1 − 0) V / 20 kΩ
       = 50 µA
    
    Change V1 and i2 stays the same: the
    virtual ground isolates the inputs.
    That is why a mixing desk can add many
    signals without them loading each other.
  5. The currents add

    Kirchhoff's current law at the − input: 50 + 50 = 100 µA arrive, and none can enter the op-amp. So all 100 µA must leave through the feedback resistor Rf. The node adds the two currents for us.

    KCL at the − input (entering +)
    
      i1 + i2 − if − i− = 0,  i− = 0
      if = i1 + i2
         = 50 + 50 = 100 µA
    
    the op-amp's output pin sinks this current
    through its supply (not drawn).
  6. Rf turns the sum into a voltage

    Rf's left end is at 0 V and 100 µA flows through 20 kΩ, so vo = 0 − 100 µA × 20 kΩ = −2 V. In general vo = −(Rf/R1·V1 + Rf/R2·V2) = −(2 × 0.5 + 1 × 1) V.

    vo = v− − if·Rf = 0 − 100 µA × 20 kΩ = −2 V
    
    summing amplifier
      vo = −(Rf/R1·V1 + Rf/R2·V2)
         = −(2 × 0.5 + 1 × 1) = −2 V
    
    weight of each input = Rf/Rk.  Equal
    resistors give vo = −(V1 + V2): a plain sum,
    inverted. The plot: vo falls 1 V per volt of V2.
  7. Rewire for a difference

    Remove R2 and send V2 = 3 V through R3 = 10 kΩ to the + input, with R4 = 20 kΩ to ground. Set V1 = 2.5 V. R3 and R4 form a divider: v+ = 3 × 20/30 = 2 V.

    voltage divider (no current into +)
    
      i3 = V2 / (R3 + R4) = 3 V / 30 kΩ = 100 µA
      v+ = i3 × R4 = 2 V
    
    R4 / R3 = 20/10 = Rf / R1 = 20/10:
    the matched ratio the next steps need.
  8. The − input follows

    Feedback holds v− = v+ = 2 V: no longer a virtual ground. i1 = (2.5 − 2) V / 10 kΩ = 50 µA, all of it through Rf: vo = 2 V − 50 µA × 20 kΩ = 1 V.

    v− = v+ = 2 V          (rule 2)
    i1 = (V1 − v−)/R1 = 50 µA
    if = i1                  (rule 1, KCL)
    vo = v− − if·Rf
       = 2 − 50 µA × 20 kΩ = 1 V
  9. Only the difference counts

    With R4/R3 = Rf/R1 the output is vo = (Rf/R1)(V2 − V1) = 2 × (3 − 2.5) = 1 V. Both inputs sit near 3 V, yet only their 0.5 V difference reaches the output. Raise both by 1 V: vo stays.

    difference amplifier (R4/R3 = Rf/R1)
    
      vo = (Rf/R1)(V2 − V1)
         = 2 × (3 − 2.5) = 1 V
    
    superposition check
      V1 alone:  −(Rf/R1)·V1           = −5 V
      V2 alone:  (1 + Rf/R1)·v+         = 6 V
      total                              = 1 V
    
    The plot: vo rises 2 V per volt of V2.
  10. Swap Rf for a capacitor

    Remove R3 and replace Rf with C = 10 µF, empty at t = 0, and switch on V1 = 0.5 V. The − input is a virtual ground again, so i1 = 50 µA, and all of it flows into C.

    integrator: C in the feedback path
    
      v− = v+ = 0 V      (R4 carries no current)
      i1 = V1 / R1 = 50 µA
      iC = i1             (rule 1)
    
    The current is constant, whatever the
    capacitor's voltage: the virtual ground
    keeps V1 fully across R1.
  11. A steady current, a steady ramp

    A constant current charges C at a constant rate: 50 µA / 10 µF = 5 V/s. The output is C's right plate, so it falls: vo(t) = −(1/RC)∫V1 dt = −5t V. After one time constant RC = 0.1 s, vo = −0.5 V.

    capacitor (passive sign, + at the − input)
      vC = q / C = iC·t / C
      vo = v− − vC = −(1/(R1·C)) ∫ V1 dt
    
      R1·C = 10 kΩ × 10 µF = 0.1 s
      slope = V1 / (R1·C) = 5 V/s
      t = 0.1 s:  vo = −5 × 0.1 = −0.5 V
    
    The output is the running area under v1(t),
    scaled by 1/RC and inverted.
  12. Where the ramp stops

    The output cannot pass the op-amp's supply voltages. With ±12 V supplies, the ideal ramp would reach −12 V at t = 12 / 5 = 2.4 s, so it stops before then. Real integrators add a reset switch across C.

    ideal ramp meets the supply
      t = 12 V / 5 V/s = 2.4 s
    
    A real output saturates a little inside the
    rails. Once it does, v− is no longer held at
    0 V and the rules stop applying.
    
    fixes: a reset switch across C (empties it),
    or a large resistor across C, which limits
    the gain at very low frequencies.

Quiz Unlocks after the last step.