Catto / Topic Map · Analog Electronics II Year 5
ElectronicsAnalog Electronics II · 144 h · Topic 5 of 6

Oscillators

An amplifier with positive feedback and a network that picks a frequency. Nothing more than that, and yet from it come a microcontroller’s clock, a transmitter’s carrier and the tone of an electronic instrument. An oscillator is a circuit that is never satisfied.

Filters and oscillators Barkhausen LC tank Wien Crystal

01The oscillation condition

In an amplifier with negative feedback, the signal that returns is subtracted and the circuit settles. If the signal that returns adds and arrives with enough amplitude, the circuit sustains itself: it no longer needs an input. That is an oscillator.

input = 0Σ++Aamplifier · gain AoutputTuned networkβ · sets the frequencyback in phasepositive feedbackBarkhausen criterion|βA| = 1∠βA = 0° (or 360°)If what comes back is as large as what went outand arrives in phase, the loop needs no input.
Figure 1. The loop. The amplifier restores the energy the network loses; the network decides at what frequency the loop closes with the correct phase.
Barkhausen criterion
|βA|=1∠βA=0°(or 360°)

Two conditions that must be met at the same time and at the same frequency. The phase condition determines at what frequency it oscillates; the magnitude condition, whether it oscillates.

How it starts, if there is no input

It starts from noise. Every circuit has thermal noise, which contains a little of every frequency. The selective network lets through only its own, the amplifier enlarges it, it comes back, it is enlarged again… For that process to take off, |βA| must be greater than 1 at the beginning.

tinitial noiseamplitude limited by saturation|βA| > 1 · the signal grows from the noise|βA| = 1 · the amplitude settles
Figure 2. Start-up, animated. With |βA|>1 the signal grows exponentially from the noise; when the amplifier begins to saturate, the effective gain drops until |βA|=1 and the amplitude settles. If that limiting is abrupt, the sine wave comes out clipped.
The central design trade-off

If there is a lot of excess gain, the oscillator starts quickly and reliably, but the amplitude settles by saturation and the output is distorted. If the gain is just enough, the waveform is clean but the oscillator may fail to start when cold, with a low battery or with a different transistor. The elegant solutions are those of automatic amplitude control:

  • A small incandescent lamp in the loop: as it heats up its resistance increases and the gain drops. It is the original trick of the Wien oscillator, and it produces an extraordinarily clean sine wave.
  • Two antiparallel diodes across the feedback resistor: as the amplitude grows they conduct and lower the gain. It is the cheap solution and the most widely used.
  • A FET as a variable resistor driven by an amplitude detector: this is automatic gain control proper.

02LC oscillators: the resonant tank

The heart is a tank circuit: an inductor and a capacitor in parallel exchanging energy. The capacitor stores energy in its electric field and discharges into the inductor, which stores it in its magnetic field and returns it, and so on. If there were no losses, it would go on forever.

CLelectric fieldin the capacitormagnetic fieldin the inductorvoltagecurrent0°90°180°270°360°90° apart:when one is maximum, the other is zero+ + +− − −+ + +− − −+ + +− − −+ + +− − −− − −+ + +− − −+ + +− − −+ + +− − −+ + +− − −+ + +− − −+ + +− − −+ + ++ + +− − −+ + +− − −+ + +− − −
Figure 3. The LC tank, animated. Energy goes back and forth between the electric field of the capacitor and the magnetic field of the inductor. Voltage and current are 90° apart: when one is at maximum, the other is zero. The amplifier only restores what is lost in the resistance of the wire.
f0=12πLC With L=100µH and C=100pF: f0=1.59MHz. To halve the frequency you have to quadruple L or C, because they sit under a square root.
OscillatorHow it divides the feedbackAdvantage
HartleyInductor with a tap: two inductances and one capacitorEasy to tune by varying the capacitor. A classic in receivers.
ColpittsTwo capacitors in series and one inductorMore stable at high frequency: the transistor’s parasitic capacitances are absorbed into the divider.
ClappColpitts with one more capacitor in series with the inductorThe small capacitor dominates the frequency and isolates the circuit from the transistor’s drift. Very stable.
ArmstrongFeedback through a coupled second windingHistorical. Easy to understand, not very practical at high frequency.
VCCRBRFCCCRECECBoutputL1L2C
f0=12π(L1+L2)C
Figure 4. Hartley oscillator. The tank coil has a tap to ground: L₁ and L₂ deliver opposite voltages, which adds the 180° the common emitter stage does not provide.
VCCRBRFCCCRECECBoutputC1C2L
f0=12πLCTCT=C1C2C1+C2
Figure 5. Colpitts oscillator. The divider is made of two capacitors in series with their junction to ground. With two capacitors in series, the tank capacitance is the series of both.
VCCRBRFCCCRECECBoutputC1C2LC3
f0≈12πLC3C3≪C1,C2
Figure 6. Clapp oscillator. A Colpitts with C₃ in series with the coil. If C₃ is much smaller than C₁ and C₂, it rules, and the transistor capacitances barely shift the frequency.
VCCRBL1CL2CBRECEoutput
f0=12πL1C
Figure 7. Armstrong oscillator. A second winding (L₂) coupled to the tank coil returns the signal to the base. The dots mark the ends with the same phase: the collector goes to the dotted end of L₁ and the base to the undotted end of L₂, so the coupling inverts; with the 180° of the common emitter the loop completes 360°.
How to recognize them at a glance

The first three are the same circuit with the divider built in different ways. The mnemonic that works: in Hartley the inductor is split, in Colpitts the capacitor is split. In an unfamiliar schematic, look at which of the two elements has three connections instead of two.

Example · Tank for the 40-meter band

An oscillator at 7.1 MHz is wanted, with a 4.7 µH inductor. What capacitor is needed?

  • f=12πLC⟹C=14π2f2L
  • 4π2=39.48;f2=(7.1×106)2=5.04×1013
  • C=139.48×5.04×1013×4.7×10−6=106.9pF

Choose a fixed 82 pF capacitor with a 5 to 50 pF trimmer in parallel, and use the trimmer to adjust to the exact frequency. The practical reason: the real inductance of a homemade coil is never the calculated one.

03RC oscillators

Below about 100 kHz an inductor would be huge and of poor quality. There, RC networks are used, which in exchange for giving up some selectivity are cheap, small and highly repeatable. This is the family of audio generators.

Wien bridge

A series RC network and a parallel one form a divider that at a single frequency has zero phase shift and attenuates by exactly one third.

f0=12πRC

Since the network attenuates by a factor of 3, the amplifier must have a gain of exactly 3: with a non-inverting op amp, Rf=2·Rg. With R=10kΩ and C=10nF the result is 1592 Hz. It is the audio oscillator with the best waveform.

Phase shift

Three RC sections, each contributing 60°, add up to the 180° that an inverting amplifier needs to close the loop in phase.

f0=12πRC6

The network attenuates by a factor of 29, so the gain must be 29 or more. With R=10kΩ and C=10nF it gives 650 Hz. It can be built with a single transistor, which is why it appears often in simple circuits.

+−outputRCRCRf = 2·RgRg
f0=12πRCRf=2Rg
Figure 8. Wien bridge oscillator. The series R-C and parallel R-C arms bring one third of the output, in phase, to the + input at a single frequency. With Rf twice Rg, the gain of 3 closes the loop.
+−outputRRCCCRRf ≥ 29·R
f0=12πRC6Rf≥29R
Figure 9. Phase-shift oscillator. Three C-R cells add 180° at a single frequency; the inverting op amp provides the other 180°. The network attenuates 29 times, and the amplifier must make up for it.

Relaxation oscillators

There is no sine wave and no resonance: a capacitor charges up to a threshold, discharges and starts over. The output is square or triangular and the frequency depends on an RC and two thresholds. This is what the 555 does, as does a Schmitt trigger with RC feedback (40106) or an op amp in an astable configuration.

f=1.44(R1+2R2)C 555 in astable mode. With R1=10kΩ, R2=10kΩ and C=10nF: f=1.4430,000×10−8=4.8kHz.
+VNE5558VCC4RST7DIS6THR2TRIG3OUT1GND5CVR1R2C10 nFoutput
f=1.44(R1+2R2)C
Figure 10. 555 in astable mode. C charges through R1+R2 up to two thirds of the supply and discharges through R₂, via pin 7, down to one third.
outputRC1/6 of a 40106
Figure 11. Schmitt trigger with R-C feedback. The output charges and discharges C through R; the hysteresis of the 40106 decides when it switches. One gate and two parts make a square wave.
+−outputRCR1R2
T=2RC⁡ln(1+2R2R1)
Figure 12. Op amp astable. R₁ and R₂ set two thresholds at the + input; C charges through R toward the output until it reaches them.
Relaxation is not the same as resonance

A relaxation oscillator is simple and flexible, but its frequency depends directly on R, on C and on the threshold voltages, which drift with temperature and supply voltage. Typical stability: 1 %. An LC tank reaches 0.1 % and a crystal 0.001 %. For a timer or a sequencer it is more than enough; for a timebase or a carrier, it is not.

04The crystal oscillator

A quartz crystal is piezoelectric: when it is deformed, a voltage appears across its faces, and when a voltage is applied it deforms. Cut to a certain thickness, it vibrates mechanically at a natural frequency with a precision that no LC circuit can match.

Its electrical equivalent

It is modeled as a series RLC (the mechanical resonance) in parallel with the capacitance of its electrodes. The numbers are extraordinary: an equivalent L of henries, a C of femtofarads and a Q of 10,000 to 100,000, versus the 100 or 300 of an inductor.

That extremely high Q is the physical reason for its stability: the loop can only close in an extremely narrow band of frequencies.

What you see in the workshop
  • 32,768 Hz (215) in clocks: fifteen divisions and you get 1 Hz.
  • 4, 8, 16, 20 MHz in microcontrollers.
  • Pierce is the usual configuration: the crystal, two capacitors to ground and the inverter that is already built into the microcontroller.
  • The load capacitors (typically 22 pF) are not optional: the crystal is specified to work with a certain capacitance, and if it is missing, the frequency shifts.
outputRf = 1 MΩX1C1C274HC04
Figure 13. Pierce crystal oscillator. The crystal sits between the inverter input and output, with C₁ and C₂ to ground; Rf keeps the inverter in its linear region so it starts. It is the one built into microcontrollers.
TypeStabilityError at 10 MHzWhere it is used
RC / relaxation1 %100 kHzTimers, blinkers, simple PWM
LC0.1 %10 kHzRadio local oscillators, tuned RF
Standard crystal10 to 50 ppm100 to 500 HzMicrocontrollers, clocks, serial communications
TCXO (temperature-compensated)0.5 to 2 ppm5 to 20 HzInstruments, GPS, commercial radios
OCXO (oven-controlled)0.001 to 0.01 ppm0.01 to 0.1 HzLaboratory standards, base stations
A figure that puts everything in order: 1 ppm

One part per million is one second every eleven and a half days. A wristwatch with a 20 ppm crystal gains or loses about 52 seconds per month, and that is exactly what is observed. When a piece of equipment demands more precision than that, a standard crystal is no longer enough: you need temperature compensation or external synchronization.

05What is asked of an oscillator

Stability

That the frequency not change with temperature, supply voltage, aging or load. The typical enemy is load pulling: connecting something to the output shifts the frequency. It is solved with a buffer stage.

Signal purity

That the output be the desired frequency and nothing else. Harmonics appear from saturation of the amplifier; phase noise, from the transistor’s noise. In a transmitter, harmonics are radiated and interfere with other bands.

Reliable start-up

That it always oscillates, with any individual transistor, at −10 °C and with the battery about to run out. That is the reason excess gain is left in and the amplitude is controlled by other means.

In a microcontroller all of this appears under another name: clock jitter. A clock with jitter doesn’t ruin a blinking LED, but it does ruin fast serial communication or a high-resolution A/D conversion, because the sampling instant shifts.

06In the lab

Lab 1 · Wien oscillator with an op amp

Build the Wien oscillator with a TL081, R=10kΩ and C=10nF. With Rf/Rg adjustable by a trimmer, look for the point where it starts. Observe on the oscilloscope: just above the threshold the waveform is clean; raising it further, it flattens at the peaks. Measure the frequency and compare it with 1592Hz. Then add two 1N4148 diodes in antiparallel across Rf and check that the waveform stays clean even with excess gain.

Lab 2 · Colpitts

Build a Colpitts with a 2N2222, L=100µH and two 470 pF capacitors. Calculate the expected frequency (CT=235pF⟹f=1.04MHz) and measure it. Then bring your hand close to the inductor: the frequency shifts. It is the direct demonstration of why RF oscillators are shielded.

Lab 3 · Stability compared

Using the frequency counter, measure every minute for fifteen minutes the frequency of three oscillators: a 555, the Colpitts from before and the crystal oscillator of a microcontroller board. Calculate the relative variation of each. Then gently warm each circuit with a hair dryer and repeat. The resulting table is section 4 verified on the bench.

Lab 4 · The tank, without an amplifier

With a 100 µH inductor and a 100 nF capacitor in parallel, excite the tank with a short pulse from the generator through a large resistor and observe the damped oscillation on the oscilloscope. Measure its frequency (about 50 kHz) and count how many cycles it takes to fall to half: from that you get an estimate of the Q of the assembly.

07Common mistakes

SymptomUsual cause
It doesn’t oscillateInsufficient gain, or the feedback arrives in antiphase: reverse the winding direction of the inductor or the phase of the network.
It oscillates but the waveform is clippedExcessive gain with no amplitude control. Add diodes, a lamp or AGC.
The frequency shifts when the load is connectedLoad pulling. A buffer stage is missing between the oscillator and what follows.
It starts sometimes and sometimes notGain right at the limit, or poorly chosen crystal load capacitors.
The crystal oscillates at a frequency other than the marked oneIt is running on an overtone, or the load capacitors do not match the specification.
Two frequencies appear mixed togetherParasitic oscillation elsewhere in the circuit, typically due to the wiring or a lack of supply decoupling.
The frequency drifts as the equipment warms upComponents with a high temperature coefficient. Use NP0/C0G capacitors in the tank, not ordinary ceramics.
An audio amplifier whistles on its ownIt has turned into an oscillator unintentionally: positive feedback through the shared supply or through input wiring running close to the output.

08Self-assessment

State the Barkhausen criterion and say what each condition determines.

|βA|=1 and total phase 0° (or 360°). The phase condition determines at what frequency it oscillates; the magnitude condition, whether the oscillation is sustained. To start up you need |βA|>1.

If there is no input signal, where does the first oscillation come from?

From the circuit’s own noise, which contains all frequencies. The selective network lets its own through and the loop amplifies it cycle by cycle until amplitude limiting stabilizes it.

Tank with L=47µH and C=220pF: what is the frequency?

LC=47×10−6×220×10−12=1.034×10−14LC=1.017×10−7f=12π×1.017×10−7=1.565MHz

How do you tell a Hartley from a Colpitts by looking at the schematic?

By where the tap is: in the Hartley the inductor is split (it has three connections); in the Colpitts what is split is the capacitor, which is two in series.

Why does the Wien oscillator need a gain of exactly 3?

Because at its frequency the RC network attenuates the signal to one third with zero phase. For |βA|=1 the amplifier must multiply by 3: with a non-inverting stage, Rf=2Rg.

Wien with R=4.7kΩ and C=22nF: what is the frequency?

f=12πRC=16.283×4700×22×10−9=1539Hz

Why is a crystal so much more stable than an LC tank?

Because its Q is in the tens of thousands versus a couple of hundred: the window of frequencies in which the loop can close is far narrower. Moreover, quartz is mechanically stable with temperature, much more so than an inductor and a capacitor.

A 20 ppm crystal in a clock: how much does it drift per month?

20×10−6×2,592,000s=52s With 30 days = 2,592,000 s: 52 seconds. It is the typical error of an ordinary digital clock.

What is the difference between a relaxation oscillator and a resonant one?

The resonant one keeps energy oscillating between two elements (L and C) and produces a sine wave of stable frequency. The relaxation one charges and discharges a capacitor between two thresholds: it delivers a square or triangle wave, and is much simpler and much less stable.

An audio amplifier starts whistling on its own. What is happening?

It has turned into an oscillator: some part of the output returns to the input in phase. Typical causes: an input cable running alongside the output one, a poorly distributed common ground or a lack of supply decoupling. It is Barkhausen being satisfied without anyone having asked for it.

Development of the topic “Oscillators” of Analog Electronics II (Year 5), based on the “Curriculum Proposal – Second Cycle of the Technical-Vocational Track, Secondary Education – Electronics,” Ministry of Education of the Province of Córdoba, DGETyFP. Back to the Topic Map · catto.ar