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
| Component | Value | Purpose |
|---|---|---|
| IC 741 | OA1 | Non-inverting Schmitt trigger |
| IC 741 | OA2 | Integrator |
| R1 | 10 kΩ | Feedback from integrator output |
| R2 | 22 kΩ | Schmitt positive feedback |
| R, C1 | 10 kΩ, 100 nF | Integrator |
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.
Procedure
- Open the Op-Amp Trainer Kit simulator; it starts with the Triangle / square wave generator application selected.
- 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.
- Set the dual power supply to ±12 V and switch it on.
- No input signal is needed: the circuit generates its own waveform.
- Connect CH1 and CH2 of the oscilloscope as shown and set: CH1 5 V/div (square), CH2 2 V/div (triangle), 500 µs/div.
- Switch on the supply; the circuit starts oscillating by itself.
- Measure the triangle amplitude and the square-wave levels.
- Measure the frequency and compare it with R2/(4R1RC).
- Capture the oscilloscope screen and compare it with the expected result below.
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
Linear amplifiers
Integrator and differentiator
Comparators and waveform generators
- Zero-crossing detector
- Comparator with reference
- Schmitt trigger
- Astable multivibrator
- Triangle / square wave generator
- Wien-bridge oscillator
Active filters
Non-linear circuits
All applications run on the Op-Amp Trainer Kit 3D virtual lab.