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.
Teaching? Assign it to your class in one click.
Advanced About 20 minutes to build and run. Runs in your browser. Free, and no account needed.
The parts retail for about $5.70. On Mokxi they're free.
What you'll learn
- An inverting op-amp amplifier
- An active low-pass filter
- The corner frequency of a resistor and capacitor
- Biasing at half the supply for single-supply use
- Reading gain in decibels
- Difficulty: Advanced
- Time: About 20 minutes
- Parts: 8
How it works
A function generator feeds an inverting op-amp stage through a 1k resistor. A 10k resistor and an 8 nF capacitor sit side by side in the feedback path, from the op-amp's output back to its inverting input.
In the pass band, the gain is the 10k divided by the 1k, which is 10, or 20 dB, and the output is upside down. As the frequency rises, the capacitor takes over the feedback and the gain falls. The corner is at 1 / (2 pi x 10k x 8 nF), about 1989 Hz.
A 10k and 10k divider from 5 V holds the other input at 2.5 V. This lets one supply work, with the output sitting at 2.5 V. The scope shows the input on channel 1 and the output on channel 2.
Parts list
8 parts, plus the jumper wires and 2 bench instruments. The parts retail for about $5.70; on Mokxi they're free, and so are the instruments.
- 1 × Full-size breadboard
- 1 × Power, 5 V
- 1 × Function generator
- 1 × Resistor, 1k ΩIn Starter Kit, Claw Machine Kit, Halloween Prop Kit.
- 3 × Resistor, 10k ΩIn Starter Kit, Claw Machine Kit, Halloween Prop Kit.
- 1 × Capacitor, 8 nFIn Power Bank Kit.
- 1 × Op-amp
- 1 × Oscilloscope
Wiring table
Every connection, pin by pin, read from the circuit itself. Each row joins the pin on the left to the pin on the right, by a jumper wire or a breadboard strip.
| Part and pin | Connects to |
|---|---|
| Resistor, 10k Ω (2) pin 1 | 5 V |
| Op-amp pin V+ | 5 V |
| Function generator pin GND | Ground |
| Resistor, 10k Ω (3) pin 2 | Ground |
| Op-amp pin GND | Ground |
| Oscilloscope pin GND | Ground |
| Resistor, 1k Ω pin 1 | Function generator pin OUT |
| Oscilloscope pin CH1 | Function generator pin OUT |
| Resistor, 10k Ω (1) pin 1 | Resistor, 1k Ω pin 2 |
| Capacitor, 8 nF pin 1 | Resistor, 1k Ω pin 2 |
| Op-amp pin IN- | Resistor, 1k Ω pin 2 |
| Capacitor, 8 nF pin 2 | Resistor, 10k Ω (1) pin 2 |
| Op-amp pin OUT | Resistor, 10k Ω (1) pin 2 |
| Oscilloscope pin CH2 | Resistor, 10k Ω (1) pin 2 |
| Resistor, 10k Ω (3) pin 1 | Resistor, 10k Ω (2) pin 2 |
| Op-amp pin IN+ | Resistor, 10k Ω (2) pin 2 |
The notes that come with it
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.
// 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.
Troubleshooting
The usual mistakes with this circuit, and the fix for each.
- The output is clipped or flat This project
Gain is 10, so a large input drives the output into the rails. Turn down the function generator's amplitude. - The corner is not where you expect This project
The corner depends only on the 10k resistor and the 8 nF capacitor. Changing the 1k input resistor changes the gain, not the corner. - The signal is smaller than the knob says when connected to a circuit. Function generator
The output has a 50 ohm source resistance, so a low-resistance load pulls the level down. Use a high-impedance load, or buffer the signal with an op-amp. - The reading on a pin is wrong or the wave is clipped. Function generator
Keep the amplitude and offset within what the input can take. A microcontroller pin wants 0 to 5 V, never negative. Add a DC offset or a series resistor. - The LED is dim, burns out, or the pin reads wrong because the resistor value is off. Resistor
Read the color bands again. A 220 ohm to 330 ohm resistor suits a typical LED on 5 V. 10k is a common pull-up or pull-down value. Check with a multimeter if unsure. - A pull-up or pull-down resistor is missing, so the input floats and reads random values. Resistor
Tie the input to 5 V or ground through about 10k. Or use INPUT_PULLUP and wire the switch to ground. - An electrolytic capacitor heats up, bulges or pops. Capacitor
Electrolytics have a polarity. The stripe marks the negative leg, which goes toward ground. Also keep the voltage under the rated value, such as 10 V or 16 V. - An RC circuit charges much slower or faster than expected. Capacitor
The time constant is R times C. A 10 k resistor with a 100 uF capacitor gives 1 second, and about 5 seconds to charge fully. Check that you read the value on the part right.
Change it and keep it
Open it in the editor, change the circuit or the code, and keep your version in a free account.