Signals & Wireless (RF)
How an op-amp relaxation oscillator works
A relaxation oscillator makes a square wave from nothing but a supply. An op-amp is wired as a comparator with hysteresis: two resistors feed a fraction of its output back to its + input, so it has two thresholds. A resistor and capacitor on its − input form the timer. The output sits at one rail, the capacitor charges towards it, and when the capacitor crosses the threshold the output flips to the other rail. Now the capacitor charges the other way, and round it goes.
The circuit
- R1 and R2 from the output to the + input: the threshold is ± β × the output swing. With equal resistors, β is 0.5.
- R3 from the output to the − input, and C1 from the − input to ground: the timing leg.
One cycle
Say the supply is ±12 V and the output is at +12 V. The + input sits at +6 V. C1 charges towards +12 through R3, and the moment it passes +6 V, the − input is higher than the + input and the output snaps to −12 V. The threshold jumps to −6 V, and C1, starting from +6, now charges down towards −12. When it crosses −6 V, the output flips back. The capacitor never reaches either target, so the circuit never rests.
With β = 0.5 that's 2RC × ln 3, about 2.2RC:
Worked numbers
With C1 = 10 nF and R3 = 4.5 kΩ: 2.2 × 4500 × 10⁻⁸ ≈ 99 µs, so the formula says about 10 kHz. With 45 kΩ it's 1 kHz. Double C1 and the frequency halves. The output is a square wave; the capacitor's voltage is a string of rounded ramps between −6 and +6 V.
Live experiment
Start an oscillator from nothing
An op-amp with half its output fed back to +, and R3 charging C1 on the − input. Switch it on and watch the output snap to a rail while C1 chases the threshold, then flip. Pick R3: 45 kΩ gives 1.0 kHz, 4.5 kΩ about 9.5 kHz, 2.2 kΩ about 18 kHz.
“Make a carrier” is lesson 4 of 6 in Oscillator Outcrop, Signals & Wireless (RF) World 2. Free with an account. Lessons unlock in order, so you’ll do the 10 before it first.
Why the real circuit runs slow
At 4.5 kΩ the board runs at 9.5 kHz, not 10. An op-amp that slews at 5 V/µs takes about 4 µs to swing between its rails, twice every cycle. At 1 kHz that's nothing; at 10 kHz it's about 8 % of the period. For faster oscillators, use a comparator chip, which switches in nanoseconds.
Accuracy
The frequency depends on R and C, so 5 % parts mean a frequency within about 10 %, and it drifts with temperature. That's fine for blinking, beeping and test signals. Clocks, radios and USB need a quartz crystal instead, accurate to tens of parts per million. The famous 555 timer is a relaxation oscillator built the same way, with its thresholds at a third and two thirds of its supply.
Free lesson
Now build it yourself
Each lesson comes in three short parts: see the idea, try it on a live board, then build it yourself, with quick checks as you go.
“Make a carrier” is lesson 4 of 6 in Oscillator Outcrop, Signals & Wireless (RF) World 2. Free with an account. Lessons unlock in order, so you’ll do the 10 before it first.
Or start from the very first lesson, no account neededPractice questions
Three quick questions from the lessons. Pick an answer to check it.
Show the answer
Answer: Every time the capacitor reaches the threshold the output flips and the capacitor has to go the other way. The output is always driving the capacitor toward the level that will make the output flip. There is no state where everything stays put.
- Why not “The rails are too high”? The rail voltages set how big the square is, not whether the circuit oscillates.
- Why not “There's no input”? Having no input doesn't stop a circuit settling. This one can't because its output always drives the capacitor towards the level that flips it.
- Why not “The op-amp is broken”? A working op-amp does exactly this: it compares, flips, and the RC sends it back again.
Show the answer
Answer: The op-amp takes a few microseconds to slew from one rail to the other on every flip. This op-amp slews at 5 V/µs, so crossing about 20 V takes about 4 µs, twice a cycle. At 1 kHz that's nothing; at 10 kHz it's 8 % of every cycle.
- Why not “The capacitor leaks”? A leak would show at slow rates too, but at 1 kHz the circuit matches the formula. The gap appears only at high frequency.
- Why not “The battery is flat”? The thresholds scale with the output swing, so a lower supply doesn't change the formula's timing.
- Why not “The formula is for a different circuit”? It's the right formula, 1 ÷ (2.2RC). It just ignores the time the output spends swinging between the rails.
Show the answer
Answer: Follows the output through R3 at once: no delay, so it never swings between the thresholds. No delay means no oscillation: the − input is at the output's level immediately, so it never has to charge from one threshold to the other. The loop just settles.
- Why not “Oscillates slower”? Less capacitance means less delay, not more. With none, the delay disappears and the loop settles.
- Why not “Floats”? R3 still connects the − input to the output, so it's driven, not floating.
- Why not “Still oscillates at 10 kHz”? The 10 kHz comes from charging C1 through R3. Without C1 there's nothing to set a rate.
“Make a carrier” is lesson 4 of 6 in Oscillator Outcrop, Signals & Wireless (RF) World 2. Free with an account. Lessons unlock in order, so you’ll do the 10 before it first.
Questions people ask
What is a relaxation oscillator?
An oscillator that charges a capacitor until its voltage reaches a threshold, then flips and charges it the other way. The timing comes from the RC charging, not from a tuned circuit, so it makes square or triangle-like waves rather than sines.
How do I calculate the frequency of an op-amp relaxation oscillator?
The period is T = 2RC × ln((1 + β) ÷ (1 − β)), where β is the fraction of the output fed back to the + input. With two equal resistors, β is 0.5, ln 3 is 1.1, so T ≈ 2.2RC and f ≈ 1 ÷ (2.2RC).
Is the 555 timer a relaxation oscillator?
Yes. In astable mode it charges a capacitor between a third and two thirds of its supply, using two comparators and a latch instead of one op-amp with hysteresis. Its frequency is about 1.44 ÷ ((R1 + 2 × R2) × C).
Why does my oscillator run slower than the formula says?
The formula assumes the output flips instantly. A real op-amp slews at a few volts per microsecond, so crossing 20 V or more takes microseconds, twice a cycle. At low frequencies that's negligible; at tens of kilohertz it's several per cent.
Related topics
- Comparator hysteresis and the Schmitt triggerTwo thresholds instead of one: how a feedback resistor stops a comparator chattering on a noisy signal.
- RC time constant explainedτ = R × C: how long a capacitor takes to charge through a resistor, and the 63% rule.
- Op-amp slew rate explainedThe fastest an op-amp's output can move, in volts per microsecond, and why it bends big, fast waves.
- Op-amp comparator explainedTwo inputs, one decision: the output slams high or low the moment one input passes the other.