The LM393 is a popular dual comparator IC that is commonly used in various electronics applications for comparing two voltages. The comparator’s output is typically a logic-level signal, and it can be used in various control, signal conditioning, and threshold detection applications. One of the key features that can improve the performance of a comparator circuit is hysteresis, which helps eliminate unwanted oscillations or noise at the threshold voltage.
Hysteresis refers to a phenomenon where the threshold for switching the output is different depending on whether the input voltage is increasing or decreasing. In simple terms, hysteresis introduces a deliberate delay in the transition of the output in response to small variations in the input signal, preventing the output from toggling too frequently.
In a comparator without hysteresis, the output can change states even when the input signal fluctuates around the threshold. This may result in an unstable or noisy output. By adding hysteresis, the comparator will only change states after the input signal crosses a certain threshold in one direction (e.g., rising or falling) and will not change back unless the input crosses a different, more significant threshold in the opposite direction. This ensures more stable behavior, especially in noisy environments.
The LM393 comparator, by default, does not have hysteresis built into its design. This can lead to unwanted oscillations if the input voltage is near the threshold. Adding hysteresis to the LM393 comparator circuit can offer several benefits:
Hysteresis can be added to the LM393 comparator by introducing positive feedback. This feedback essentially shifts the threshold voltage depending on the output state of the comparator.
Here is a basic schematic to add hysteresis to an LM393 comparator:
plaintext
+Vcc
|
[R1]
|
In+ ----|----.
| |
[R2] |
| |
In- ----|----|----> Vout
| |
[R3] |
| |
GND GND
When the output is high: The feedback resistor (R2) introduces a positive voltage to the non-inverting input. This shifts the threshold voltage, requiring the input to rise higher than the original threshold before the comparator output switches to low.
When the output is low: The feedback resistor reduces the voltage at the non-inverting input, effectively lowering the threshold voltage for the output to switch back to high.
This feedback loop creates two different threshold voltages for the rising and falling edges of the input signal, providing hysteresis.
The exact hysteresis values can be calculated by considering the voltage divider formed by resistors R1 and R2 and the feedback mechanism. The formulas for the upper and lower threshold voltages are as follows:
For the comparator with hysteresis, these thresholds depend on the resistors' values and the reference voltage applied to the inverting input.
Adding hysteresis to the LM393 comparator enhances the stability and noise immunity of the circuit, making it more suitable for practical applications. By introducing positive feedback, hysteresis ensures that small fluctuations in the input signal don’t cause unwanted changes in the output. This is particularly useful in threshold detection, zero-crossing detection, and other applications where reliable and stable switching behavior is required.