ATP Logo Dark

A Thousand Projects

Coder · Maker · Electronics

Schmitt Trigger Oscillator

April 30, 2019

PROS


  1. Easy and simple circuit
  2. Easy timing calculation
  3. Useful for non-critical oscillations or clock signals

Cons

  1. Subject to frequency changes with temperature differences
  2. Subject to frequency changes with supply voltage differences — also influenced by temperature

  3. Limited in frequency range at the higher end
  4. The Schmitt Trigger inverter was not designed for oscillation

Basic Principle

All oscillators are based on the same principle — a change in state between two voltages at a specified rate or frequency. Simple oscillators, such as the Schmitt Trigger oscillator, use Resistor/Capacitor (RC) circuits for timing, a simple and effective method. The resistor and capacitor values set how quickly the capacitor charges and discharges.

To understand how this works, it helps to think about what a capacitor actually does. Unlike a resistor, which simply opposes current flow, a capacitor stores electrical charge. When a voltage is applied across it, it does not instantly reach that voltage — it charges gradually, following a curved path described by the RC time constant (τ = R × C). The larger the resistor or capacitor value, the longer the charging takes. Discharging follows the same curve in reverse. This gradual rise and fall in voltage is the oscillator's heartbeat.

So what is a Schmitt Trigger anyway?

In a Schmitt Trigger oscillator, the inverter's output is fed back to its input through a resistor, with a capacitor connected between the input and ground. When the output is high, current flows through the resistor and begins charging the capacitor. The voltage across the capacitor rises until it crosses the Schmitt trigger's upper threshold, at which point the inverter output flips low. The capacitor then discharges through the resistor until the voltage falls below the lower threshold, causing the output to flip high again. This cycle repeats continuously, producing a square wave output.

The oscillation frequency is determined primarily by the RC time constant and the upper and lower threshold voltages of the specific Schmitt Trigger device being used. A rough approximation for frequency is:

f ≈ 1 / (1.2 × R × C)

though the exact figure will vary depending on the threshold voltages of the particular chip. This is why the Schmitt Trigger oscillator is considered imprecise—those thresholds aren't tightly controlled between individual components or across temperature and voltage variations, so the output frequency can drift. For non-critical applications such as a simple clock signal, LED flasher, or tone generator, this is perfectly acceptable. For applications requiring precise timing, a dedicated oscillator IC or crystal-controlled circuit is a better choice.

"A Schmitt Trigger is a comparator circuit with hysteresis implemented by applying positive feedback to the non-inverting input of a comparator or differential amplifier. It is an active circuit which converts an analogue input signal to a digital output signal."
- Wikipedia

The two key factors here are the comparator and hysteresis. The main point is that the inverter sets two threshold points as boundaries for the 'flip' state. What this means is that between the two comparison points there is a region where a change in the signal does not affect the state of the output — this is hysteresis — i.e. the static portion of the inverter. The Schmitt Trigger symbol gives the clue: two lines representing the two thresholds, with a single input and output.

The reason for the two thresholds is for stability. If you only have one trigger point you have a very real risk of misfires if there is noise in the signal. With the two thresholds for the upper and lower bounds, the area in between holds the state regardless of the noise. This is call hysteresis - sticking point.

V+: Positive threshold (Min, Max and typical)
V-: Negative threshold (Min, Max and typical)
Vh: Hysteresis voltage (Min, Max and typical)

V+ is the voltage of the rising edge at which the state will trigger
V- is the voltage of the falling edge where the state will trigger
Vh is the difference between the two.

This inverter is useful for converting a sine wave (or any changing wave) analogue signal to a square wave, also called a wave shaper.

The waveform above shows the green sine wave (100Hz) input from a signal generator and the yellow is the inverted output. When the voltage of the sine wave rises above 4.3v the state of the inverter flips to 0v (inverted to the input of the positive rising input signal), the output does not change until the waveform drops below 3V. The difference in voltage between the two state changes is 1.3v which is the hysteresis voltage of this device. 

The positive and negative values will be different for different devices (TTL vs CMOS for example) and different supply voltages. 

In the datasheet below for this device, highlighted in yellow for 10V, you can see the positive and negative thresholds. The right-hand columns show the typical values at 25 deg c. The values (Y1 and Y2) match up with the min column and the hysteresis ( difference between Y1 and Y2 ) value also fits into the min column. Voltages won't be exact as the temperature is not the same (currently much less than 25Deg in my office as I write this!) and not every device is the same. 

Note: As you can see from the temp and voltage columns, the threshold voltages vary considerably and this is the reason why this simple circuit is less than stable. 

So how does this help make an Oscillator?

The hysteresis values are exactly what is needed to create an oscillator. The upper and lower threshold values convert the input wave into a square wave by triggering the inverter only at those two points. What is needed is an input signal with feedback to keep the oscillation going, and the way to do this is to set up delayed feedback from the inverter output to its input. We use an RC (resistor/capacitor) circuit to create timed feedback as follows.

The way this circuit works is very simple:

 When you apply power, the input (pin 2) is low, so the output (pin 4) is high. (because this is an inverter). Current then flows from the output through the resistor, charging the capacitor.

 As the capacitor charges, the input voltage rises. When it reaches the positive edge threshold (about 4.5 volts), the input is high enough to switch the input to 'high' and the output to 'low'.

 Once the output is low, the capacitor can discharge via the resistor, slowly lowering the input voltage at pin 2 until the voltage passes below the negative threshold voltage of about 3 volts, where the inverter output flips back to 'high', and the process starts all over again, creating a contained oscillator.

 The magic is the two thresholds that allow for the state of the inverter to remain while the voltage is changing. If it were a single threshold, it would just generate a spike and not a clean square wave.

 Setting the frequency

 The frequency is a simple calculation (you can get really complicated about it, but for a simple circuit, a simple calculation will work). The trick here is to use the hysteresis voltage in the calculation, since it's the distance between these two values where the RC timing takes place.

 In other words, the hysteresis voltage is a portion of the total voltage at the input pin, as the voltages on either side of the thresholds do not affect the state,

 Remember, the larger the resistor or capacitor, the longer the capacitor takes to charge or discharge, so setting either one sets the charge/discharge timing.

 Time = Resistor x Capacitance.

The formula is :

The hysteresis voltage is included in the calculation because the charge and discharge of the capacitor happen between the positive and negative thresholds, and so we use the difference between these values, which is called the hysteresis voltage.

It's usually better to choose the capacitor and then calculate the resistance needed, as it's easier to fine-tune the resistance. The value is very unlikely to be an exact resistor value, so you can then either create the correct resistance using series and/or parallel resistors or a potentiometer - this is much easier than trying with capacitors.

We need to switch the formula around to calculate the resistance needed.

For this example, I have chosen a 44nF ceramic capacitor.

Your content goes here. Edit or remove this text inline or in the module Content settings. You can also style every aspect of this content in the module Design settings and even apply custom CSS to this text in the module Advanced settings.

Plugging in the values

Frequency = 100
capacitance = 44nF
Hysteresis Voltage = 1.3v

This gives a Resistor value of 295,545 ohms, or the closest value, 300 kΩ.

If you want a smaller resistor then choose a bigger capacitor value.

The oscilloscope capture above shows the green sawtooth wave generated by the resistor-capacitor circuit. As with the injected sine wave in the previous oscilloscope diagrams.
You will notice that the yellow square-wave output triggers at the peak and trough of the sawtooth wave! This is the resulting wave when the inverter switches from High to Low. Looking at values Y1 and Y2 (in the yellow rectangle), you can see that they match the Positive and negative threshold values.

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Pin It on Pinterest

Share This