Built-in project · no microcontroller

RC filter on the scope

A signal generator into an RC low pass with both ends on a two-channel scope: the textbook corner frequency, drawn. There is no microcontroller in it: the simulator solves the 4 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.

Beginner About 15 minutes to build and run. Runs in your browser. Free, and no account needed.

The parts retail for about $5.15. On Mokxi they're free.

The circuit runs here once the page has loaded.

What you'll learn

  • How an RC low pass filter works
  • The corner frequency formula
  • Reading amplitude and delay on an oscilloscope
  • Why a capacitor passes less at high frequency
  • Difficulty: Beginner
  • Time: About 15 minutes
  • Parts: 3

How it works

A signal generator feeds a resistor of 1.6k and a capacitor of 100 nF. This is an RC low pass filter. The scope watches both ends: channel 1 sees the input, and channel 2 sees what is left across the capacitor.

The corner frequency is where the capacitor's reactance equals the resistance: 1 divided by 2 pi R C, which is about 995 Hz. The generator is set to 1 kHz, so the blue trace should be about 0.705 of the yellow one, 2 V in and 1.41 V out, and an eighth of a cycle behind. The scope is set to 2 V per division and 400 microseconds per division.

Parts list

3 parts, plus the jumper wires and 2 bench instruments. The parts retail for about $5.15; on Mokxi they're free, and so are the instruments.

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 pinConnects to
Signal generator pin GNDGround
Capacitor, 100 nF pin 2Ground
Oscilloscope pin GNDGround
Resistor, 1.6k Ω pin 1Signal generator pin OUT
Oscilloscope pin CH1Signal generator pin OUT
Capacitor, 100 nF pin 1Resistor, 1.6k Ω pin 2
Oscilloscope pin CH2Resistor, 1.6k Ω 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.

sketch.ino
// A generator into an RC low pass, both ends on the scope.
//
// R = 1.6 k, C = 100 nF. The corner is where the capacitor's reactance equals
// the resistance:
//
//   f0 = 1 / (2 pi R C) = 1 / (2 pi x 1600 x 100e-9) = 995 Hz
//
// The generator is set to 1 kHz, which is as good as on the corner, so the
// filtered trace (blue, CH2) should come out at
//
//   |H| = 1 / sqrt(1 + (2 pi f R C)^2) = 0.705
//
// of the yellow one, and a whole eighth of a cycle behind it. 2 V in, 1.41 V
// out. Count the divisions: 2 V/div vertically, 400 us/div across.
//
// Things to try. Take the frequency to 100 Hz and the two traces sit on top of
// each other; take it to 10 kHz and the blue one nearly vanishes, down by a
// factor of ten. Swap the generator to a square wave and watch the RC round
// the corners off, which is the same filter doing the same thing to every
// harmonic at once. Make C ten times bigger and the corner moves down a
// decade.

Troubleshooting

The usual mistakes with this circuit, and the fix for each.

  • The two traces are the same size This project
    Check that channel 2 is on the point between the resistor and the capacitor, not on the generator.
  • You see nothing on the scope This project
    Make sure all grounds are joined and the generator is on. Then check the scale: 2 V per division and 400 microseconds per division.
  • The circuit under test shows clipped or distorted signals. Signal generator
    A sine swinging below zero can exceed what an input allows. Add a DC offset or bias so the signal stays inside the supply range of the part.
  • Measurements are off or noisy. Signal generator
    Join the generator's ground to the circuit ground. Keep amplitude and frequency within what the connected parts can handle.
  • 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.