This article will present different circuits that can be used to generate square and sinewave oscillators. Think of it as another tool in your electronics toolkit.
But first of all .. some information before we begin
Harmonic/Linear Oscillator
A harmonic/linear oscillator fluctuates about a middle equilibrium point. Often resonant (current from one storage device goes to another). These are generally sine wave generators
Relaxation Oscillator
A relaxation oscillator has an upper and lower threshold to define the HIGH and LOW signal, i.e. it employs hysteresis. It produces square, triangle, sawtooth waves BUT NOT sine waves. The principle of operation relies on charging/discharging of a cap or inductor.
Delay Line Oscillator
The principle of operation relies on exploiting the propagation delay of devices
Astable and Monostable Multivibrator
The term multivibrator means a circuit whose output toggles between two states.
Monostable has one stable state and only toggles when triggered externally
Astable has two stable states and is self-triggering
RC Time Constant
At the heart of many oscillator circuits presented below is the charging and discharging of a capacitor. If we add a resistor, we can manipulate this charging/discharging behavior. This is integral for some oscillator circuits.
The main takeaway is that it is exponential, not linear.
The time constant of the circuit is:
τ = RC
One time constant is the time it takes for the capacitor to charge to 63.2% of the applied voltage. After 5 time constants, the capacitor is charged to 99.3% of the applied voltage.
The Circuits!
1. Schmitt Trigger Inverter
The following circuit is developed using the 40106 hex Schmitt-Trigger Inverter.
This is a relaxation oscillator producing a square wave.
This circuit has the advantage of hysteresis
Schmitt triggers can be built from discrete transistors or from an op amp
The 40106 hex inverter consists of 6 Schmitt-gated inverters in a single 14-pin DIP package. It is from the 4000 Series and has an output of 10mA.
At 5V supply, the typical hysteresis value is 0.8V to 0.9V
The formula for the RC time constant is:
f = \frac{1}{1.2RC}Circuit Operation
- Starting state is a low input which is inverted to a HIGH
- Current flows through the feedback loop charging C1 through R1
- Once C1 rises above the upper threshold voltage, the Schmitt trigger toggles, sending the output LOW
- C1 discharges through R1 until the voltage drops below the lower threshold, triggering the Schmitt Trigger to output HIGH
- REPEAT
The fact that we’re using feedback (feeding a portion of the output to the input) means that we are indirectly loading our circuit. The remedy is to employ a buffer. The high input impedance of the buffer prevents loading the feedback loop which ensures the charge/discharge rate isn’t tampered with.
2. Ring Oscillator
This is a delay line oscillator that produces a square wave. In this circuit, we exploit the propagation delay of the inverters. This delay is usually in the nanoseconds.
NOTE: TTL IC’s have slower delays than CMOS IC’s
The ring oscillator consists of an odd number of inverters in series, with the last one connected to the first one.
If the first inverter’s input is low, its output is high, which is connected to the input of the second inverter, whose output is therefore low.
This is why the number of inverters must always be odd.
The low output from the second inverter causes the output from the third inverter to be high, which is linked back to the first inverter’s input, pushing it high and changing its state.
This repeats.
This circuit produces rapid oscillations suitable for clock signals.
To configure the frequency, acquire the propagation delay from the datasheet then use the following formula:
f = \frac{1}{T_p n}Where:
- Tp = Propagation delay
- n = number of inverters
The frequency will usually be in the MHz
3. NAND Gate Oscillator
This circuit is a variation of the ring oscillator presented in the previous section. However, rather than relying on the propagation delay, we include one cap and two resistors. Doing this means we only need three inverters.
The circuit below produces a square wave.
Initially, the inputs are low so all outputs are high.
Eventually, one of the gates will respond to noise first and active, but we have the RC network of R2 and C1. C1 holds the input of IC1c low, because the capacitor draws current.
This persists long enough for the stable state to settle in where the output of IC1c is high, charging C1 through R2.
R1 is ten times the value of R2, so the voltage at the input of IC1a is much lower at first while the capacitor charges.
This ensures that its output is high, holding the input of IC1b high and its output low.
The other side of C1 is grounded via the low output of IC1b and input of IC1c.
The voltage across capacitor C1 rises to above the threshold of the input of IC1a, which is now taken high. Its output therefore goes low, causing the output of IC1b to go high. This C1 to discharge through R2.
It also forces the output of IC1c low.
A fourth gate, IC1d, acts a buffer.
The frequency of oscillations is:
f = \frac{1}{2.2R_2 C}If you seek a simpler circuit and are giving to sacrifice precision, consider the following circuit which only consists of a single NAND gate and a single RC network.
4. The Dual Supply Op Amp
This circuit produces a square wave. Using an opamp is not as effective as a comparator but for a simple application, it gets the job done.
NOTE: The differences between an opamp and comparator are subtle. Opamps have push-pull outputs, allowing them to source and sink current. The voltage cannot swing from rail-to-rail. Comparators are different. They have open-collector transistor outputs which allows them to swing from rail-to-rail
The following circuit is for a dual-rail supply.
Assume the output is high. The voltage divider of R2 and R3 establish the reference voltage at the non-inverting input.
C1 charges via R1 until the voltage at the inverting input surpasses the voltage at the noninverting input. At this instance, the output swings low.
The R2/R3 voltage divider is now connected between the output at nearly the negative voltage, and ground. The opamp behaves as a current sink.
This gives a negative voltage on the non-inverting input, changing the threshold.
The capacitor also discharges into the output.
When its voltage drops to below the new reference at the non-inverting input, the output switches back.
This creates hysteresis which is vital for oscillation.
If R3 is 0.462(R2+R3), then the frequency of the oscillator is:
f = \frac{1}{2R1C1}5. Single Supply Op Amp
If a dual-rail supply is not available, the same circuit presented in the previous section can be adapted for a single-rail supply.
This circuit produces a squarewave output
The voltage divider is present but slightly different
When the output is high, the voltage at the non-inverting input is set by the two connections to V+, R2 and R4, and R3.
When the output is low, there is one connection to V+, R2, and two to ground: R3 and R4.
Therefore, the threshold at the non-inverting input is two thirds V+ when the output is high, and one third V+ when the output is low. That is, if the three resistors are equal.
f=\frac{1}{2}(In_2)R_1C_1
= \frac{1}{(1.3863)R_1C_1}6. The Comparator
Using a comparator offers the advantage of better noise immunity and a cleaner output, as opposed to an opamp. Also, some comparators have integrated driver networks, reducing the need for external circuitry.
A superior oscillator circuit can be built from comparators rather than opamps.
The LM311N is used in the following circuit
This circuit is very similar to the single supply opamp. Even the calculations are the same.
The emitter is grounded whilst the collector is current-limited via R5.
7. The Astable Multivibrator
This circuit produces a squarewave output
Initially, Q1 is conducting.
This allows C2 to charge via R4. Q1 remains on due to R3.
R1 charges C1 but Q1 is shorting it to ground.
Once C1 charges above V_BE of Q2, Q2 conducts.
This shorts C2, however it is now at Vcc – 0.7V (assuming Vcc = 9V). This turns off Q1.
Now, C1 charges again via R1 on the positive side, with the negative side held at 0.7V by R2 feeding the base of Q2, which is on, repeating the cycle.
R5 and the Darlington transistor (Q3) is used to buffer the multivibrator circuit. The motivation is that we do not want to alter the timing of the oscillator.
f=\frac{1}{(In_2)R_2 C_1 + (R_3 C_2)} =\frac{1}{In_2 2RC}8. The NE555
The NE555 makes a fantastic oscillator.
The following circuit produces a 1kHz rectangular wave at 25% duty cycle
Upon power up, pin 3 (output) is high. C1 begins charging via R1 and R2 until it reaches 2/3Vcc.
When it does, pin 3 toggle low and pin 7 sinks the voltage at C1.
This continues until the voltage at pin 2 (V_C1) reaches 1/3VCC.
At this stage, pin 3 goes high, pin 7 discontinues sinking current.
REPEAT!
To adjust the frequency of oscillations use the following formula:
\begin{aligned}
f &= \frac{1}{T} = \frac{1.44}{(R_{1} + 2R_{2}) C_{1}} \\[6pt]
T &= \frac{1}{f} = 0.693 (R_{1} + 2R_{2}) C_{1} \\[6pt]
T_{1} &= 0.693 (R_{1} + R_{2}) C_{1} \\[6pt]
T_{2} &= 0.693 R_{2} C_{1}
\end{aligned}
The NE555 has some advantages over the previous oscillator circuits presented.
- The NE555’s timing characteristics vary only minimally across its voltage supply range: The calculations are as valid at 5V as they are at 15V. Compare that to a Schmitt Trigger Inverter IC, which has a hysteresis of around 0.8V at 5V supply, but nearly 2V at 15V supply.
- Pin 3 is independent of the timing circuit (at least in this circuit). Thus, changes in output load will not alter the timing characteristics.
- The output can both source or sink 200mA of current, allowing it to drive significant loads
This circuit is a Square wave generator with a 50% duty cycle. By eliminating pin 7, the charging/discharging is solely determined by R1 and C1. The operation is similar to the first circuit. I’ll leave it upto to dissect.
The formulas:
\begin{aligned}
f &= \frac{1}{T_{T}} \\[6pt]
T_{T} &= 1.4RC \\[6pt]
T_{1} &= T_{2} = 0.7RC
\end{aligned}
9. Crystal Oscillator
Crystal oscillators are used in high-precision oscillators because the resonant frequency is very precise.
A crystal is a small sliver of quartz crystal sandwiched between two electrodes.
It’s operation exploits the piezoelectric effect.
This is a phenomenon that generates current from the crystal when mechanical pressure or vibration is applied. Conversely, if current is applied to the crystal, it results in physical vibration.
Therefore, RESONANCE
One of the most common crystal oscillators is the Colpitts oscillator.
In the above circuit, a tank circuit is formed with X1, C1 and R2. This prevents loading and limits the current to the crystal. R1 and R2 bias the base of Q1.
C2 and C3 reduces the feedback from the emitter of Q1. This reduces power losses. C2 and C3 also reduce the gain of Q1 which transforms Q1 from a emitter-follower configuration to a voltage follower.
R4 sets the current through Q1.
X1 can be can commercially available value. C1 can be adjusted until oscillations are achieved.
A crystal oscillator can also be accomplished by using a Schmitt inverter IC.
NOTE: A 4000 CMOS Series IC must be used to achieve the required speeds
In Conclusion
This page presented different circuits for generating oscillators. Despite the wide variety presented, some circuits work well for specific applications. E.g. some can be used as a clock signal for an MCU whilst others aren’t that precise and can only be used to drive a shift register for an LED circuit.
Although these circuits are outdated since you can easily output a squarewave using an MCU, there might be instances where these circuits maybe used.















