Electrical
Crystal Oscillator
A quartz sliver that keeps near-perfect time
A crystal oscillator is a feedback circuit that uses the mechanical resonance of a piezoelectric quartz crystal as its frequency-determining element, locking the loop to a single sharp, stable frequency. Because the quartz behaves like an electrical RLC tank with a quality factor in the tens of thousands to over a million — hundreds of times sharper than any LC circuit — the oscillation tolerates only one frequency and holds it to within tens of parts per million across temperature and years of operation. That tiny vibrating sliver is the heartbeat of nearly every clock, radio, microcontroller and GPS receiver on Earth.
- ResonatorPiezoelectric quartz (SiO₂)
- Quality factor Q10⁴ to >10⁶
- Fundamental range~10 kHz – 50 MHz
- Watch crystal32.768 kHz (= 2¹⁵)
- Plain XTAL accuracy±30–100 ppm
- OCXO accuracy±1–50 ppb
Interactive visualization
Press play, or step through manually. The visualization is yours to drive — try it before reading on.
Watch the 60-second explainer
A condensed visual walkthrough — narrated, captioned, under a minute.
What a crystal oscillator actually is
Strip away the package and a crystal oscillator is two parts: a quartz resonator — a precisely cut sliver of single-crystal quartz with metal electrodes plated on each face — and a sustaining amplifier wrapped around it in a feedback loop. The amplifier supplies just enough energy each cycle to replace what the resonator loses to friction, and the resonator's razor-sharp mechanical resonance dictates the only frequency at which the loop can sustain oscillation. The result is a self-running clock far more stable than anything built from coils and capacitors alone.
The trick is piezoelectricity. Quartz lacks a center of symmetry, so squeezing it produces a surface charge (the direct effect) and applying a voltage strains it mechanically (the converse effect). The crystal therefore couples the electrical world of the amplifier to the mechanical world of an acoustic standing wave inside the plate. The amplifier "rings" the quartz electrically; the quartz answers mechanically and feeds the signal back, vastly purified, at its own resonant frequency.
Why quartz is so good: the Q factor
The single number that makes quartz special is its quality factor Q, the ratio of energy stored to energy lost per radian of oscillation:
Q = 2π · (energy stored) / (energy lost per cycle)
= ωs · L1 / R1 (in terms of the motional elements)
= fs / Δf (Δf = the −3 dB resonance bandwidth)
Typical Q values:
LC tank (discrete) ~ 100 – 300
Ceramic resonator ~ 300 – 3,000
Quartz crystal ~ 10,000 – 1,000,000+
A high Q means a tall, narrow resonance peak. Frequency stability scales directly with Q: the steeper the phase-versus-frequency slope at resonance, the harder it is for noise, temperature or component drift to push the operating point off the peak. Where a discrete LC oscillator might wander by thousands of ppm, a crystal holds tens of ppm. The same sharpness also gives crystal oscillators superb phase noise — the spectral purity that lets a radio reject adjacent channels.
The equivalent circuit (Butterworth–Van Dyke model)
Electrically, a quartz crystal is modeled as a motional branch — a series R₁, L₁, C₁ — in parallel with the static shunt capacitance C₀ of the electrodes and holder:
┌── R1 ── L1 ── C1 ──┐ ← motional branch (the "resonance")
○──────┤ ├──────○
└──────── C0 ─────────┘ ← shunt (electrode) capacitance
Representative 16 MHz AT-cut crystal:
R1 (motional resistance, ESR) ≈ 8 Ω
L1 (motional inductance) ≈ 12 mH (!) huge — mechanical mass
C1 (motional capacitance) ≈ 8 fF (femtofarads — mechanical stiffness)
C0 (shunt capacitance) ≈ 4 pF
Capacitance ratio C0 / C1 ≈ 500
That 12 mH inductance from a part smaller than a grain of rice is the giveaway — no real coil that small exists; it is the electrical shadow of the quartz's mechanical mass. The femtofarad motional capacitance is its mechanical stiffness. From these elements come the two resonances:
Series resonance (impedance minimum, motional L1 and C1 cancel):
fs = 1 / (2π · √(L1·C1))
Parallel / anti-resonance (impedance maximum, motional branch meets C0):
fp = fs · √(1 + C1/C0) ≈ fs · (1 + C1 / (2·C0))
Pulling: a parallel-mode crystal at load capacitance CL lands at
fL = fs · ( 1 + C1 / (2·(C0 + CL)) )
Because C₁ is hundreds of times smaller than C₀, fs and fp sit only a fraction of a percent apart — for the 16 MHz example, perhaps 16 kHz. The crystal is inductive in the narrow band between them, and that is exactly the region a parallel-mode oscillator uses.
The feedback loop: oscillator topologies
For oscillation, the loop must satisfy the Barkhausen criterion: the loop gain magnitude is ≥ 1 and the total phase shift around the loop is a multiple of 360°. The crystal supplies a frequency-dependent phase shift that hits the right value only at its resonance, so the loop self-selects that frequency. The dominant topologies:
| Pierce | Colpitts | Clapp | Series-mode (e.g. inverter + R) | |
|---|---|---|---|---|
| Active device | Single inverter / amplifier | Single transistor | Transistor + extra series C | Logic gate / amplifier |
| Crystal mode | Parallel | Parallel | Parallel | Series |
| Frequency set by | Two load caps (CL) | Tapped capacitor pair | Series C in motional path | Crystal fs directly |
| Parts count | Lowest | Low | Medium | Low |
| Where you see it | Nearly every MCU XTAL pin pair | RF / VCXO front ends | Lab signal sources | Overtone & high-MHz designs |
The Pierce oscillator dominates digital electronics because it needs only one inverting amplifier (often built into the microcontroller), the crystal, two small load capacitors and a large bias/feedback resistor. The two grounded capacitors set the load capacitance the crystal sees and contribute the 180° phase shift the inverter needs to total 360°.
Worked example: sizing Pierce load capacitors
A 16 MHz crystal is specified for a load capacitance CL = 18 pF. In a Pierce oscillator the crystal sees the two external capacitors C1 and C2 in series, plus stray and pin capacitance Cstray:
CL = (C1 · C2) / (C1 + C2) + Cstray
For C1 = C2 = C and a typical Cstray ≈ 5 pF:
CL = C/2 + Cstray
18 pF = C/2 + 5 pF
C/2 = 13 pF
C = 26 pF → choose standard 27 pF for each cap
Check the negative-resistance margin (gain headroom):
|R_neg| should be ≥ 5 × ESR for reliable startup
For ESR = 40 Ω → want |R_neg| ≥ 200 Ω
Use 27 pF on each pin and the crystal sees ≈18 pF — on frequency. Choose 10 pF caps instead and the crystal sees only ≈10 pF, which pulls the frequency high by roughly +20 ppm — enough to corrupt a 115200-baud UART or blow USB high-speed's ±500 ppm budget once temperature and aging are stacked on top.
Crystal cuts and temperature behavior
How the plate is sliced from the raw quartz crystal sets its temperature curve. The angle of the cut relative to the crystal's optical and electrical axes is everything:
- AT-cut (≈35°15′): the workhorse for MHz crystals. Its frequency-vs-temperature follows a gentle cubic curve with an inflection near 25–30°C, so a well-chosen cut angle keeps drift within ±10–30 ppm over −40 to +85°C. Used in almost every computer and radio crystal from ~1 to 50 MHz.
- SC-cut (stress-compensated, doubly rotated): lower sensitivity to mounting stress and faster warm-up; the choice for high-end OCXOs, but harder to manufacture.
- Tuning-fork (XY) cut: the tiny 32.768 kHz watch crystal. Its frequency follows a parabola peaking near 25°C, dropping ~0.035 ppm/°C² either side — fine for a wristwatch that lives near body temperature, poor in a car dashboard.
32.768 kHz is no accident: it equals 2¹⁵, so a 15-stage binary divider produces exactly one pulse per second. That single number runs essentially every quartz watch and real-time-clock chip ever made.
From bare crystal to atomic-grade reference
| Type | What it adds | Typical accuracy | Power / cost |
|---|---|---|---|
| XTAL + on-chip oscillator | Nothing — raw crystal | ±30 to ±100 ppm | Near zero / cents |
| XO (clock oscillator) | Packaged with its amplifier, square-wave out | ±20 to ±100 ppm | Low / < $1 |
| VCXO | Voltage input pulls frequency a few hundred ppm | ±20 to ±50 ppm + tuning | Low |
| TCXO | Analog/digital temperature compensation network | ±0.5 to ±2 ppm | Moderate / few $ |
| OCXO | Oven holds the crystal at a fixed temperature | ±1 to ±50 ppb | High power / $10s–100s |
Each step buys stability by fighting the temperature curve: the TCXO measures temperature and adds a correcting voltage, while the OCXO simply parks the crystal at the flat top of its curve by heating it to ~75°C and never letting it move. Beyond the OCXO you reach rubidium and cesium standards — atomic, not mechanical — for nanosecond timekeeping.
Failure modes and trade-offs
- Won't start ("no oscillation"). The single most common board bug. Causes: load capacitors too large (gain margin collapses), feedback resistor wrong, or an amplifier whose transconductance is too low for the crystal's ESR. Rule of thumb: ensure the loop's negative resistance is at least 5× the crystal's maximum ESR.
- Off-frequency. Wrong load capacitance is the usual culprit, pulling the crystal tens of ppm high or low. Stray PCB and pin capacitance must be counted in CL.
- Overdrive. Too much amplitude pushes excessive current through the quartz, accelerating aging, worsening drift, and in extremes fracturing the plate. Data sheets cap drive level (often 100 µW to a few mW); add a series resistor to limit it.
- Locking to a spurious or overtone mode. A loop with too much high-frequency gain can latch onto a 3rd-overtone or a spur instead of the fundamental. Shape the gain or add a mode-select LC tank.
- Aging. Frequency drifts a few ppm in the first year as mounting stress relaxes and surface contamination redistributes, then far slower. Hermetic packages and SC-cuts minimize it.
- Vibration and shock (g-sensitivity). Mechanical acceleration modulates the resonance, injecting phase noise. Critical in avionics and radar; mitigated with isolation mounts and SC-cut crystals.
Where crystal oscillators show up
- Microcontroller and CPU clocks. The reference that a phase-locked loop multiplies up to GHz core speeds — clock purity at the source defines jitter everywhere downstream.
- Radios and GPS. A stable frequency reference is what lets a receiver tune a precise channel and a GPS chip resolve sub-meter timing.
- Real-time clocks. The 32.768 kHz crystal that keeps wall-clock time when the main system sleeps.
- USB, Ethernet, UART. Serial links specify tight frequency budgets (USB full-speed allows ±0.25%); a stable crystal keeps both ends in sync.
- Test and measurement. OCXO and TCXO references discipline signal generators, frequency counters and network test sets.
Frequently asked questions
How does a crystal oscillator work?
A thin sliver of quartz is piezoelectric: an applied voltage strains it mechanically, and mechanical strain generates a voltage. Cut and electroded correctly, the quartz has an extremely sharp mechanical resonance. Electrically it looks like a series RLC branch (motional R, L and C) in parallel with the electrode capacitance C0. Placed in the feedback path of an amplifier, the loop satisfies the Barkhausen criterion — unity loop gain, 360° total phase — only at the crystal's resonant frequency, so the circuit oscillates there and nowhere else.
Why is quartz used instead of an LC tank?
A discrete LC tank has a quality factor Q of maybe 100 to a few hundred, so its resonant peak is broad and drifts heavily with temperature and component tolerance. A quartz crystal has a Q of 10,000 to over a million — the resonance is hundreds to thousands of times sharper. Because frequency stability scales with Q, quartz holds tens of parts per million over temperature where an LC oscillator wanders by thousands of ppm. Quartz is also mechanically and chemically stable, cheap to mass-produce, and ages predictably.
What is load capacitance and why does it matter?
A parallel-resonant ("parallel mode") crystal is specified to hit its marked frequency only when it sees a particular external capacitance, the load capacitance CL — typically 8, 12, 18 or 20 pF. In a Pierce oscillator that load is set by two equal capacitors to ground, each roughly 2·CL minus twice the stray and pin capacitance. Get CL wrong and the crystal runs off-frequency: too little capacitance pulls it high, too much pulls it low, often by tens of ppm — enough to break a UART link or a USB clock.
How accurate and stable is a crystal oscillator?
A plain XTAL plus microcontroller oscillator holds roughly 30 to 100 ppm over the full temperature range. A packaged clock oscillator (XO) is similar. A temperature-compensated oscillator (TCXO) reaches 0.5 to 2 ppm, and an oven-controlled oscillator (OCXO) that holds the crystal at a fixed temperature reaches 1 to 50 ppb. On top of temperature, crystals age — frequency drifts a few ppm in the first year as mounting stress relaxes and contamination settles, then far less per year afterward.
What is the difference between series and parallel resonance?
Every crystal has two closely spaced resonances. At series resonance fs the motional L and C cancel, leaving the small motional resistance, and impedance is minimum. A few kHz higher sits parallel (anti-) resonance fp, where the motional branch resonates with the electrode capacitance C0 and impedance is maximum. Series-mode oscillators drive the crystal at fs; parallel-mode oscillators operate between fs and fp, where the crystal is inductive, and use the external load capacitance to set the exact frequency.
Why do crystals have overtones and spurious modes?
A quartz plate is a mechanical resonator, so like a guitar string it supports a fundamental and odd overtones (3rd, 5th, 7th). Fundamental AT-cut plates top out near 30 to 50 MHz because the plate becomes too thin to handle; above that, designers run the crystal on its 3rd or 5th overtone with an LC tank that selects the wanted mode. Crystals also exhibit weaker unwanted "spurious" modes near the main resonance; a poorly designed loop can lock to a spur, so the amplifier gain and tank are shaped to favor the intended mode.