A Simple Function Generator




This is a simple function generator circuit that can produce the following waveforms: square wave, triangular wave, and sine wave.
   
The circuit's main components are two 1458 IC's.  The 1458 is a dual op-amp IC, i.e., an IC that houses two op amps inside it.  The circuit uses four op amps, two from each 1458.
  
The bottom-most op amp in Figure 1 is configured as an astable multivibrator, which continuously generates a square wave.  Assume that C1 has no charge initially. The voltage at the inverting input is zero, while the voltage at the non-inverting input is very slightly positive (a ratio of the op amp's output offset voltage as determined by R1 and R2). This minute voltage difference at the inputs is enough to cause the op amp's output to swing to 'high'.
  
When the output becomes high, C1 starts charging up. The voltage at the inverting input soon exceeds that at the non-inverting input, forcing the output to swing to 'low', which discharges C1 again.  At a certain point, the voltage at the non-inverting input exceeds that at the inverting input again, and the output of the op amp goes high again.
   
This cycle wherein the first op amp's output swings between 'low' and 'high' goes on indefinitely, generating the square wave.
  
The two middle op-amps are both configured as integrators. The input to the second op amp is the square wave output of the first op amp.  Being configured as an integrator, this op amp outputs a triangular wave (the integral of a square wave), as shown in Figure 1. 
    
The triangular wave output of the second op amp is then fed into the third op amp, which is also configured as an integrator.  The output of the third op amp is a sine wave (the integral of a triangular wave).
   
The sine wave output of the third op amp is fed into the fourth op amp, which is configured as an inverting amplifier. The output of this last op amp is also a sine wave but opposite in phase as its input. link