Lab

Op-amp amplifiers lab: inverting and non-inverting gain, and clipping

Objective
Work out the gain of an inverting amplifier, −Rf ÷ Rin, and of a non-inverting amplifier, 1 + Rf ÷ Rin, read both outputs against the input on the NGSpice Time Domain chart, and raise the input until the outputs clip at the op amp's output limit of about 15 V, on the chart and on the Mini Scope.
Level
Late high school and first-year college
Time
45 minutes
Topics
Operational amplifiers, inverting and non-inverting amplifiers, closed-loop gain, negative feedback, virtual ground, phase inversion, clipping (saturation), the RMS value of a sine wave
The lab's NGSpice Time Domain chart for this circuit with the source set to 2 V, over 0 to 10 s: N1 (red) swings between 2 V and −2 V, N2 (green) and N4 (blue) swing in opposite directions with flat tops and bottoms at about 15 V and −15 V; at 248 ms the pointer reads N1: 2V, N2: -14.922V and N4: 14.93V.
This is what you will get: the Time Domain chart with the source at 2 V (in the full lab: click the source and set its Voltage to 2), with N1, the input, N2, the inverting output, and N4, the non-inverting output, over 10 s. Both outputs are cut off flat at the op amp's limit; at 248 ms, the input's first peak, the pointer reads 2 V, −14.922 V and 14.93 V (lab readings).
Preview of Op-Amp Inverting and Non-Inverting Amplifiers Lab
Open in the lab Embed Run the circuit right here. To edit it in the full lab, sign in; free accounts have a time limit there.

The NGSpice chart on this page opens on Time Domain with N1 (red, the 0.5 V input, the smallest wave), N2 (green, the inverting output, upside down) and N4 (blue, the non-inverting output, rising and falling with the input) already plotted, and the board flags N1, N2 and N4 in the same colors. The chart's orange − button minimizes it, to show the whole board. The source cannot be changed on this page: for the clipping steps, press Open in the lab.

Teachers can assign this to a class. DCACLab for teachers

Steps

  1. Look at the circuit: the sine AC source on the left (0.5 V peak, 1 Hz) feeds both amplifiers; its top terminal, the input, is flagged N1. At the top, the inverting amplifier: the 1 kΩ input resistor (brown-black-red-gold) runs from N1 to the op amp's − input, the 10 kΩ feedback resistor (brown-black-orange-gold) from its output back to the − input, and the + input goes to ground; the output is flagged N2. Below it, the non-inverting amplifier: N1 goes straight to the + input, a 10 kΩ feedback resistor runs from the output to the − input, and a 1 kΩ resistor from the − input to ground; the output is flagged N4. Under the chart, a two-channel Mini Scope: CH1 on N2, CH2 on N4. Before you start, work out both gains.
  2. Look at the NGSpice chart; it runs on this page without signing in. It opens with Analysis Type set to Time Domain and plots N1, N2 and N4 under Volts over 10 s, ten cycles of the 1 Hz wave, with points about 50 ms apart. Move the pointer to the point nearest the input's first positive peak, 248 ms, and record N1, N2 and N4 in the first row of the table.
  3. Work out each gain from your readings, N2 ÷ N1 and N4 ÷ N1, and compare it with −Rf ÷ Rin and 1 + Rf ÷ Rin. Note which output is upside down compared with the input and which one rises and falls with it.
  4. Press Open in the lab and sign in; the circuit opens with the same chart. Click the AC source and set its Voltage to 2 (2 V peak). The chart runs again, and N2 and N4 now have flat tops and bottoms. Move the pointer to the input's first positive peak (248 ms) and record N1, N2 and N4 in the second row.
  5. Close the chart with its red × button; this turns NGSpice off. The lab's normal simulation runs and the Mini Scope draws both outputs live: CH1, the inverting output, and CH2, the non-inverting one. With the source still at 2 V, both traces are flat at the top and at the bottom (each channel at 5.00 V per division). Record each channel's reading (an RMS value).
  6. Set the source back to 0.5 V and record the Mini Scope's two readings again. Compare them with the peak values from the chart divided by √2.

Data table

Source peak (V) N1 on the chart (V) N2 on the chart (V) N4 on the chart (V) Gain N2 ÷ N1 Gain N4 ÷ N1 Mini Scope CH1 and CH2 (V RMS)
             
             
             
             
             
             

Questions

  1. Work out the ideal gains, −Rf ÷ Rin and 1 + Rf ÷ Rin, for Rin = 1 kΩ and Rf = 10 kΩ. What gains did you get from the chart with the 0.5 V input?
  2. Why is the inverting amplifier's output upside down, and why does its − input stay at about 0 V? Use the current through the 1 kΩ input resistor to explain the gain of −10.
  3. The chart reads −4.994 V and 5.494 V, not −5.000 V and 5.500 V. The op amp in the lab's NGSpice model has an open-loop gain of 10 000, not infinity. Use it to explain the 0.1 % difference.
  4. At what input peak should each amplifier start to clip with a 15 V output limit? At 2 V, what did the chart read, and why are the flat tops at about 14.93 V and not exactly 15 V? The NGSpice op amp has a 50 Ω output resistance.
  5. The Mini Scope read 3.54 V and 3.88 V RMS with the 0.5 V input. Check them against peak ÷ √2. Why were the RMS readings at 2 V so much lower than 2 V × gain ÷ √2?
  6. Predict, without measuring: with 22 kΩ feedback resistors in both amplifiers, what are the two gains and the output peaks with the 0.5 V input? Does either one clip?
For teachers

Answer key

  1. Computed: inverting gain = −10 kΩ ÷ 1 kΩ = −10; non-inverting gain = 1 + 10 kΩ ÷ 1 kΩ = 11. Measured on the chart at the input's positive peak: N1 0.5 V, N2 −4.994 V and N4 5.494 V, so the gains are −4.994 ÷ 0.5 = −9.99 and 5.494 ÷ 0.5 = 10.99, within 0.1 % of the ideal values (question 3 explains the difference).
  2. Negative feedback through Rf drives the output to whatever voltage keeps the two inputs almost equal. The + input is grounded, so the − input sits at about 0 V: a virtual ground. The input current is then Vin ÷ Rin = 0.5 V ÷ 1 kΩ = 0.5 mA at the peak (computed). Almost none of it flows into the op amp, so it all flows on through Rf, and the output must be 0.5 mA × 10 kΩ = 5 V below the virtual ground: −5 V. When the input goes up, the output goes down, so the output is the input turned upside down and ten times bigger, a 180° phase shift. In the non-inverting amplifier the − input follows the + input, so the output rises and falls with the input.
  3. With an open-loop gain A, the closed-loop gain is the ideal gain × Aβ ÷ (1 + Aβ), where β = Rin ÷ (Rin + Rf) = 1/11 is the share of the output fed back to the − input. Here Aβ = 10 000 ÷ 11 = 909, so both gains are 909 ÷ 910 = 0.9989 of the ideal: 11 × 0.9989 = 10.99 and −10 × 0.9989 = −9.99 (computed), and 0.5 V in gives 5.494 V and −4.994 V, what the chart reads. The higher the open-loop gain, the closer the amplifier gets to −Rf ÷ Rin and 1 + Rf ÷ Rin.
  4. Computed: the output cannot go past 15 V, so the inverting amplifier clips once the input passes 15 V ÷ 10 = 1.5 V, and the non-inverting one at 15 V ÷ 11 = 1.36 V. At 2 V the ideal outputs would be −20 V and 22 V peak, so both clip. Measured on the chart at 248 ms, the input's first positive peak: N1 2 V, N2 −14.922 V and N4 14.93 V, and the same at 9.25 s. The flat tops sit a little inside 15 V because the NGSpice op amp has a 50 Ω output resistance, loaded by the feedback resistors (10 kΩ + 1 kΩ = 11 kΩ): 15 V × 11 000 ÷ 11 050 = 14.93 V (computed) for N4. N2's feedback path ends at the 2 V input instead of ground, which gives −14.92 V (computed).
  5. Computed: the RMS value of a sine is its peak ÷ √2, so 5 V ÷ √2 = 3.54 V and 5.5 V ÷ √2 = 3.89 V, against the Mini Scope's 3.54 V and 3.88 V (lab readings, NGSpice off). At 2 V, unclipped outputs would be 20 V and 22 V peak, 14.1 V and 15.6 V RMS (computed), but everything beyond 15 V is cut off, so less is left: the Mini Scope read 12.4 V (CH1) and 12.5 V (CH2) RMS, within about 2 % of the 12.18 V and 12.50 V computed for a sine clipped at 15 V. The harder an amplifier is overdriven, the closer its output gets to a square wave.
  6. Computed: inverting gain −22 kΩ ÷ 1 kΩ = −22, non-inverting gain 1 + 22 = 23. With 0.5 V in: −11 V and 11.5 V peak, both inside ±15 V, so neither clips; clipping would now start at 15 V ÷ 22 = 0.68 V and 15 V ÷ 23 = 0.65 V in. Try it in the full lab: click a 10 kΩ resistor and change its resistance in the property panel.

Frequently asked questions

Do students need an account?

Not to run the circuit and its chart on this page: they run in the browser without signing in. To change the source for the clipping steps, students press Open in the lab and sign in, and free accounts have a time limit there. Saving their own copy needs a DCACLab plan. To hand the work in as an assignment, they join your class through its join link.

Who can use the NGSpice chart?

Anyone, on this page: the chart opens with the circuit, already plotted, without signing in. In the full lab (Open in the lab), any signed-in account can run Time Domain, AC Sweep and DC Sweep, free accounts included (within the free account's time limit), except accounts on the Starter plan, which cannot open these charts.

Why does the op amp have no supply pins?

The lab's Op-Amp part has three pins, two inputs and an output. Instead of supply pins it has two settings, Max Output and Min Output (15 V and −15 V here): the output cannot go beyond them, which is where it clips. That keeps the board to the two amplifiers and their resistors. The lab also has LM741 and LM358 chips, which need their supply pins wired and would double the parts on the board.

Teaching with circuits?

Create a classroom, give your students this lab, and review what they submit. The free classroom demo gives you one classroom with room for 30 students for 7 days, counted from when your first student joins (once per teacher); after that it keeps up to 5 students.

Try the free classroom demo