Skip to content
LearnTronics menu

LearnTronics

Op-Amp Relaxation Oscillator

Tutorial Index

Recipe #30 — op-amp relaxation oscillator

An oscillator can also be built from a comparator or op amp. Positive feedback supplies two switching thresholds while an RC network supplies the delay between switching events.

OP-AMP / COMPARATOR RELAXATION OSCILLATOR +U1 SQUARE OUT R1 C1 R2 R3 C1 voltage ramps U1 flips when the capacitor ramp crosses the upper or lower feedback threshold.
Two jobs: R1 and C1 create a changing voltage. R2 and R3 feed part of the output back to the non-inverting input, creating two switching thresholds. Each output reversal changes which threshold C1 is moving toward.

The 555 is not magic

This circuit exposes the same general ingredients: a capacitor ramp, threshold comparison, and positive feedback. The 555 conveniently places similar decision-making blocks and a discharge switch inside one package.

Square wave out, ramp on the capacitor

The output snaps between its two limits, while C1 changes more gradually. Those two different waveforms are both useful: a square wave for switching and timing, and a ramp-like waveform for modulation or waveform generation.

The drawing uses a centered/bipolar-supply concept so ground can serve as the midpoint reference. A single-supply version normally biases the circuit around a mid-supply reference instead. A real op amp or comparator must also be chosen for input common-mode range, output swing, and desired frequency.

Try these yourself

What provides the time delay in this oscillator?
C1 charges through R1, so their RC time constant determines how quickly a threshold is reached.
What is the purpose of R2 and R3?
The divider feeds some output back to the non-inverting input and creates hysteresis.
What two waveforms appear naturally in this circuit?
The comparator output switches sharply while the timing capacitor changes gradually.