November 19's Wien bridge oscillator made a 1 kHz sine wave — but with its gain set just above 3, the output kept growing until the op-amp clipped it into a square-ish wave. A real oscillator needs automatic gain control (AGC): a circuit that holds the gain at exactly 3 and the amplitude steady. Two small diodes across one feedback resistor do exactly that, and they cost almost nothing. This article adds diode AGC to the Wien bridge and works out the numbers.
Figure 1: A Wien bridge oscillator with diode AGC (a) — the two diodes across R2 set the output level. With AGC the output settles to a clean 0.90 V sine; without it, it grows until it clips at ±10 V (b). (Schematic, not to scale.)
How it works — the formula
The Wien bridge (R = 16 kΩ, C = 10 nF) sets the frequency, f0 = 1 / (2Ï€RC) = 1 / (2Ï€ × 16,000 × 10 × 10−9) = 994.7 Hz, with a period of 1.005 ms. At f0 the bridge passes exactly one third of the output back to the + input with zero phase shift, so the amplifier needs a gain of exactly 3 to sustain oscillation — and the gain is set by R1, R2 and R3:
gain = 1 + (R2 + R3) / R1 = 1 + (10 kΩ + 10 kΩ) / 10 kΩ = 3.00
With the gain at exactly 3 the oscillation would neither grow nor shrink — but component tolerances make that impossible to hold, so the diodes do the holding instead. While the output is small, the diodes are off and the gain is 3, so the sine wave grows. As it grows, the voltage across R2 grows too: the − input sits at Vout/3, so the voltage across R2 is Vout − Vout/3 = (2/3)Vout. When that reaches a diode's forward voltage, about 0.6 V for a 1N4148, the diodes start to conduct and short out R2, dropping the gain to 1 + R3/R1 = 1 + 10/10 = 2 — below 3, so the output stops growing. The amplitude settles where the diodes just begin to conduct:
(2/3) × Vout(pk) = 0.6 V → Vout(pk) = 0.90 V
Worked example — a clean 0.90 V sine at 995 Hz
Switch the circuit on and the output starts as a tiny sine wave from the op-amp's own noise. In practice the gain is a touch above 3 at first, so the amplitude grows exponentially with a time constant of a few milliseconds — Figure 1(b) shows it reaching 0.90 V peak in about 7 ms, roughly seven cycles. Once it settles, the diodes conduct only near the peaks of each cycle, trimming the gain for a short part of every period. The result is a clean 0.90 V peak sine wave — 0.64 V RMS — with a total harmonic distortion typically around 0.5–1%, because the diodes only touch the waveform at its peaks. Without the diodes, the same circuit with its gain set to 3.1 would keep growing until the op-amp's output hit its ±10 V rails on ±12 V supplies and clipped flat, giving a distorted, almost square wave with harmonics over 10%.
The diodes' forward voltage drifts −2 mV/°C with temperature, so the settled amplitude drifts too: a 25 °C rise drops Vf from 0.60 V to about 0.55 V, and the output peak falls from 0.90 V to 0.55 × 3/2 = 0.83 V, about 8%. That is the price of the simplest AGC — acceptable for a test oscillator, and the reason precision sine generators use a JFET or a lamp as the gain element instead, where the resistance changes smoothly with the signal level and the distortion is lower.
The catch — why the diodes must sit across R2, not R1
The diodes work because they change the feedback resistance as the signal grows. Across R2 they do exactly that: small signals see R2 = 10 kΩ and a gain of 3; large signals see R2 shorted and a gain of 2. If you put them across R1 instead, they would change the gain the wrong way — shorting R1 raises the gain toward infinity, and the output would slam into the rails. The same rule applies to any AGC element in this circuit: it must sit in the upper feedback arm, where more conduction means less gain. Also keep the diode current small — at the peaks the diodes carry only a few hundred microamps, which is why a small-signal diode like the 1N4148 is the right part, not a power rectifier.
Designing a 10 kHz version
Suppose you need the same oscillator at 10 kHz. Keep C = 10 nF and scale R: R = 1 / (2Ï€ × 10,000 × 10 × 10−9) = 1.59 kΩ. The nearest standard value, 1.6 kΩ, gives f0 = 1 / (2Ï€ × 1600 × 10 × 10−9) = 9947 Hz — within 0.5% of the target. Keep R1 = R2 = R3 = 10 kΩ unchanged: the gain is still 3, the diodes still conduct at (2/3)Vout = 0.6 V, and the output still settles at 0.90 V peak. Only the frequency moved — the AGC level is set by the diode voltage and the resistor ratio, not by the bridge, so one design rule covers every frequency.
Key points to remember
- A Wien bridge needs a gain of exactly 3 at f0 = 1/(2Ï€RC) = 994.7 Hz here; diode AGC holds it there by trimming the gain when the output grows.
- Worked example: R1 = R2 = R3 = 10 kΩ gives a small-signal gain of 3; the diodes across R2 conduct when (2/3)Vout = 0.6 V, so the output settles at 0.90 V peak with ~0.5–1% distortion.
- Without AGC the output grows until it clips at the ±10 V rails — a distorted, almost square wave; with AGC it settles in about 7 ms to a clean sine.
- The diodes must sit in the upper feedback arm (across R2), where more conduction means less gain — across R1 they would raise the gain and slam the output into the rails.
- Design rule: for 10 kHz, R = 1.59 kΩ — 1.6 kΩ gives 9947 Hz, and the output still settles at 0.90 V peak, because the AGC level depends on the diode voltage, not the frequency.
