Adding hysteresis to a comparator prevents unwanted oscillations or erratic switching caused by noise or slow input signal changes. It creates a “dead zone” where the comparator output remains unchanged until the input signal crosses a specific threshold. This article explains how to add hysteresis to a comparator using positive feedback.
Understanding Hysteresis and Positive Feedback
Hysteresis introduces two different switching thresholds: one for rising input signals and another for falling signals. This difference between the thresholds is the hysteresis window. Positive feedback is the key to implementing hysteresis in a comparator. By feeding a portion of the output signal back to the non-inverting input, the reference voltage is effectively shifted, creating the desired hysteresis effect.
Implementing Hysteresis with a Comparator
The fundamental principle involves adding a feedback resistor (R2) between the comparator’s output and its non-inverting input, along with an input resistor (R1) connected to the reference voltage source. When the output is high (+Vcc), the feedback resistor pulls the reference voltage slightly higher. Conversely, when the output is low (-Vcc), the feedback pulls the reference voltage lower.
The following diagram illustrates a typical hysteresis implementation:
Hysteresis Circuit Diagram
Calculating the hysteresis window involves determining the voltage at the non-inverting input for both high and low output states. This difference constitutes the total hysteresis. Consider the following:
- Output High (+Vcc): The voltage at the non-inverting input will be slightly above the original reference voltage due to the voltage divider formed by R1 and R2.
- Output Low (-Vcc): The voltage at the non-inverting input will be slightly below the original reference voltage.
Considerations for Real-World Applications
Directly connecting a comparator’s input to its supply rail can hinder hysteresis implementation. The feedback network cannot pull the reference voltage above Vcc or below ground. One solution is to introduce a voltage drop between the supply rail and the comparator’s input using diodes. This allows the feedback network to effectively shift the reference voltage within the necessary range.
For instance, adding two or three diodes in series with the Vcc line (excluding the comparator’s power supply) creates a voltage drop. This allows the feedback resistor to pull the reference voltage higher and lower than the original reference point, enabling hysteresis.
Fine-tuning and Stability
A potentiometer can be used for the feedback resistor (R2) to fine-tune the hysteresis window. This allows precise adjustment of the switching thresholds. Additionally, a capacitor across the comparator’s power supply pins is recommended to mitigate instability caused by sudden transitions.
Conclusion
Adding hysteresis to a comparator is crucial for robust operation in noisy environments or with slowly changing input signals. By utilizing positive feedback and carefully considering practical implementation details, designers can ensure reliable and predictable comparator behavior. Using a potentiometer for the feedback resistor allows for precise control over the hysteresis window, and adding a bypass capacitor enhances circuit stability.