Introduction
Comparators are electronic devices that are commonly used in circuits to compare two voltage levels. When the voltage level at the noninverting input is greater than that at the inverting input, the output of the comparator is driven to positive saturation. Conversely, when the voltage level at the inverting input is greater than that at the noninverting input, the output is driven to negative saturation. However, if the voltage levels at the inputs are very close, the output can become unstable and oscillate between the two saturation voltages, especially if the noninverting input is subject to noise. To overcome this issue, a dead zone can be introduced, which prevents the comparator from toggling its output when the input voltage changes within a certain range. This helps to improve the stability and accuracy of the circuit.
Comparators
Comparators are specialized amplifiers designed to compare two voltages and output a digital signal indicating which input is higher. They are commonly used in applications such as analog-to-digital converters, level detectors, and pulse generators. Unlike op-amps, comparators have a very fast response time and are optimized for speed rather than accuracy.
While comparators can be bought as a separate component, op-amps can also be used as comparators by connecting the output to a voltage rail instead of a feedback resistor. Whenever the voltage at the non-inverting input exceeds the voltage at the inverting input, the output will saturate to the positive rail. Conversely, when the voltage at the inverting input exceeds the voltage at the non-inverting input, the output will saturate to the negative rail. However, it is important to note that comparators have a larger output swing than op-amps and are better suited for high-speed applications.
They are essentially OpAmps that sacrifice their stability for faster switching speed. Much in the same way as OpAmps, their output is the voltage difference between noninverting and inverting inputs, multiplied by a huge factor.
For almost any real application, their characteristic can be described as such:
Depending on which input (inverting or noninverting) we select to be reference input, we can obtain an inverting or a noninverting comparator as shown on the image below.
Schmitt trigger
In case you found it hard to follow my circuit description of an inverting Schmitt trigger from before, here is a pair of schematics, one for an inverting and one for a noninverting Schmitt trigger. Note that we connected reference voltage to the ground potential.
So we’ve made an experiment, we’ve seen how a Schmitt trigger behaves and we’ve seen the schematics, but we still have to explain how a Schmitt trigger works. Quite the opposite to what we usually do. Coming up: explanation and the equations.
How it works: inverting Schmitt trigger
Let’s start off by looking at the inverting Schmitt trigger. Uout jumps between positive and negative saturation voltage. The resulting voltages on resistor divider are called high and low threshold voltages.
Now let’s think about what happens during operation. Let’s assume that input is very low, far below comparator’s saturation voltage. This means that the comparator’s noninverting input is below 0 V and output will be positive. In order for output to toggle to negative saturation, input signal has to exceed /. Now that the output is at negative saturation, input has to fall below Usat for the output to toggle again. Hard to follow? Take a glance at the diagram and corresponding oscillogram. Let’s consider the operation of the circuit. Suppose that the input voltage is very low, significantly below the comparator’s saturation voltage. This implies that the voltage at the noninverting input of the comparator is below 0 V, and the output of the comparator will be positive. To make the output switch to negative saturation, the input signal must exceed the value of the upper threshold voltage Usat. Once the output is at negative saturation, the input voltage must drop below the lower threshold voltage Usat for the output to switch back to positive saturation. If you find this explanation difficult to follow, please refer to the diagram and oscillogram for a better understanding.
How it works: noninverting Schmitt trigger
Let’s now take a look at the noninverting Schmitt trigger, starting with toggle point voltages. Unlike before, where noninverting input was just saturation voltage, divided by a resistor divider, here the voltage at the noninverting input is a function of input voltage. Switch happens, when this voltage crosses 0 V. Threshold voltages in this case are such:
Instead of walking you through the thought experiment of how and why a noninverting Schmitt trigger works, let me just show you the diagram and the oscillogram.
Schmitt trigger instead of a comparator. Why?
Let me answer with a graph:
A signal with noise can cause multiple output transitions in a regular comparator, while a Schmitt trigger with properly adjusted hysteresis can avoid this issue. It’s important to note that a Schmitt trigger is designed to have a delayed transition due to the offset of threshold voltages from the reference voltage. Therefore, comparators are still frequently used. Additionally, if the noisy component is at a high frequency, it may not cause false transitions since the comparator requires some time to switch the output.
Extra credits
Remember how I told you that I connected OpAmp to +- 3.3 V? That was done so that saturation voltages were +- 2.6 V. What would happen if saturation voltages weren’t the same?
Conclusion
Schmitt triggers are an essential building block for signal conditioning in analog-to-digital interfaces, and their simplicity makes them an attractive choice for many applications. By using just a comparator and two resistors, a Schmitt trigger can provide hysteresis to ensure reliable switching of signals in the presence of noise or other disturbances. So, if you want to deepen your understanding of analog circuits and their practical applications, replicating the experiments from this course is a great place to start. And here’s a little teaser for you: the next course will continue where we left off today, delving deeper into the world of analog circuits and exploring some more advanced topics. So, if you’re curious about what’s coming next, be sure to stay tuned!
Written by Luka Pogačnik Edited by Andraž Pirc
This teaching material was created by Red Pitaya & Zavod 404 in the scope of the Smart4All innovation project.