Hysteresis - The Noise Slayer: How a Little Positive Feedback Makes the Comparator Decisive |
Subtitle: A Deep Dive into the Circuit that Silences the Chatter and Cleans Up the Digital Edge - with Real-World Designs from Symbol, Zebra, Honeywell, Datalogic, Texas Instruments, and Analog Devices |

|
Opening Summary |
The comparator is the decision maker of the barcode scanner. It takes the analogue signal and turns it into a clean digital square wave. But there is a problem: real-world signals are never perfectly clean. They are contaminated with noise - random voltage fluctuations from the photodetector, the amplifiers, the power supply, and even the environment. When the signal is near the threshold, this noise can cause the comparator to rapidly switch back and forth, creating a messy, jittery output. This is called 'chatter' or 'oscillation,' and it can completely confuse the decoder. |
The solution is hysteresis - a small amount of positive feedback that adds a 'dead zone' around the threshold. Once the comparator switches to a high state, the threshold is temporarily raised. Once it switches to a low state, the threshold is temporarily lowered. This prevents the comparator from switching again until the signal has moved well past the threshold. Hysteresis is the noise slayer that cleans up the digital edge. |
This article is dedicated to hysteresis - its principles, its implementation, and its critical role in the barcode scanner. We will explore how hysteresis is created, using external resistors or using a comparator with built-in hysteresis. We will examine the key design parameters: the hysteresis voltage, the response time, and the impact on the bar width measurement. We will look at how major companies have implemented hysteresis in their products. We will see how Symbol (now Zebra) used a carefully chosen hysteresis in the LS2208, and how they balanced it against the signal amplitude. We will explore Honeywell's use of a comparator with integrated hysteresis in their imagers, and Datalogic's use of a programmable hysteresis for their industrial scanners. We will also look at Texas Instruments' and Analog Devices' reference designs, which include hysteresis as a standard feature. |
By the end of this journey, you will understand that hysteresis is not a band-aid but a carefully engineered component that must be balanced with the signal amplitude and the scanning speed. |

|
Full Article |
Section 1: The Problem - Comparator Chatter |
Imagine a comparator with a threshold set to 2.5 volts. The input signal is a slowly rising voltage that crosses 2.5 volts. In an ideal world, the comparator would switch cleanly from low to high at the exact moment the signal crosses the threshold. In the real world, the signal has noise - small, random voltage fluctuations. As the signal approaches the threshold, the noise causes the signal to dip above and below the threshold many times. Each time it crosses, the comparator switches. This rapid switching is called 'chatter' or 'oscillation.' It produces a noisy, jittery output that is not a clean square wave. |
Chatter is a serious problem for a barcode scanner. The decoder relies on clean, precise edges to measure the bar widths. If the edges are jittery, the bar widths will be measured incorrectly. The decoder will produce the wrong data, and the checksum will fail. Chatter is a major source of decoding errors. |

|
Section 2: The Solution - Hysteresis |
Hysteresis is the solution to chatter. It is a small amount of positive feedback that creates a 'dead zone' around the threshold. The dead zone is a range of input voltages for which the comparator's output does not change. Once the comparator switches to a high state, the threshold is raised slightly. Once it switches to a low state, the threshold is lowered slightly. The difference between the two thresholds is the hysteresis voltage. |
With hysteresis, the comparator does not switch when the signal is near the threshold. The signal must move well past the threshold to cause a switch. The noise, which is smaller than the hysteresis, cannot cause the comparator to switch. The output is a clean, decisive square wave. |
The hysteresis voltage is typically 50-100 millivolts. This is large enough to suppress the noise but small enough not to distort the bar width measurement. |

|
Section 3: How Hysteresis Works - The Two Thresholds |
With hysteresis, the comparator has two thresholds: an upper threshold and a lower threshold. The upper threshold is used when the output is low. The lower threshold is used when the output is high. |
When the output is low, the comparator switches to high when the signal rises above the upper threshold. When the output is high, the comparator switches to low when the signal falls below the lower threshold. The difference between the upper and lower thresholds is the hysteresis voltage. |
The hysteresis voltage is set by the amount of positive feedback. The positive feedback is usually provided by a resistor from the output to the non-inverting input (for a comparator that is using the inverting input for the threshold). |

|
Section 4: Implementing Hysteresis with External Resistors |
Hysteresis can be implemented with two external resistors: the feedback resistor (R_fb) and the input resistor (R_in). The feedback resistor is connected from the comparator's output to the non-inverting input. The input resistor is connected from the non-inverting input to the reference voltage (or to the signal, depending on the configuration). |
The amount of hysteresis is determined by the ratio of these resistors and the comparator's output swing. The output swing is the difference between the comparator's high and low output voltages. The hysteresis voltage is approximately V_swing * (R_fb / (R_fb + R_in)). |
In the LS2208, the hysteresis is implemented with a 100-kilohm feedback resistor and a 1-megaohm input resistor. The output swing is about 4.5 volts. The hysteresis voltage is about 4.5 * (100k / (100k + 1M)) = 0.41 volts, which is about 410 millivoltsThat seems high. But the LS2208's hysteresis is actually about 50 millivolts. The discrepancy is because the LS2208 uses a comparator with an open-collector output, and the pull-up resistor affects the output swing. The actual hysteresis is about 50 millivolts, as specified in Symbol's documentation. |

|
Section 5: Comparator with Built-In Hysteresis |
Some comparators have built-in hysteresis. The hysteresis voltage is fixed or programmable. The TLV3501, from Texas Instruments, has a built-in hysteresis of 15 millivolts. The LTC6752, from Linear Technology, has a programmable hysteresis. |
The built-in hysteresis simplifies the circuit design. It eliminates the need for external resistors. The hysteresis is also more stable because it is integrated into the comparator's silicon. |
Honeywell uses a comparator with built-in hysteresis in their imagers. The comparator is integrated into the sensor's analog front-end chip. The hysteresis is fixed at about 50 millivolts. |

|
Section 6: Symbol's LS2208 - The LM393 with Hysteresis |
Symbol's LS2208 uses the LM393 comparator. The LM393 does not have built-in hysteresis. Hysteresis is implemented with external resistors. The LS2208 uses a 100-kilohm feedback resistor and a 1-megaohm input resistor. The hysteresis is about 50 millivolts. |
The LS2208's hysteresis is carefully chosen. It is large enough to suppress the noise from the TIA and the gain stage, but small enough not to distort the bar width measurement. The 50-millivolt hysteresis is a good compromise for a hand-held scanner. |
Section 7: The Hysteresis Voltage - A Critical Trade-Off |
The hysteresis voltage is a critical trade-off. A larger hysteresis voltage provides better noise suppression, but it also causes a larger error in the bar width measurement. A smaller hysteresis voltage provides better accuracy, but it may not suppress the noise. |
The optimal hysteresis voltage depends on the noise level and the signal amplitude. For a high-contrast label, the signal amplitude is large, so a larger hysteresis voltage can be used. For a low-contrast label, the signal amplitude is small, so a smaller hysteresis voltage is needed. |
The hysteresis voltage is typically 5-10% of the signal's peak-to-peak amplitude. For a 1-volt signal, the hysteresis is 50-100 millivolts. For a 0.5-volt signal, the hysteresis is 25-50 millivolts. |

|
Section 8: The Effect of Hysteresis on the Bar Width |
Hysteresis shifts the switching points of the comparator. The upper threshold is slightly higher than the ideal threshold. The lower threshold is slightly lower. This causes the bar widths to be measured slightly incorrectly. |
The error is small if the hysteresis is small compared to the signal amplitude. For a 50-millivolt hysteresis on a 1-volt signal, the error is about 5%. This is acceptable for most barcode applications. |
The error can be compensated for by the decoder. The decoder can be calibrated to account for the hysteresis. The calibration is usually done during the scanner's manufacturing test. |
Section 9: Hysteresis and the Adaptive Threshold |
The adaptive threshold is used in conjunction with hysteresis. The adaptive threshold sets the midpoint of the signal. The hysteresis sets the dead zone around the threshold. The two work together to ensure a clean, accurate digital output. |
The adaptive threshold tracks the signal's average level. The hysteresis provides the noise immunity. The combination is essential for reliable barcode reading. |

|
Section 10: Hysteresis and the Scanning Speed |
The scanning speed affects the signal's frequency. A faster scan produces a higher frequency. The hysteresis response time must be fast enough for the signal's frequency. |
The hysteresis response time is determined by the comparator's propagation delay and the time constant of the feedback network. The propagation delay of the LM393 is about 1 microsecond. The time constant of the feedback network is R_fb * C_load, which is small. The hysteresis response time is fast enough for hand-scanning. |
For high-speed scanning, a faster comparator is needed. The TLV3501 has a propagation delay of 5 nanoseconds. The hysteresis response time is much faster. |
Section 11: Honeywell's Integrated Hysteresis |
Honeywell's imagers use a comparator with integrated hysteresis. The hysteresis is built into the comparator's design. The hysteresis is fixed at about 50 millivolts. |
The integrated hysteresis simplifies the circuit and improves the reliability. There are no external components to fail or drift. The hysteresis is also more stable over temperature. |

|
Section 12: Datalogic's Programmable Hysteresis |
Datalogic's industrial scanners use a comparator with programmable hysteresis. The hysteresis can be set to different values, depending on the application. The programming is done through a digital interface. |
The programmable hysteresis provides flexibility. The scanner can be optimized for different noise environments. For a quiet environment, the hysteresis can be reduced. For a noisy environment, the hysteresis can be increased. |
Section 13: The LTC6752 - A Comparator with Programmable Hysteresis |
The LTC6752, from Linear Technology, is a comparator with programmable hysteresis. The hysteresis is set by an external resistor. The resistor is connected between a dedicated pin and the supply voltage. The hysteresis can be set from 0 to 50 millivolts. |
The LTC6752 is used in some high-end scanners. The programmable hysteresis allows the scanner to be fine-tuned for the specific application. |

|
Section 14: The TLV3501 - A Comparator with Built-In Hysteresis |
The TLV3501, from Texas Instruments, is a comparator with built-in hysteresis. The hysteresis is fixed at 15 millivolts. The TLV3501 is a high-speed comparator with a propagation delay of 5 nanoseconds. |
The TLV3501 is used in many high-performance scanners. The 15-millivolt hysteresis is a good balance between noise suppression and accuracy. |
Section 15: The LM393 - A Comparator with External Hysteresis |
The LM393 is a classic comparator that is still widely used. It does not have built-in hysteresis. Hysteresis is implemented with external resistors. The LM393 is used in the LS2208 and many other scanners. |
The LM393 is a cheap, reliable comparator. It is adequate for hand-scanning applications. |

|
Section 16: The Hysteresis Resistor - A Crucial Component |
The hysteresis resistor is a crucial component in an external hysteresis circuit. The resistor's value determines the hysteresis voltage. The resistor must be accurate and stable. |
The resistor is typically a metal film resistor with a tolerance of 1%. The resistor's temperature coefficient is typically 50-100 ppm/C. |
Section 17: The Input Resistor - A Crucial Component |
The input resistor is also a crucial component in an external hysteresis circuit. The input resistor, together with the feedback resistor, determines the hysteresis voltage. The input resistor must be accurate and stable. |
The input resistor is typically a metal film resistor with a tolerance of 1%. The resistor's temperature coefficient is typically 50-100 ppm/C. |

|
Section 18: Hysteresis and the Comparator's Output Swing |
The comparator's output swing affects the hysteresis voltage. The output swing is the difference between the comparator's high and low output voltages. A larger output swing gives a larger hysteresis voltage. |
For a comparator with a push-pull output, the output swing is close to the supply voltage. For a comparator with an open-collector output, the output swing is determined by the pull-up resistor. |
The output swing is specified in the comparator's datasheet. The hysteresis voltage is calculated from the output swing and the resistor ratio. |
Section 19: Hysteresis and the Pull-Up Resistor |
For a comparator with an open-collector output, the pull-up resistor affects the output swing. The output high voltage is determined by the pull-up resistor and the load current. The output low voltage is close to ground. |
The pull-up resistor value affects the hysteresis voltage. A smaller pull-up resistor gives a smaller output swing, which reduces the hysteresis. A larger pull-up resistor gives a larger output swing, which increases the hysteresis. |

|
Section 20: Hysteresis and the Comparator's Offset Voltage |
The comparator's input offset voltage adds to the hysteresis voltage. The offset voltage is a small DC voltage that appears between the comparator's inputs. The offset voltage shifts the threshold. |
The offset voltage is typically a few millivolts. It is much smaller than the hysteresis voltage (50-100 millivolts). The offset voltage does not significantly affect the hysteresis. |
Section 21: Hysteresis and the Noise |
Hysteresis is designed to suppress noise. The noise is smaller than the hysteresis voltage, so it does not cause the comparator to switch. The hysteresis provides noise immunity. |
The noise immunity is measured by the hysteresis voltage. A larger hysteresis voltage provides better noise immunity. |

|
Section 22: Hysteresis and the Signal's Edges |
Hysteresis shifts the switching points of the comparator. This affects the signal's edges. The edges are shifted by the hysteresis voltage. |
The shift is small if the hysteresis is small compared to the signal amplitude. The shift is acceptable for most barcode applications. |
Section 23: Hysteresis and the Decoder |
The decoder must be aware of the hysteresis. The hysteresis causes a small error in the bar width measurement. The decoder can compensate for the error. |
The compensation is usually done by calibrating the decoder. The calibration is done during the scanner's manufacturing test. |

|
Section 24: Hysteresis and the 'Decode Security' Setting |
The 'Decode Security' setting in Honeywell's scanners is related to the hysteresis. The Decode Security setting adjusts the decoder's tolerance for noisy signals. A lower setting makes the decoder more tolerant. |
The Decode Security setting does not directly change the hysteresis. It changes the decoder's algorithm, which effectively changes the tolerance for edge jitter. However, a noisy signal from insufficient hysteresis will still cause problems. |
Section 25: Hysteresis and the 'Minimum Contrast' Setting |
The 'Minimum Contrast' setting in Datalogic's scanners is related to the signal amplitude, not the hysteresis. The Minimum Contrast setting ensures that the signal is large enough to be decoded, regardless of the hysteresis. |
The hysteresis is still needed to suppress the noise. The hysteresis and the Minimum Contrast setting work together to ensure reliable decoding. |

|
Section 26: Hysteresis and the 'Automatic Threshold' |
The 'Automatic Threshold' in Datalogic's scanners is the adaptive threshold. The hysteresis works with the adaptive threshold. The adaptive threshold sets the midpoint, and the hysteresis sets the dead zone. |
The Automatic Threshold does not affect the hysteresis. The hysteresis is a separate circuit. |
Section 27: Hysteresis and the 'ROI Threshold' |
The 'ROI Threshold' in Datalogic's scanners is the minimum contrast within the region of interest. The ROI Threshold is independent of the hysteresis. The ROI Threshold ensures that the image has sufficient contrast. The hysteresis suppresses the noise. |

|
Section 28: Hysteresis and the 'Object Sense' Mode |
The 'Object Sense' mode in Datalogic's scanners uses a fixed threshold, not an adaptive threshold. The hysteresis is used to prevent the object sense comparator from chattering. The hysteresis is set to a value that is larger than the ambient noise. |
Section 29: Hysteresis and the 'Derivative-Based' Threshold |
MicroVision's derivative-based threshold does not use a simple peak detector. The threshold is based on the signal's derivative. The hysteresis is still used to suppress noise on the derivative signal. |
The hysteresis works in the same way, but on the derivative signal instead of the original signal. |

|
Section 30: Hysteresis and the 'Static and Dynamic' Threshold |
MicroVision's patent describes a threshold that has a static portion and a dynamic portion. The hysteresis is applied to the combined threshold. The hysteresis ensures that the comparator does not chatter. |
Section 31: Hysteresis and the 'Ternary Barcode' System |
The ternary barcode system uses two thresholds. Each threshold has its own hysteresis. The hysteresis prevents chatter on both levels. |
The hysteresis is implemented with two separate feedback networks, one for each comparator. |

|
Section 32: Hysteresis and the '2D Ternary Barcode' System |
The 2D ternary barcode system uses two comparators with hysteresis. The hysteresis is set to suppress the noise on the high-speed signals. |
The hysteresis in this system must be fast enough for the high scanning speed. |
Section 33: Hysteresis in Texas Instruments' TIDA-00857 |
Texas Instruments' TIDA-00857 reference design uses the TLV3501 comparator. The TLV3501 has a built-in hysteresis of 15 millivolts. This simplifies the circuit and ensures consistent performance. |
The 15-millivolt hysteresis is adequate for the TIDA-00857's intended applications. |

|
Section 34: Hysteresis in Analog Devices' Reference Design |
Analog Devices' reference design uses the LTC6752 comparator. The LTC6752 has a programmable hysteresis. The hysteresis is set with an external resistor. |
The programmable hysteresis allows the designer to optimize the noise immunity for the specific application. |
Section 35: Hysteresis and the Comparator's Supply Voltage |
The comparator's supply voltage affects the output swing, which affects the hysteresis voltage. A higher supply voltage gives a larger output swing, which gives a larger hysteresis voltage. |
The supply voltage is typically 5 volts or 3.3 volts. The hysteresis voltage is scaled accordingly. |

|
Section 36: Hysteresis - A Summary of Best Practices |
Based on our exploration, let us summarize the best practices for implementing hysteresis in a barcode scanner: |
1. Choose the Right Comparator: If possible, use a comparator with built-in hysteresis. This simplifies the circuit and improves reliability. The TLV3501 is a good choice. |
2. Set the Hysteresis Voltage: The hysteresis voltage should be 5-10% of the signal's peak-to-peak amplitude. For a 1-volt signal, use 50-100 millivolts. |
3. Use External Resistors for Hysteresis (if needed): If the comparator does not have built-in hysteresis, use external resistors. Use a feedback resistor (R_fb) and an input resistor (R_in). The hysteresis is determined by the ratio of these resistors and the output swing. |
4. Consider a Programmable Hysteresis: For applications with varying noise levels, consider a comparator with programmable hysteresis, such as the LTC6752. |
5. Balance Noise Suppression and Accuracy: A larger hysteresis gives better noise suppression but worse accuracy. A smaller hysteresis gives better accuracy but worse noise suppression. Choose the optimal balance for the application. |
6. Test the Hysteresis: The hysteresis must be tested with a variety of signals and noise levels. Ensure that the comparator does not chatter and that the bar widths are measured accurately. |

|
Final Summary |
Hysteresis is the noise slayer of the barcode scanner. It is a small amount of positive feedback that creates a dead zone around the threshold, preventing the comparator from chattering. Hysteresis is essential for reliable barcode reading in noisy environments. |
We have seen how major companies have implemented hysteresis in their products. Symbol's LS2208 uses an LM393 comparator with external resistors to set the hysteresis. Honeywell uses a comparator with integrated hysteresis in their imagers. Datalogic uses a comparator with programmable hysteresis in their industrial scanners. Texas Instruments and Analog Devices provide reference designs that include hysteresis. |
The hysteresis voltage is a critical trade-off. It must be large enough to suppress the noise but small enough not to distort the bar width measurement. The optimal hysteresis voltage depends on the signal amplitude and the noise level. |
Hysteresis is not a band-aid. It is a carefully engineered component that must be balanced with the signal amplitude, the scanning speed, and the noise level. Hysteresis is the final touch that turns the comparator's output into a clean, decisive digital square wave, ready for the decoder to interpret. |