Skip to content

2.6 — Feedback, Oscillators and the 555 Timer

Every circuit in Chapter 2.5 used feedback to make itself behave. Take the same feedback, arrange it so that the signal returning to the input reinforces what is already there instead of opposing it, and the circuit stops needing an input at all. It generates its own.

Everything that keeps time runs on this: the clock in a processor, the carrier of a radio station, the tone of an alarm, the sampling instant of every digital audio system.

1. The two kinds of feedback

Take an amplifier of gain A and feed a fraction \beta of its output back to the input. (This \beta is a feedback fraction, unrelated to the transistor \beta of Chapter 2.3 — the letter is overloaded and both uses are standard.)

The signal at the amplifier's input is the external input plus the fed-back portion, so

V_{out} = A(V_{in} + \beta V_{out})

Rearranging:

\boxed{A_f = \frac{V_{out}}{V_{in}} = \frac{A}{1-A\beta}}

The whole subject lives in that denominator.

Negative feedback: A\beta is negative, so the denominator is bigger than one and the closed-loop gain is less than the open-loop gain. That is what Chapter 2.5's amplifiers did. What you buy with the lost gain is worth far more than the gain:

  • Gain stability. If |A\beta| \gg 1 then A_f \approx -1/\beta, set by the feedback network alone. A 50% change in A moves A_f by a fraction of a percent.
  • Wider bandwidth, by exactly the factor the gain was reduced — this is where the gain-bandwidth product comes from.
  • Lower distortion, because any distortion the amplifier adds is itself fed back and largely cancelled.
  • Impedances you can choose rather than accept.

Positive feedback: A\beta is positive. As A\beta approaches 1, the denominator approaches zero and the gain approaches infinity. At A\beta = 1 the circuit produces an output with no input at all. That is an oscillator, and the condition has a name.

2. The Barkhausen criterion

For sustained oscillation, two things must hold together at some frequency:

\boxed{|A\beta| = 1 \qquad\text{and}\qquad \angle A\beta = 0^\circ \ (\text{or } 360^\circ)}

Magnitude one means the signal comes back exactly as large as it left. Larger and it grows without limit; smaller and it dies away.

Phase zero means it comes back exactly in step, so it reinforces rather than fights. In an inverting amplifier, which already provides 180°, the feedback network must supply the other 180°.

Heinrich Barkhausen stated this in 1921. It is a necessary condition, not quite a sufficient one — there are circuits that satisfy it and do not oscillate — but for practical design it is the rule.

The starting problem, and the amplitude problem

If the loop gain is exactly 1, what starts it? Noise. Every resistor generates thermal noise across all frequencies, and the circuit picks out the frequency where the phase condition holds and amplifies it.

But for it to grow from microvolts to volts, the loop gain must be greater than 1 during startup. And if it stays greater than 1, the amplitude grows until the amplifier clips against the supply rails, giving a badly distorted output.

So every real oscillator needs an amplitude control that reduces the gain to exactly 1 once running. Three approaches:

  • Let it clip. Crude, but fine when a square wave is what you wanted anyway.
  • A non-linear element. The classic Wien bridge oscillator used a small filament lamp: as amplitude rises the lamp heats, its resistance rises, and the gain falls. William Hewlett's 1939 master's thesis did exactly this, and the resulting HP200A audio oscillator was the first product of Hewlett-Packard. Disney bought eight of them for the sound system of Fantasia.
  • An active AGC loop — rectify the output, compare it with a reference, and adjust the gain with a JFET used as a voltage-controlled resistor. This is what a low-distortion laboratory oscillator does.

3. RC oscillators — for audio frequencies

The Wien bridge

An op-amp with a non-inverting gain of 3, and a feedback network of a series RC and a parallel RC.

The network's transfer function peaks at

f_0 = \frac{1}{2\pi RC}

and at that exact frequency it passes one third of the signal with zero phase shift. So a non-inverting amplifier with a gain of exactly 3 gives A\beta = 3\times\frac13 = 1 with zero phase. Barkhausen is satisfied at one frequency only.

Worked example. R = 10 kΩ, C = 16 nF:

f_0 = \frac{1}{2\pi\times10^4\times1.6\times10^{-8}} = \frac{1}{10^{-3}} = 1000\ \text{Hz}

The gain of 3 comes from a non-inverting configuration with R_f = 2R_1 (since 1+R_f/R_1 = 3). Make part of R_1 a thermistor or lamp and the amplitude settles itself.

The Wien bridge produces a genuinely clean sine — distortion below 0.01% is achievable — which is why it dominated audio test equipment for forty years.

The phase-shift oscillator

An inverting amplifier already gives 180°. Add three RC sections, each contributing 60° at the right frequency, and you have the other 180°.

f_0 = \frac{1}{2\pi RC\sqrt6}

Each RC section also attenuates, and three of them attenuate by a factor of 29, so the amplifier must have a gain of at least 29 to satisfy the magnitude condition.

Why three sections and not one? A single RC can approach 90° but never reach it, and you need a full 180°. Three sections at 60° each is the practical minimum, and four at 45° each is also used.

Simple, cheap, and mediocre — its frequency depends on six components and its output is not especially clean. It is worth knowing mainly because it makes the phase condition concrete.

4. LC oscillators — for radio frequencies

Above about 100 kHz, RC networks become impractical (the resistors and capacitors get awkward) and the LC tank of Chapter 1.6 takes over. A tank naturally rings at f_0 = 1/(2\pi\sqrt{LC}); the amplifier's job is only to top up the energy lost each cycle.

Colpitts. The tank's capacitance is split into two capacitors in series, and the junction between them is the feedback tap. Frequency:

f_0 = \frac{1}{2\pi\sqrt{LC_{eq}}}, \qquad \frac{1}{C_{eq}} = \frac{1}{C_1}+\frac{1}{C_2}

and the feedback fraction is C_1/C_2. Capacitors are cheaper and more stable than tapped inductors, which is why this is the most common LC oscillator.

Hartley. The dual: the inductance is split and tapped instead.

f_0 = \frac{1}{2\pi\sqrt{(L_1+L_2)C}}

Clapp. A Colpitts with an extra capacitor in series with the inductor, which reduces the transistor's influence on the frequency and improves stability. Used where drift matters.

5. The crystal oscillator

Every LC oscillator drifts. Inductance changes with temperature and with anything metal nearby; capacitance changes with humidity and with the transistor's own bias. A good LC oscillator holds perhaps 100 parts per million.

A quartz crystal holds 1 part per million or better, and it does so by not being an electrical resonator at all.

Quartz is piezoelectric: squeeze it and it produces a voltage; apply a voltage and it deforms. So a slice of quartz with electrodes on both faces is a mechanical resonator you can drive electrically, and it resonates at a frequency set by its physical dimensions — which are far more stable than any inductance.

Electrically it behaves like an LC circuit with an enormous effective inductance, a tiny capacitance, and a Q of 10,000 to 100,000, against maybe 200 for a good LC tank. The circuit has essentially no choice about what frequency to run at, which is the entire point.

Every crystal has two resonances close together: a series resonance where its impedance is minimum, and a parallel resonance a fraction of a percent higher where it is maximum. Datasheets specify which one the part is cut for, along with the load capacitance the circuit must present. Get that wrong and the frequency is off by tens of ppm — enough to break a serial link or lose seconds a day on a clock.

Where they are: the 32.768 kHz crystal in every watch and real-time clock (that number is 2^{15}, so a fifteen-stage binary divider gives exactly one pulse per second), the 8 to 25 MHz crystal beside every microcontroller, and the reference in every radio transmitter. Temperature-compensated versions reach 0.5 ppm and oven-controlled ones reach parts per billion, which is what a mobile base station needs to stay synchronised.

6. The 555 timer

Designed by Hans Camenzind in 1971 at Signetics, and still manufactured by the billion. It is a comparator-based timer built around exactly the RC transient of Chapter 1.5.

What is inside

Three 5 kΩ resistors in series across the supply — the chain that gives the chip its name — forming a divider that produces \tfrac13V_{CC} and \tfrac23V_{CC}. Two comparators use those as references, an SR latch remembers which one fired last, and a discharge transistor dumps the timing capacitor when the latch is reset.

  • Threshold input, compared against \tfrac23V_{CC}. Crossing it resets the latch, taking the output low.
  • Trigger input, compared against \tfrac13V_{CC}. Going below it sets the latch, taking the output high.
  • Discharge pin, an open transistor to ground, on whenever the output is low.

That is the whole machine, and both modes below are just different external wiring of those five pins.

555two comparators+ SR latch+ discharge switchrefs at ⅓ and ⅔ Vccfrom the 3×5k chainoutputC⅔Vcc⅓Vcccapacitor charges through R1+R2, discharges through R2output high while charging, low while discharging — hence duty cycle above 50%
Astable operation. The capacitor ramps between the two internal references, and the output tracks which direction it is going. Because charging goes through both resistors and discharging only through one, the high time is always longer than the low time.

Astable mode — free-running oscillator

Wire it with R_1 from supply to the capacitor, R_2 from there to the discharge pin, and the capacitor to ground. Tie threshold and trigger together to the capacitor.

The cycle:

  1. Capacitor charges through R_1 + R_2 towards V_{CC}.
  2. It reaches \tfrac23V_{CC}; the threshold comparator fires; output goes low; the discharge transistor turns on.
  3. Capacitor now discharges through R_2 alone into the discharge pin.
  4. It falls to \tfrac13V_{CC}; the trigger comparator fires; output goes high; discharge turns off.
  5. Back to 1.

Deriving the timings. Charging from \tfrac13V_{CC} towards V_{CC}, stopping at \tfrac23V_{CC}. Using the RC formula from Chapter 1.5, the fraction of the remaining gap covered is

\frac{\frac23V - \frac13V}{V-\frac13V} = \frac{1/3}{2/3} = \frac12

so it takes \ln 2 = 0.693 time constants:

t_{high} = 0.693(R_1+R_2)C

Discharging from \tfrac23V_{CC} towards 0, stopping at \tfrac13V_{CC}, is also exactly half the gap, so also \ln 2 time constants:

t_{low} = 0.693\,R_2C

f = \frac{1}{t_{high}+t_{low}} = \frac{1.44}{(R_1+2R_2)C}

\text{duty cycle} = \frac{R_1+R_2}{R_1+2R_2}

Notice: the duty cycle can never be 50% or below, because t_{high} always includes R_1. Getting close means making R_1 small, which is limited by how much current the discharge transistor can take. Exactly 50% needs a diode across R_2 so that charging bypasses it.

Also notice what is absent: V_{CC}. Both thresholds are fractions of the supply, so a change in supply moves them both proportionally and the timing does not shift. The 555's frequency is independent of supply voltage, and that is a genuinely elegant piece of design.

Worked example. R_1 = 10 kΩ, R_2 = 47 kΩ, $C = 1\ \mu$F:

t_{high} = 0.693\times57{,}000\times10^{-6} = 39.5\ \text{ms}

t_{low} = 0.693\times47{,}000\times10^{-6} = 32.6\ \text{ms}

f = \frac{1}{0.0721} = 13.9\ \text{Hz}, \qquad \text{duty} = 54.8\%

A blinking LED at about 14 Hz.

Monostable mode — one pulse per trigger

Wire it with one resistor and one capacitor, and bring the trigger pin out separately.

At rest the output is low and the discharge transistor holds the capacitor at 0 V. Pull trigger below \tfrac13V_{CC} momentarily and the latch sets: output goes high and discharge releases. The capacitor charges through R until it hits \tfrac23V_{CC}, at which point the output goes low again and the capacitor is dumped.

Charging from 0 to \tfrac23V_{CC} means covering two thirds of the gap:

\frac23 = 1-e^{-t/RC} \;\Rightarrow\; e^{-t/RC} = \frac13 \;\Rightarrow\; t = RC\ln3 = 1.1RC

\boxed{t_{pulse} = 1.1RC}

Worked example. A five-second timer: choose $C = 10\ \mu$F, then R = 5/(1.1\times10^{-5}) = 455 kΩ, so use 470 kΩ giving 5.17 s.

The circuit ignores further triggers while the pulse is running, which makes it a good debouncer and a good "press once, run for N seconds" timer — a stairwell light, a bathroom fan overrun, a camera shutter delay.

Practical notes that save an afternoon

  • Pin 5, control voltage, exposes the \tfrac23V_{CC} reference. Put 10 nF from it to ground whether you use it or not; without that, supply noise gets straight into the timing and the output jitters. Drive it deliberately and you have a voltage-controlled oscillator or a pulse-width modulator.
  • Pin 4, reset, is active-low and must be tied high. Leaving it floating gives random behaviour that looks like a broken chip.
  • The output can source and sink 200 mA, which is unusually strong and lets it drive a small relay or a loudspeaker directly. It also produces a large current spike on the supply at every transition, so decouple with 100 nF right at the chip.
  • The bipolar original draws about 10 mA, which is far too much for a battery-powered design. The CMOS versions (7555, TLC555) draw microamps, work down to 2 V, and are a drop-in replacement.

7. Function generators and voltage-controlled oscillators

Two more standard arrangements worth recognising.

A triangle-and-square generator is an integrator (Chapter 2.5) and a Schmitt trigger in a loop. The Schmitt's square-wave output feeds the integrator, which ramps in the opposite direction; when the ramp reaches the Schmitt's threshold, it flips, and the ramp reverses. The integrator produces a triangle and the Schmitt produces a square, from two op-amps and five passive parts. Adding a shaping network of diodes rounds the triangle into a passable sine, and that is a bench function generator in outline.

A voltage-controlled oscillator is any of the above with a control input that changes the frequency. In the 555 it is pin 5; in an LC oscillator it is a varactor diode (Chapter 2.2) in the tank; in an integrator loop it is a current source that sets the ramp slope.

VCOs matter because of what you build with them. Put a VCO in a loop with a phase detector and a filter and you have a phase-locked loop, a circuit that locks its output frequency to an input reference. PLLs are how every radio synthesises its local oscillator, how every processor multiplies a 25 MHz crystal up to 3 GHz, and how every digital receiver recovers the clock from a data stream. Chapter 7.2 and Chapter 8.1 both depend on them, and Chapter 6.1 gives the feedback-loop mathematics that makes them behave.


Part 2 has been about signals that vary continuously. Part 3 restricts them to two values, which throws away almost all the information a wire can carry and gains, in exchange, the ability to copy and process it perfectly forever.

Every formula above, built from scratch

None of the results in this chapter are worth memorising, because each one can be rebuilt in under a minute from something simpler. What follows is that rebuilding, one result at a time, so the formula and the reason for it sit on the same page as the explanation that needed them.

Feedback and oscillators

A_f = \frac{A}{1-A\beta}

Negative feedback (A\beta \lt 0): A_f \approx -1/\beta when |A\beta|\gg1.

Desensitivity: a fractional change in A produces a fractional change in A_f smaller by the factor |1-A\beta|, which also multiplies the bandwidth and divides the distortion.

Barkhausen

|A\beta| = 1 \quad\text{and}\quad \angle A\beta = 0^\circ

Oscillator frequencies

f_{Wien} = \frac{1}{2\pi RC} \qquad (\text{gain must be } 3)

f_{phase-shift} = \frac{1}{2\pi RC\sqrt6} \qquad (\text{gain must be } \ge 29)

f_{Colpitts} = \frac{1}{2\pi\sqrt{LC_{eq}}}, \quad \frac{1}{C_{eq}}=\frac{1}{C_1}+\frac{1}{C_2}

f_{Hartley} = \frac{1}{2\pi\sqrt{(L_1+L_2)C}}

The 555

Astable:

t_{high} = \ln2\,(R_1+R_2)C = 0.693(R_1+R_2)C

t_{low} = \ln2\,R_2C = 0.693R_2C

f = \frac{1.44}{(R_1+2R_2)C}, \qquad D = \frac{R_1+R_2}{R_1+2R_2}

Where the \ln 2 comes from: charging from \tfrac13V towards V and stopping at \tfrac23V covers exactly half the remaining gap, and half a gap takes \ln 2 time constants. Discharging from \tfrac23V towards 0 and stopping at \tfrac13V is also exactly half. Both halves therefore share the same \ln 2, and the supply voltage cancels out completely — which is why the 555's frequency is supply independent.

Monostable:

t = RC\ln 3 = 1.1RC

Where the \ln 3 comes from: charging from 0 towards V and stopping at \tfrac23V leaves \tfrac13 of the gap, and e^{-t/RC} = \tfrac13 gives t = RC\ln 3 = 1.0986RC.


Sixteen worked problems on the next page.

What the next chapter fixes

Part 2 has built analog circuits: signals that vary continuously and components that respond in proportion. Part 3 throws that away deliberately. By allowing only two voltages and treating everything in between as an error to be squeezed out, digital circuits gain something analog can never have — they can be copied and regenerated forever without accumulating noise.