• open navigation menu
  • Logo
    • Input keywords/ Part number
    • Manufacturers
    • Hot Products
    • RFQ
    • Blog
    • Tools
    • About Us
    • Quality Control
    Logo

    Sale support

    • info@glofell.com

    Company

    • Blog
    • About Us
    • Quality Control
    • Contact Us

    Resource

    • Categories
    • Manufacturers
    • Tools

    Quick link

    • Privacy Policy
    • Terms & Conditions
    • Cookies Policy
    • Refund & Return Policy
    • Shipping & Delivery Policy

    © 2026 Copyright. All Rights Reserved. Made by Glofell

    Payment
    Payment
    Payment
    Payment
    1. Home/
    2. Tools/
    3. Comparator Hysteresis Calculator

    Comparator Hysteresis Calculator

    Calculate the R1/R2 resistor ratio and key hysteresis-comparator parameters, including the reference voltage (VR), high threshold (VTH), and low threshold (VTL). Enter the positive and negative supply voltages with the threshold inputs to design and analyze a stable, noise-immune comparator circuit.

    Input:(Note: Use minus sign "-" for negative voltages.)

    V
    V
    Results
    V
    V
    V
    Comparator Circuit Schematic

    Introduction

    Comparator Hysteresis Calculator: Theory & Equations

    Introduction to the Comparator Hysteresis Calculator

    The Comparator with Hysteresis Calculator is an essential electronic design tool for electrical engineers. It allows you to calculate the precise resistor values required to set the High Threshold Voltage (VthV_{th}Vth​) and Low Threshold Voltage (VtlV_{tl}Vtl​) for a comparator circuit.

    By determining the correct Reference Voltage (VrefV_{ref}Vref​) and the resistor ratio (R2/R1R_2/R_1R2​/R1), you can design stable, noise-immune circuits. Below, we explore the fundamental theory behind comparators, the importance of hysteresis, and the mathematical formulas used in this calculator.

    What is a Comparator?

    A Comparator is an integrated circuit (IC) that compares two input voltages and outputs a digital signal indicating which is larger.

    • Function: It acts as a one-bit Analog-to-Digital Converter (ADC).
    • Operation:
      • If VIN>VREFV_{IN} > V_{REF}VIN​>VREF​, the output swings to the positive supply rail (Logic 1).
      • If VIN<, the output swings to the negative supply rail (Logic 0).

    Comparators are widely used in level detection, window detectors, and Analog-to-Digital converters. Common comparator ICs include the LM339, LM393, and TL331.


    What is Hysteresis? (The Schmitt Trigger)

    The Problem: Noise and "Chatter"

    In a standard comparator, if the input signal moves slowly or contains noise, the output may flicker rapidly (bounce) between high and low states when the input voltage is near the reference threshold. This oscillation is often called "chatter."

    The Solution: Hysteresis

    Hysteresis eliminates this noise by introducing two distinct threshold voltages instead of one:

    1. High Threshold (VthV_{th}Vth​): The voltage the input must rise above to switch the output Low.
    2. Low Threshold (VtlV_{tl}Vtl​): The voltage the input must fall below to switch the output High.

    By adding a feedback resistor to the circuit (Positive Feedback), the comparator "remembers" its current state and resists changing until the input significantly crosses the new threshold. This configuration is often called a Schmitt Trigger.

    How the Circuit Works

    An inverting comparator with hysteresis uses a positive feedback network.

    • Resistors R1R_1R1​ and R2R_2R2​ establish a reference voltage at the non-inverting input (+).
    • Resistor RhR_hR (Feedback) connects the output to the non-inverting input.

    When the output is High, the feedback resistor pulls the voltage at the non-inverting input slightly higher (creating VthV_{th}Vth​). When the output is Low, the feedback resistor pulls the non-inverting input slightly lower (creating VtlV_{tl}Vtl​). This separation creates the "Hysteresis Window."


    Comparator Hysteresis Formulas

    The calculator uses the following equations to determine the relationship between the threshold voltages and the resistor network for an Inverting Comparator with Hysteresis.

    1. Calculate Resistor Ratio (RRR)

    First, we define the ratio of the feedback resistors:

    R=R2R1R = \frac{R_2}{R_1}R=R1​R2​​

    The ratio is determined by the difference between the supply voltages and the desired hysteresis window width:

    R=VP−VNVth−VtlR = \frac{V_P - V_N}{V_{th} - V_{tl}}R=Vth​−Vtl​

    2. Calculate Threshold Voltages

    Once the ratio and reference voltage are known, the thresholds are defined as:

    High Threshold Voltage (VthV_{th}Vth​):

    Vth=Vref⋅(1+RR)−Vn⋅(1R)V_{th} = V_{ref} \cdot \left(\frac{1+R}{R}\right) - V_n \cdot \left(\frac{1}{R}\right)Vth​=Vref​⋅

    Low Threshold Voltage (VtlV_{tl}Vtl​):

    Vtl=Vref⋅(1+RR)−Vp⋅(1R)V_{tl} = V_{ref} \cdot \left(\frac{1+R}{R}\right) - V_p \cdot \left(\frac{1}{R}\right)Vtl​=Vref​⋅

    3. Calculate Reference Voltage (VrefV_{ref}Vref​)

    Vref=Vn+(Vth−Vn)⋅R1+RV_{ref} = V_n + (V_{th} - V_n) \cdot \frac{R}{1+R}Vref​=Vn​+(V

    Where:

    • VthV_{th}Vth​: High Threshold Voltage
    • VtlV_{tl}Vtl​: Low Threshold Voltage
    • VrefV_{ref}: Internal Reference Voltage applied to the resistor divider

    Op-Amp vs. Dedicated Comparator

    Can you use a standard Operational Amplifier (Op-Amp) like an LM741 or LM358 as a comparator?

    • Yes, but with limitations. Op-amps are designed for linear operation and negative feedback. When used as a comparator (open-loop), they are slow to recover from saturation and have slow slew rates.
    • Dedicated Comparators (like the LM393) are designed for open-loop operation. They have very fast switching times and open-collector outputs, making them ideal for driving digital logic circuits.

    Applications

    • Noise Suppression: Cleaning up noisy sensor signals.
    • Debouncing: Smoothing out mechanical switch signals.
    • Relaxation Oscillators: Creating square waves.
    • Zero-Crossing Detectors: Detecting when an AC signal crosses zero volts.
    ​
    VREFV_{IN} < V_{REF}
    VIN​<VREF​
    h
    ​
    VP​−VN​
    ​
    (R1+R​)−
    Vn​⋅
    (R1​)
    (R1+R​)
    −
    Vp​⋅
    (R1​)
    th​
    −
    Vn​)⋅
    1+RR​
    Vref​
  • VpV_pVp​: Positive Supply Voltage (VCCV_{CC}VCC​)
  • VnV_nVn​: Negative Supply Voltage (VEEV_{EE}VEE​ or Ground)
  • FAQ

    What does the Comparator Hysteresis Calculator do?

    This calculator determines the essential parameters for a hysteresis comparator circuit, including the high threshold voltage (VTH), low threshold voltage (VTL), resistor ratio (R2/R1), and reference voltage (VR). Enter your positive and negative supply voltages, and the tool outputs these values to help you design stable switching behavior in applications where noise is a concern.

    How do I input negative supply voltages?

    Type a minus sign ("-") before the numeric value for any negative rail, such as "-5V". The calculator accepts both positive and negative supply voltages to match common split-supply configurations. For valid results, the positive voltage must be greater than the negative voltage.

    Why is hysteresis important in comparator circuits?

    Hysteresis introduces two distinct threshold voltages, VTH and VTL, which prevents the output from oscillating when the input signal is noisy or changes slowly. This ensures a clean, single transition between states, which is especially useful in applications like temperature monitoring, level detection, and switch debouncing.

    What are common applications of comparators with hysteresis?

    Typical applications include filtering electrical noise from sensor signals, debouncing mechanical switches, generating square waves in relaxation oscillators, and performing threshold detection in temperature or voltage monitoring systems.

    Related Tools
    Resistor Color Code Calculator

    Resistor Color Code Calculator

    106

    Glofell’s Resistor Color Code Calculator decodes 4-band, 5-band, and 6-band resistors. Select each band to identify resistance, tolerance, and power rating for circuit work, repairs, or lab sorting.

    Ohms Law Calculator

    Ohms Law Calculator

    94

    Glofell’s Ohm’s Law Calculator helps engineers and students quickly solve for voltage, current, resistance, and power. Provide any two known values to calculate the remaining parameters, making it a practical reference for circuit design, troubleshooting, and electronics learning.

    Op-Amp Voltage and Gain Calculator

    Op-Amp Voltage and Gain Calculator

    86

    Calculate output voltage together with inverting and non-inverting gain for operational-amplifier circuits. Enter V1, V2, Vp, Vn, and resistor values R1 through R4 to obtain accurate results for circuit design, troubleshooting, and op-amp learning.

    Inverting Op-Amp Resistor Calculator

    Inverting Op-Amp Resistor Calculator

    87

    Analyze an inverting operational-amplifier circuit by entering the desired gain, output voltage (Vout), R1 resistance, and input voltages V1, V2, Vp, and Vn. The calculator automatically determines the required R2, R3, and R4 resistor values, helping you design and verify inverting op-amp configurations.

    Hot Products
    02-N101-1
    02-N101-1
    Unknown
    HOT
    A03402
    A03402
    AOS
    HOT
    A4911KJPTR-T-1
    A4911KJPTR-T-1
    Allegro
    HOT
    ACS711ELCTR-12AB-T
    ACS711ELCTR-12AB-T
    Allegro
    HOT
    A333
    A333
    Allwinner
    HOT
    T113-S3
    T113-S3
    Allwinner
    NEW
    10M04SCU324C8G
    10M04SCU324C8G
    Altera
    NEW
    AD8656ARZ-REEL7
    AD8656ARZ-REEL7
    Analog Devices
    HOT
    ADA4932-1YCPZ-R7
    ADA4932-1YCPZ-R7
    Analog Devices
    HOT
    ADG453BRZ-REEL7
    ADG453BRZ-REEL7
    Analog Devices
    BEST SELL
    ACPL-P343-500E
    ACPL-P343-500E
    Broadcom
    HOT
    AEDR-8710-100
    AEDR-8710-100
    Broadcom