retro-static Projects

A simple Signal Generator made using Op Amps


The Circuit

The circuit is a simple one and produces a square and triangle wave, as well as an approximation of but not a true sine wave. I designed the circuit in LTspice.



It uses the LM324 opamp to create a square wave of up to about 7 volts peak to peak with the 9 volt battery voltage. The circuit creates the square wave by outputting the opamp saturation voltage while the capacitor C1 in the bottom circuit and C4 in the top are charging and then outputting 0 volts while the capacitor discharges. The rate the capacitor charges and discharges and therefore the frequency of the waveform is determined by the RC circuit C1, R5 and R8 in the bottom circuit and C4, R13 and R15 in the top. R8 and R15 are both 100K logarithmic Pots that give a frequency range adjustment of 1.25kHz to 5kHz.

The triangle waveform is created using an RC integration circuit consisting of R14 and C5. While the square wave input to this circuit is high the output voltage rises at a steady rate, and when the square wave is low the voltage drops at a steady rate creating the triangle waveform.

This does however mean that the peak to peak voltage of the waveform is dependent on the frequency. At 1.25kHz the peak to peak voltage is about 2.2 volts and at 5kHz it's about 0.4 volts peak to peak, centered at about 3.5 volts. The LM324 op-amp does come in a package of 4, so I did consider using the extra two op-amp as amplifiers as below. However in the end I just made the simpler circuit.

The sine wave is created using an RC integration circuit that has a triangle wave as the input. It is on a separate circuit to the square and triangle wave forms not only because that allowed me to keep the sine wave about the same voltage as the triangle wave instead of again being reduced by almost two thirds, but also because it is hard to get a waveform that looks anything like a sine wave without first distorting the triangle waveform. The 3 waveforms can be seen in the video below.

I designed the PCB using Altiums CircuitMaker, and ordered it from PCB Way in China.