Built-in project · no microcontroller

Op-amp low pass on the bench

A signal generator into an inverting op-amp low pass biased off a single 5 V rail, with a scope on the output: a real gain in the pass band, a corner in the low kilohertz, and a model switch that shows where the op-amp’s own bandwidth starts to matter. There is no microcontroller in it: the simulator solves the 8 parts as a circuit, so it runs the moment you press Run, and nothing needs compiling.

AdvancedRuns in your browser. Free, and no account needed.

Op-amp low pass on the benchlive0.000 s 0.00x
Click to open it in the editor
The circuit itself, running here on the simulator. Press what can be pressed; click anything else to open it in the editor.

How it works

There is no microcontroller in this one, so nothing is compiled: the simulator solves the circuit itself. The file in the editor is the notes that come with it.

sketch.ino
// A signal generator into an inverting op-amp low pass. Rin = 1 k into the
// summing junction, Rf = 10 k and Cf = 8 nF in parallel from that junction
// back to the output. A 10 k / 10 k divider off the 5 V rail holds the
// non-inverting input, and once feedback closes the loop, the output too, at
// half the rail: 2.5 V. This op-amp has no negative supply, so nothing here
// can swing below ground on its own, and this is the standard fix.
//
// In the pass band the gain comes from the two resistors alone:
//
//   |Av| = Rf / Rin = 10 000 / 1 000 = 10, which is 20 dB
//
// and Cf decides where that gain starts to give way:
//
//   fc = 1 / (2 pi Rf Cf) = 1 / (2 pi x 10 000 x 8e-9) = 1989 Hz
//
// Sweep it. Analysis... in the more menu, then Frequency response. Drive
// gen1, watch the output, and sweep 10 Hz to 100 kHz at 40 points a decade.
// What comes back:
//
//   pass band          flat at 20.0 dB, and 180 degrees, because an
//                       inverting stage turns the signal upside down
//   about 1.99 kHz      the marked corner: 3 dB down, 45 degrees further
//                       round than the pass band
//   a decade past it    another 20 dB down, one capacitor's worth of rolloff
//
// The corner lands at 1985 Hz, 0.2% under the formula's 1989 Hz, and closer
// than any passive filter on this bench manages. That is the op-amp doing
// its job: Rf and Cf sit inside the feedback loop, so whatever the scope's
// own 1 Mohm does to the output node, the loop corrects for it before it
// ever shows up in the reading. A passive filter has nothing watching its
// output like that; this one does.
//
// The 0.2% is the op-amp itself. Its model is rail-to-rail, the default,
// with a gain-bandwidth product of 10 MHz: at 2 kHz its open-loop gain is
// about 5000, not infinite, so the loop is a little short of perfect. Set
// the op-amp's model to 741 and sweep again. A 741's gain-bandwidth product
// is 1 MHz, a tenth of that, and the corner comes down ten times as far, to
// 1950 Hz, 2% under the formula. (A 741 on 5 V also has only 1.5 V to 3.5 V
// of swing, which this 2.5 V bias sits in the middle of.)
//
// Things to try. Make Rin 10 k instead of 1 k and the gain drops to unity,
// 0 dB, with the corner exactly where it was, because Rf and Cf are the only
// two parts that decide it. Make Cf four times smaller, 2 nF, and the corner
// moves up by four, to about 7.96 kHz: it lives alone under 1 / (2 pi Rf Cf)
// once Rf is fixed.

Parts list

10 parts, plus the jumper wires. Every one is in the editor's parts bin.

How it is wired

6 connections, pin by pin, read from the circuit itself. Each line is one set of pins joined together, by a jumper wire or a breadboard strip.

  • 5 V: Resistor, 10k Ω (2) pin 1; Op-amp pin V+
  • Ground: Function generator pin GND; Resistor, 10k Ω (3) pin 2; Op-amp pin GND; Oscilloscope pin GND
  • Function generator pin OUT; Resistor, 1k Ω pin 1; Oscilloscope pin CH1
  • Resistor, 1k Ω pin 2; Resistor, 10k Ω (1) pin 1; Capacitor, 8 nF pin 1; Op-amp pin IN-
  • Resistor, 10k Ω (1) pin 2; Capacitor, 8 nF pin 2; Op-amp pin OUT; Oscilloscope pin CH2
  • Resistor, 10k Ω (2) pin 2; Resistor, 10k Ω (3) pin 1; Op-amp pin IN+

Change it and keep it

Open it in the editor, change the circuit or the code, and keep your version in a free account.