Built-in project · no microcontroller

RLC resonance on the bench

A signal generator into a series resistor, inductor and capacitor, with a scope on the input and across the ring: sweep it and watch the peak, the -3 dB skirts either side of it, and the phase cross -90 degrees at resonance. There is no microcontroller in it: the simulator solves the 5 parts as a circuit, so it runs the moment you press Run, and nothing needs compiling.

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

RLC resonance 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 a resistor, an inductor and a capacitor in
// series, with a scope on the input and on the node between the inductor and
// the capacitor.
//
// R = 250 ohm, L = 10 mH, C = 2.5 nF. Every coil and every capacitor put
// together like this ring at one frequency, and the formula says where:
//
//   f0 = 1 / (2 pi sqrt(L C)) = 1 / (2 pi sqrt(0.01 x 2.5e-9)) = 31 831 Hz
//
// and how sharp the ring is has a name too, Q, the size of the reactance at
// resonance against the resistance that damps it:
//
//   Q = (1 / R) sqrt(L / C) = (1 / 250) sqrt(0.01 / 2.5e-9) = 8.0
//
// A Q of 8 is a good bench number: sharp enough that the peak is real and
// obvious, gentle enough that a hand sweep finds it in a few tries rather
// than skating straight past it.
//
// Sweep it. Analysis... in the more menu, then Frequency response. Drive
// gen1, leave the input on the generator's own node, watch the node between
// the inductor and the capacitor, and sweep 1 kHz to 300 kHz at 40 points a
// decade. What comes back:
//
//   well below 31.8 kHz   flat, at 0 dB: the capacitor is nearly open and
//                          barely anything is dropped across R and L yet
//   the peak               about 17.9 dB, a ratio of about 7.9, near 31.6 kHz
//   at 31.8 kHz exactly    the phase crosses -90 degrees
//   100 kHz to 1 MHz       falling at about 40 dB a decade: an inductor and a
//                          capacitor, twice the roll-off an RC filter gives
//
// Two things worth stopping on.
//
// The peak comes in at a ratio of about 7.9, a hair under the formula's Q of
// 8.0. The scope's own 1 Mohm sits right across the capacitor, exactly where
// it sits in the RC filter on the bench, and it takes the same kind of small
// bite out of the reading, just a much smaller one: 1 Mohm here is five
// hundred times the tank's own 2 k ohm (sqrt(L / C)) rather than a few dozen
// times a filter resistor, so the peak barely moves instead of shifting the
// way that filter's corner does. The true peak also sits a hair below 31.8
// kHz for the same textbook reason a hand-solved RLC does in
// crates/analog/tests/ac.rs: f0 sqrt(1 - 1 / (2 Q^2)), which for a Q of 8
// lands at about 31.7 kHz, close enough that a hand sweep will not tell the
// two apart.
//
// One thing that does NOT move the peak at all: the generator's own 50 ohms.
// It sits upstream of the node the ratio is measured from, so it drops
// straight out of the reading, the same way it does for the RC filter on the
// bench. A real bench generator carries that resistor everywhere it goes; it
// simply is not part of this particular number.
//
// Two things to try. Double R to 500 ohms and Q drops to about 4.0, the peak
// falling to about 12 dB, very nearly exactly half, because R is the only
// thing in the formula Q actually depends on here. Halve C instead and f0
// doubles, since it lives under the square root together with L.

Parts list

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

How it is wired

4 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.

  • Ground: Function generator pin GND; Capacitor, 2.5 nF pin 2; Oscilloscope pin GND
  • Function generator pin OUT; Resistor, 250 Ω pin 1; Oscilloscope pin CH1
  • Resistor, 250 Ω pin 2; Inductor pin 1
  • Inductor pin 2; Capacitor, 2.5 nF pin 1; Oscilloscope pin CH2

Change it and keep it

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