Electronic Basics #35: Schmitt Trigger and when to use them

The Power of Schmitt Triggers: Unlocking the Secrets of Operational Amplifiers

When it comes to working with operational amplifiers (op amps) in circuits, understanding their behavior is crucial. In this article, we'll delve into the world of op amps and explore how they can be used to create square waves on their output.

Connecting a Voltage Reference to an Op Amp

-----------------------------------------

As you may know, when we use an op amp in a circuit by connecting a voltage reference to its inverting input, and a triangle voltage between 0 and 5 volts to its non-inverting input, the resulting output is often a square wave. But what's behind this behavior?

The First Golden Rule of Op Amps

------------------------------

The reason for this behavior can be explained by the first golden rule of op amps, which states that an op amp will do anything to achieve a zero volt difference between its inputs. Without a feedback system, the output either swings up to the positive supply voltage if the non-inverting input has a higher voltage potential than the inverting input, or swings down to zero volts if the inverting input voltage is higher than the one on the non-inverting input.

Op Amps as Comparators

-----------------------

This behavior makes op amps useful as comparators. A comparator is an important circuit when it comes to monitoring voltages and activating alarms if they fall below a certain threshold value. However, comparators are not perfect, and observing the output voltage while the monitored voltage crosses the reference voltage reveals that there's not one definite transition – instead, we see tons of pulses.

The Solution: Schmitt Triggers

-----------------------------

To solve this noise-related problem, we need to turn our comparator into a Schmitt trigger. This can be achieved with just a couple of resistors and depending on how they're connected to the comparator, we can create either an inverting or non-inverting Schmitt trigger.

What is a Schmitt Trigger?

-------------------------

A Schmitt trigger offers two threshold values – a high one and a low one. Only if the to-be monitored voltage passes the high threshold value does the output get pulled high, and only if the low threshold value gets undershot does the output get pulled low. This hysteresis voltage (between the two thresholds) means that there's no switching of the output possible.

The Functional Principle of a Schmitt Trigger

---------------------------------------------

This functional principle is similar to a non-inverting Schmitt trigger, while an inverting Schmitt trigger would reverse the output state for its high and low threshold values. We can calculate the hysteresis and threshold voltages for both types of Schmitt triggers with various formulas.

Focusing on the 74HC14 Hex Inverting Schmitt Trigger IC

---------------------------------------------------------

Since building a Schmitt trigger with an op-amp is rarely done nowadays, let's focus on the 74HC14 hex inverting Schmitt trigger IC. Its datasheet tells us the universal symbol of a Schmitt trigger.

Connecting the IC to a Supply Voltage

--------------------------------------

After connecting the IC to a supply voltage of 5 volts, we can connect our to-be monitored voltage to one of the six data input pins and observe the schmitt trigger signal on its corresponding data output pin. This is in bursts due to the name of this IC.

Getting Rid of Inversion with Two Schmitt Triggers

------------------------------------------------

By utilizing two of these Schmitt triggers in series, we can get rid of the inversion. We can use a potentiometer on the input to slowly rise and lower the voltage in order to find out that the two threshold voltages are around 0.7 volts.

RC Network for Bouncing

-------------------------

If you're trying to add a push button to an Arduino circuit, you wouldn't need the RC network for bouncing since the digital inputs of the microcontroller already offer high and low threshold voltages similar to a Schmitt trigger.

Creating a Simple Relaxation Oscillator

------------------------------------------

To create a simple relaxation oscillator, we can use a capacitor and resistor with a Schmitt trigger. Due to the hysteresis voltage, the capacitor gets charged/discharged continuously, resulting in a square wave on the output. Using a potentiometer as a resistor makes it easy to reach frequencies in the kilo Hertz range.

Schmitt Triggers for Noisy or Worn-Out Data Signals

-----------------------------------------------------

Finally, a Schmitt trigger is very useful if you have a noisy or worn-out data signal that you want to freshen up. With this understanding of schmitt triggers, you should now be familiar with the basics and understand why they're often important components.

In conclusion, schmitt triggers offer a solution to many noise-related problems in electronics and are often used for filtering out unwanted signals. By understanding their behavior and how to use them effectively, you can unlock the secrets of operational amplifiers and create more reliable electronic circuits.

WEBVTTKind: captionsLanguage: enAs you might know when we use an operational amplifier in a circuit by connecting a voltage reference of, for example,2.5 volts to its inverting input, and a triangle voltage between 0 and 5 volts to its non inverting input,Then the op amp would create a square wave on its outputThe reason for this behavior can be explained by the first golden rule of op ampsWhich, you should be familiar with if you watch my basics video about the subjectBut anyway, the rule states that an op amp will do anything to achieve a zero volt difference between its inputsBut since our op amp configuration got no feedback system, the output either swings up to the positive supply voltageIf the non-inverting input has a higher voltage potential than the inverting inputOr swings down to zero volts if the inverting input voltage is higher than the one on the non-inverting inputThis way the op amp acts as a comparatorWhich is an important circuit when it comes to monitoring voltagesAnd, for example, activating an alarm if they fall underneath a certain threshold valueBut of course, comparators are not perfect. if we observe the output voltage while the monitored voltage crosses the reference voltageThen we can see that there's not one definite transition, there are tons of pulsesSo in this video, I will tell you all the basics about so-called schmitt triggers, which would be the solution to our noise related problemLet's get started!This video is sponsored by JLCPCBOne fact about them; the annual production capacityOf JLCPCB is two hundred thousand square meters for different layouts of PCBsUpload your Gerber files to order high quality PCBs for low prices, currently even with free shippingAll we need to turn our comparator into a Schmitt trigger is a couple of resistorsAnd depending on how we connect them to the comparator, we can create a non inverting or an inverting schmitt triggerBut what is the function of such as schmitt trigger to begin with?Well as i said before, with a comparator we got one threshold value which determines whether the output is high or lowA schmitt trigger on the other hand offers two threshold values, a high one and a low oneSo only if the to-be monitored voltage passes the high threshold value, the output gets pulled highAnd only if the low threshold value gets undershot the output gets pulled lowThis way we can avoid noise caused oscillation on the output because in this so-calledHysteresis voltage (between the two thresholds) no switching of the output is possibleNow this functional principle of a schmitt trigger would equal that of a non-inverting oneWhile an inverting schmitt trigger would basically work the same, but reverses the output state for its high and low threshold valuesAnd of course we can calculate the hysteresis and threshold voltages for both schmitt trigger types with a few different formulasIf you're interested in that then definitely check out the video descriptionWhere you can find some useful linksBut since you rarely build up a Schmitt trigger with an op-amp nowadaysLet's rather focus on the 74 HC 14 hex inverting schmitt trigger IC that I often like to useFirst off its datasheet tells us the universal symbol of a schmitt triggerAnd after connecting the IC to a supply voltage of 5 voltsWe can connect our to-be monitored voltage to one of the six data input pinsAnd observe the schmitt trigger signal on its corresponding data output pin which is obviously, due to the name of this IC, in burstsBut don't worry; if we put two of them in series, then we can get rid of this inversionNow by utilizing a potentiometer on the inputI slowly rose and lowered the voltage in order to find out that the two threshold voltages were around 2.1 volts and 3.1 voltsWhich pretty much correlates with what the datasheet claimsAt this point you should have a basic understanding of schmitt triggers can do, so the question remains, when to use them?Well, let's say you got a push-button, which you would love to use as an input for an awesome projectIf we use a 10K pull-up resistor to connect one side of it to 5 volts and the other side to groundThen we can utilize the oscilloscope to observe that the voltage gets pulled down to ground whenever we push the buttonBut wait a minute, let's zoom in on the transition from the low to high state, which reveals that there is no fluid transitionInstead we got a lot of bounces from the mechanical push-button, which could lead to problems for our projectThat is why we must bounce it by firstly adding an RC network to the output of the switch to decrease the rise/ full time of the bouncesSo that we can afterwards add a schmitt trigger in order to recreate the sharp edges, and thus create a fluid switch transitionperfect for our projectBut then again, if you would try to add the push button to an arduino circuitThen we would only need the RC network for the bouncing since the digital inputs of the microcontrollerAlready offers a high and low threshold voltage, which is just like a schmitt triggerNext we can add a capacitor and resistor to a schmitt trigger like it's shown here in order to create a simple relaxation oscillatorBecause of the hysteresis voltage, the capacitor gets charged/discharged continuously, which results in a square wave on the outputAnd by utilizing a potentiometer as a resistor we can easily reach frequencies in the kilo Hertz rangeLast but not least a schmitt trigger is very useful if you got a noisy or worn out data signalThat you want to freshen up a bit. And with that being said, you should now be familiar with the basics of schmitt triggersAnd understand why they are often very important componentsI hope you enjoyed watching this video if so, don't forget to Like, share, and subscribeStay creative, and I will see you next time!