# How does a Crystal work?

Specifically, a 2pin and 4pin quartz crystal oscillator.

What I know: current is applied and the crystal oscillates in order to provide an oscillating signal.

What I want to know: How does the vibration cause an oscillating current? How are 2/4pin crystals different? Lastly, why can a 4pin run alone and a 2pin needs capacitors.

• What are you asking about, crystals or complete canned oscillators? The title says "crystal", so that's what I answered. Jul 3, 2014 at 12:58

The devices with two pins are not oscillators, they are resonators (crystals), which can be used in an oscillator circuit (such as a Pierce oscillator), and if used with the correct circuit will oscillate at (or near) the marked frequency. The Pierce oscillator circuit, shown below, uses two capacitors (load capacitors, C1/C2), the crystal (X1), and an amplifier (U1).

The devices with four pins are complete circuits including a resonator and an active circuit that oscillates. They require power and output a square wave or sine wave output at (or near) the marked frequency.

There are also (ceramic) resonators with three pins that act like crystals with capacitors.

The way crystals (and ceramic resonators) work is that they are made of a piezoelectric material that produces a voltage when they are distorted in shape. A voltage applied will cause a distortion in shape. The crystal is made into a shape that will physically resonate (like a tuning fork or a cymbal) at the desired frequency. That means that the crystal will act like a filter- when you apply the desired frequency it will appear like a high impedance once it gets vibrating, and to frequencies a bit different, it will be more lossy. When put in the feedback circuit of an amplifier, the oscillation will be self-sustaining. Much more, and some math, here.

• A crystal resonator can be modeled as an LC bandpass filter, usually with a very narrow passband (high Q). Also, putting a bandpass filter in a loop with an amplifier is a general method for building an oscillator as the circuit will oscillate in the passband of the filter. If you use a tunable filter, then you can build a tunable or sweepable oscillator. This is used in RF test equipment regularly with magnetically-tunable YIG spheres acting as bandpass filters either stand-alone as tunable filters or in tunable oscillators. Jul 4, 2014 at 9:33

If you think of a crystal as being a tiny bell, it's easy to see how, if you hit it with a tiny little hammer, it would ring with a pure tone just like a big bell would if you hit the big bell with a small hammer.

That's exactly what a crystal does, but the trick is that it's made of piezoelectric material which makes electricity when you hit it and changes shape when you shock it with electricity.

To make it produce that pure bell-like tone continuously, it's connected across an amplifier which works just like someone pushing you on a swing so that when you got to just a little past the peak of one swing they'd give you a push to make sure you came back for the next one.

The piezoelectric nature of the crystal causes it to change shape when the amplifier output "pushes" it with an electric signal, and then when the amplifier lets go, the crystal springs back and generates its own signal which says "push me", and sends it to the input of the amplifier at just the right time for the amplifier to generate another push and regenerate the cycle, forever.

So what makes the crystal start oscillating?

Noise.

There's noise everywhere, and it's like zillions of tiny hammers hitting everything all the time.

Some of that noise hits the crystal, and when it's hooked up to the amplifier and starts to ring a little from the noise hits, the amplifier gets the electrical signal from the crystal's physical ringing tone (frequency), builds it up, and sends it back to the crystal. That makes the crystal change shape even more, sending a bigger signal back to the amplifier when the crystal's shape springs back, until the system is oscillating continuously and is stable.

• Awesome answer which uses simple language to explain it very well. I think it might help to add that the infinite and self-starting oscillatory behavior is due to positive feedback behavior. Jul 4, 2014 at 10:16

A crystal does not oscillate on its own. You don't simply apply power and get oscillations out. Think of a crystal as a very accurate and sharp frequency filter. You put it in the feedback path of a amplifier in the right way, and it causes the circuit to oscillate at the crystal's resonant frequency. It's the circuit that causes the oscillations. They crystal kills all the frequencies except the one it's tuned for, which only allows enough overall loop gain for the circuit to oscillate at the crystal's frequency.

• That makes good sense. I understand that the voltage coming in creates a distortion and this vibration, but how does it filter? Does it create another electrical contact at a certain frequency or..? Jul 3, 2014 at 13:06
• @scii: A crystal is a small chunk of material that exhibits the piezo-electric effect. This is carefully cut and trimmed to mechanically resonate at the intended frequency. A signal at that frequency causes it to resonate. One off-frequency doesn't. The resonance Q is so high that the frequency has to be very close to right for the crystal to resonate. Jul 3, 2014 at 13:10
• Okay. One final thing, when the crystal does resonate what happens? Does it pass current? i.e. it only allows current at that frequency to flow. Or does the resignation cause more current? +1 to all your answers thank you. Jul 3, 2014 at 14:08
• @Scii: The electrical view of a crystal is quite complex, but basically yes, it allows the voltage of its tuned frequency to appear on the other side (with the right load), whereas other frequencies are attenuated. There are also phase shifts envolved. In fact, oscillators that require "parallel resonance" crystals are counting on a phase shift at the resonant frequency. The circuit Spehro showed is a example of this. Jul 3, 2014 at 14:28
• Applying an electric field (voltage) to a piezoelectric crystal causes it to deform. Deforming a piezoelectric crystal generates an electric field. Resonators are cut to ring like a bell (mechanical vibration) at a specific frequency. If this frequency is applied to one side of the crystal, it will resonate and it will generate an electric field in opposition to the one applied, generating a low voltage across the crystal (passing the input signal). If the frequency applied does not cause the crystal to resonate, then the voltage across the crystal will be high (attenuating the input signal). Jul 5, 2014 at 7:12

Crystals below their resonant frequency appear mostly capacitive. Above their resonant frequency, they appear mostly inductive. At their resonant frequency, they appear mostly resistive.

Re-draw the Pierce oscillator three times, replacing the crystal with one of those components. It may help you understand how it works.

Parallel resonant crystals are actually specified a little bit under the fundamental frequency. This makes the crystal appear a bit capacitive at the spec'd frequency. The additional capacitance adds a bit of additional phase shift to help the oscillator start and run.

The amplifier's input sees a bigger signal near the crystal's fundamental (resistive, typically under 100 Ohms ESR). The smaller off-frequency signals are diminished or blocked, so a signal at the fundamental frequency grows stronger (after being amplified) and dominates.

Push someone on a swing. No matter how hard you try, the swing really will only move back-and-forth at some fundamental frequency.

Imagine a crystal as the surface of the water. Now send ripples (waves) across that surface. The ripples move the surface up and down, effectively bending the surface. The crystal too bends as it vibrates.

Bending can be caused by applying an electric field to a quartz crystal, but also the bending itself creates an opposing electric field in the crystal lattice. At rest, these forces are balanced, and the crystal has no charge.

Which is easier to vibrate with your hand: a 12x1 inch ruler, or a 6x4 foot sheet of plywood? Obviously the smaller ruler can be vibrated faster!

Crystals are the same. Their dimensions determine their resonant frequency; smaller and / or thinner crystals vibrate faster. This is also what limits the fundamental frequency of a crystal: crystals get too small or too thin to accurately process by mechanical machining or chemical etching at higher frequencies.

At really low frequencies, crystals become so large or thick that it takes too much power to make them bend; hence a tuning fork crystal design is used for low-frequency 32.768 kHz timing crystals.

Crystals can actually oscillate at more than one frequency. These are the overtones at multiples of the fundamental, but they tend to be weaker than the fundamental. It is possible to design a circuit to cause a crystal to oscillate at an overtone, typically the third or fifth. Typically crystals over 40 MHz are designed for 3rd or 5th overtone, not the fundamental, so carefully read the specs before purchasing!