**Square Wave Generator Using Op amp:**

The Square Wave Generator Using Op amp means the **astable multivibrator circuit** using op-amp, which generates the square wave of required frequency. The Fig. 2.83 shows the square wave generator using op amp.

It looks like a comparator with hysteresis (schmitt trigger), except that the input voltage is replaced by a capacitor. The circuit has a time dependent elements such as resistance and capacitor to set the frequency of oscillation.

As shown in the Fig. 2.83 the comparator and positive feedback resistors R_{1} and R_{2} form an inverting schmitt trigger.

When V_{o} is at +V_{sat}, the feedback voltage is called the upper threshold voltage V_{UT} and is given as

When V_{o} is at -V_{sat}, the feedback voltage is called the lower-threshold voltage V_{LT} and is given as

When power is turn ON, V_{o} automatically swings either to +V_{sat} or to -V_{sat} since these are the only stable states allowed by the schmitt trigger. Assume it swings to +V_{sat}. With V_{o }= +V_{sat} we have – V_{p} = V_{UT} and capacitor starts charging towards +V_{sat} through the feedback path provided by the resistor R_{f} to the inverting (-) input. This is illustrated in Fig. 2.84 (a). As long as the capacitor voltage V_{C }is less than V_{UT}, the output voltage remains at +V_{sat}.

As soon as V_{C} charges to a value slightly greater than V_{UT}, the (-) input goes positive with respect to the (+) input. This switches the output voltage from +V_{sat} to -V_{sat} and we have V_{p} = V_{LT} , which is negative with respect to ground. As V_{o }switches to -V_{sat}, capacitor starts discharging via R_{f},** **as shown in the Fig. 2.84 (b).

The current I – discharges capacitor to 0 V and recharges capacitor to V_{LT}. When V_{C} becomes slightly more negative than the feedback voltage V_{LT}, output voltage V_{o} switches back to +V_{sat}. As a result, the condition in Fig. 2.84(a) is reestablished except that capacitor now has a initial charge equal to V_{LT}. The capacitor will discharge from V_{LT} to 0V and then recharge to V_{UT}, and the process is repeating. Once the initial cycle is completed, the waveform become periodic, as shown in the Fig. 2.84(c).

**Frequency of Oscillation:**

The frequency of oscillation of Square Wave Generator Using Op amp is determined by the time it takes the capacitor to charge from V_{UT} to V_{LT} and vice versa. The voltage across the capacitor as a function of time is given as

where

- V
_{C}(t) is the instantaneous voltage across the capacitor. - V
_{initial}is the initial voltage - V
_{max}is the voltage toward which the capacitor is charging.

Let us consider the charging of capacitor from V_{LT} to V_{UT}, where V_{LT} is the initial voltage, V_{UT} is the instantaneous voltage and +V_{sat }is the maximum voltage. At t = T_{1}, voltage across capacitor reaches V_{UT} and therefore equation (3) becomes

The time taken by capacitor to charge from V_{UT} to V_{LT} is same as time required for charging capacitor from V_{LT} to V_{UT}. Therefore, total time required for one oscillation is given as

The frequency of oscillation can be determined as f_{o }= 1/T, where T represents the time required for one oscillation.

Substituting the value of T we get,