Home/Analog Electronics/Op-amp applications/Triangle / square wave generator

Triangle / square wave generator using Op-Amp (IC 741) – Virtual Lab

A non-inverting Schmitt trigger and an integrator connected in a loop form a simple function generator. The Schmitt trigger produces a square wave, the integrator turns it into a triangle, and the triangle in turn switches the Schmitt trigger at its thresholds.

Aim

To build a triangular and square wave generator using two IC 741 op-amps and verify its frequency and amplitude.

Circuit components

ComponentValuePurpose
IC 741OA1Non-inverting Schmitt trigger
IC 741OA2Integrator
R110 kΩFeedback from integrator output
R222 kΩSchmitt positive feedback
R, C110 kΩ, 100 nFIntegrator

Supply: ±12 V dual power supply. Instruments: function generator and two-channel digital storage oscilloscope, all on the virtual bench.

Theory

The square wave from OA1 (±Vsat) drives the integrator, whose output ramps down while the square wave is high and up while it is low. The ramp is fed back to the + input of OA1 through R1, where it is compared with zero.

OA1 switches when the triangle reaches ±Vsat × R1/R2, so this sets the triangle amplitude. The time to ramp between the two peaks at a slope of Vsat/RC gives the frequency f = R2/(4R1RC).

Because the integrator charges at a constant rate, the triangle is linear, unlike the exponential ramp in the simple astable multivibrator.

Triangle peak Vp = Vsat × R1/R2 = 10.5 × 10/22 ≈ 4.8 V
f = R2 / (4 R1 R C) = 22k / (4 × 10k × 10k × 100 nF) ≈ 550 Hz

Procedure

  1. Open the Op-Amp Trainer Kit simulator; it starts with the Triangle / square wave generator application selected.
  2. In Guided mode follow the highlighted connections to place the components from the parts bank and wire the circuit on the kit, or wire it yourself in Free mode.
  3. Set the dual power supply to ±12 V and switch it on.
  4. No input signal is needed: the circuit generates its own waveform.
  5. Connect CH1 and CH2 of the oscilloscope as shown and set: CH1 5 V/div (square), CH2 2 V/div (triangle), 500 µs/div.
  6. Switch on the supply; the circuit starts oscillating by itself.
  7. Measure the triangle amplitude and the square-wave levels.
  8. Measure the frequency and compare it with R2/(4R1RC).
  9. Capture the oscilloscope screen and compare it with the expected result below.
Function generatorNot usedOscilloscopeCH1 5 V/div (square), CH2 2 V/div (triangle), 500 µs/divSupply±12 V, ON

Expected result

The circuit produces a ±10.4 V square wave and a ±4.8 V triangular wave at about 530 Hz (calculated 550 Hz; the 741 slew rate lowers it slightly).

Viva questions

Why is the Schmitt trigger here non-inverting?
The integrator inverts the signal, so a non-inverting Schmitt trigger is needed to make the loop gain correct for oscillation.
How can the amplitude of the triangle be changed without changing frequency much?
Changing R1/R2 changes the amplitude, but it also changes frequency; adjusting R or C changes only the frequency.
How can a sine wave be obtained from this circuit?
By shaping the triangle with a diode network or filtering it with a low-pass filter.

Other op-amp applications