# Cool Cap Engineer

## Tutorials: Op Amp Relaxation Oscillator

Relaxation oscillator on the bread and waveform taken on oscilloscope.

So lately I’ve been messing around with op amps. Why? Because I want to learn more about oscillators and wanted to build one from scratch. One of the simplest oscillator to build using an Op Amp is a relaxation oscillator. Today, I’ll talk about how it works and a small experiment using the oscillator.

What is an oscillator?
An oscillator is a circuit designed to output a repetitive signal over and over again based on a certain frequency. Oscillators are often use for devices such as switching regulators and making sure your PC’s CPU operates correctly. Some of the waveforms an oscillator can output includes square waves, sine waves, sawtooth waves, triangle waves, etc. Today’s relaxation oscillator will output a square pulse with a 50% duty cycle.

How does A Relaxation Oscillator work?

Relaxation Oscillator schematic

An Op-Amp relaxation oscillator is comprised of two parts: a schmitt trigger and a RC  circuit (R3 and C1). When the circuit is powered, it charges the capacitor in the RC network. Keep in mind that whatever voltage appears at the capacitor will appear at the non-inverting pin of the op-amp (pin 3). The schmitt trigger (R1 and R2) determines when the output will swing from high to low or low to high.  In other words, the schmitt trigger determines when the capacitor will start charging or discharging.

Output waveform (yellow) and the charging voltage of the capacitor (blue)

The figure above was taken from an relaxation oscillator with 15V peak to peak voltage. Although it shows 30V peak to peak, the DC offset of the waveform was set around 15V. Nevertheless, you can see that when the capacitor is charging, the relaxation oscillator output goes high, and goes low while the capacitor is discharging.

The frequency of the waveform can be set using the following equation:




Keep in mind, these equations work under the assumption that the voltage on pin 8 and 4 of the op amp are symmetrical. For example, if you apply 9V to pin 8, then -9V should be applied to pin 4. Also, if you apply 15V to pin 8, then -15V should be applied to pin 4.

Although I now have an oscilloscope – a crappy one, but still an oscilloscope- I realized some of you guys probably do not have one. So, I devised a small circuit that will turn on flash two LEDs on and off every 250ms. You will need the following materials:

1x DC Power Supply (Able to supply +15V and -15V)
1x LM741 Op Amp
3x 1K Ohm Resistors
2x .1uF Capacitors
1x  10K Resistors
1x 1uF Capacitors
2x LEDs