Sinusoidal Oscillators: Wien, Phase-Shift, LC & Crystal

Circuits designed to be unstable in a controlled way. Learn the Barkhausen criterion, start-up and amplitude limiting, the Wien-bridge oscillator with amplitude stabilisation, RC phase-shift oscillators, LC oscillators (Colpitts, Hartley, Clapp), crystal equivalent circuit (motional L, C, R and shunt C₀), series and parallel resonance, Pierce oscillators and load capacitance, oscillator frequency stability, phase noise and jitter basics — with Python computing Wien, phase-shift, Colpitts and crystal frequencies and load capacitors.

An oscillator is an amplifier with frequency-selective positive feedback: at exactly one frequency the loop gain has magnitude 1 and zero phase, so a signal sustains itself. Noise at power-up provides the starting signal.

RC oscillators serve audio and test signals, LC oscillators serve RF, and quartz crystals give the ppm-level stability behind every clock in digital electronics.

An analogy

An oscillator is like pushing a child on a swing: pushes timed exactly with the swing's natural rhythm (zero phase) and just strong enough to replace friction losses (gain = 1) keep it going at a steady height.

What makes an oscillator

Three ingredients:

RC oscillators

Wien-bridge: low distortion (< 0.01% with good AGC), easily tunable with a dual pot/capacitor — classic audio generator. Phase-shift: three RC sections giving 180°, with an inverting amplifier of gain ≥ 29 — simple, but poor distortion and tuning. Quadrature oscillators (two integrators in a loop) give sine and cosine outputs. RC oscillators are practical from ~1 Hz to ~1 MHz.

LC oscillators

Colpitts (capacitive divider feedback), Hartley (tapped inductor), Clapp (series capacitor for better stability) and cross-coupled LC oscillators (VCOs in ICs) operate from hundreds of kHz to GHz. The tank's Q sets purity and phase noise. Varactor diodes make them voltage-controlled (VCOs) for PLLs and FM.

Crystal oscillators and stability

Quartz is piezoelectric: electrically it looks like a series RLC (motional arm) in parallel with C₀. Between f_s and f_p it is inductive — the Pierce oscillator (used by every MCU) operates there with two load capacitors. Stability: ±10–50 ppm for standard crystals, ±0.1–2 ppm for TCXOs, ppb for OCXOs. Check the oscillator's negative resistance (safety factor ≥ 5 × ESR), drive level (too much ages or cracks the crystal), and layout (short traces, guard ground). Phase noise (dBc/Hz) and jitter specify spectral purity for RF and ADC clocks.

Formulas

Worked example: Wien frequency

Given: R 1.6 kΩ, C 100 nF

Find: f₀.

Answer: ≈ 995 Hz

Worked example: LC tank

Given: L 100 µH, C 1 nF

Find: f₀.

Answer: ≈ 503 kHz

Worked example: Crystal load caps

Given: C_L 12.5 pF, stray 3 pF

Find: C₁ = C₂.

Answer: 19 pF (use 18 or 20 pF)

Wien-bridge oscillator

        ┌── R ──||C── ┐ (series RC)
  out ──┤              ├──┤+
        │    ┌─ R ─┐   │   │  ▷──┬── out
        │    └─||C─┘   │  ┌┤−    │
        │   (parallel) GND│      │
        └── R_f (2R_g, with amplitude control) ──┘
                          R_g to GND

The series/parallel RC network passes 1/3 of the output back with zero phase at f₀ = 1/2πRC. The non-inverting gain must be exactly 3: slightly more to start, then reduced automatically by a lamp, thermistor, JFET or diodes as amplitude grows — otherwise the output clips (gain > 3) or dies (gain < 3).

Oscillator frequencies and crystal parameters

import math
# Oscillator frequencies: Wien bridge, RC phase shift, Colpitts, crystal load capacitance
R, C = 10e3, 16e-9
print(f"Wien bridge: f = {1/(2*math.pi*R*C):.0f} Hz, needs gain 3 (Rf/Rg = 2)")
print(f"RC phase-shift (3 sections): f = {1/(2*math.pi*R*C*math.sqrt(6)):.0f} Hz, needs gain 29")
L, C1, C2 = 10e-6, 1e-9, 4.7e-9
Ceq = C1 * C2 / (C1 + C2)
print(f"Colpitts: Ceq = {Ceq*1e12:.0f} pF, f = {1/(2*math.pi*math.sqrt(L*Ceq))/1e6:.3f} MHz, feedback ratio C1/C2 = {C1/C2:.2f}")
# Crystal: 16 MHz, load capacitance 18 pF, stray 5 pF -> equal load caps
CL, Cs = 18e-12, 5e-12
Cx = 2 * (CL - Cs)
print(f"crystal load caps: C1 = C2 = {Cx*1e12:.0f} pF")
# Motional parameters of a ~16 MHz crystal
Lm, Cm, Rm, C0 = 7.0e-3, 14.14e-15, 30.0, 4e-12
fs = 1 / (2 * math.pi * math.sqrt(Lm * Cm))
fp = fs * math.sqrt(1 + Cm / C0)
Q = 1 / (2 * math.pi * fs * Cm * Rm)
print(f"series resonance {fs/1e6:.4f} MHz, parallel {fp/1e6:.4f} MHz (+{(fp-fs)/1e3:.1f} kHz), Q = {Q:.0f}")
# Wien bridge: f = 995 Hz, needs gain 3 (Rf/Rg = 2)
# RC phase-shift (3 sections): f = 406 Hz, needs gain 29
# Colpitts: Ceq = 825 pF, f = 1.753 MHz, feedback ratio C1/C2 = 0.21
# crystal load caps: C1 = C2 = 26 pF
# series resonance 15.9973 MHz, parallel 16.0255 MHz (+28.3 kHz), Q = 23453

10 kΩ and 16 nF give ~1 kHz in a Wien bridge but only ~406 Hz in a phase-shift oscillator with the same parts. The Colpitts' two capacitors act in series. A crystal's enormous Q (tens of thousands) comes from its tiny motional capacitance; its series and parallel resonances are only ~28 kHz apart, and the load capacitance you present pulls the frequency within that range — so the datasheet C_L must be matched with C₁ = C₂ ≈ 2(C_L − C_stray).

Common mistakes

Applications

Key takeaways

Going further