Comparator Hysteresis Calculator

This Online Hysteresis Comparator Calculator is able to compute the resistivity R2/R1 and calculate the reference voltage and resistivity, the reference hysteresis curve. You just need to enter the positive supply voltage and negative supply voltage of this comparator circuit and click the "Compute" button. And then you will get the values of High Threshold Voltage (VTH), Low Threshold Voltage (VTL), Ratio of R1/R2 Resistors and reference voltage(VR).

Input: (Note: Use minus sign "-" for negative voltages.)
Positive Supply Voltage: V
Negative Supply Voltage: V
Results:

Vth (High Threshold Voltage):

V

R2/R1 (Ratio of Resistors):

Vtl (Low Threshold Voltage):

V

Vr (Reference Voltage):

V
Comparator Circuit Schematic
Introduction

Comparators are a fundamental building block of electronics. Let’s discuss how to use a comparator, their ideal and nonideal characteristics, and walk through some calculations to set thresholds and hysteresis.  This circuit is how our Temperature Monitor, Seth, will accurately and quickly respond to overtemperature faults.

Comparator Calculations! (Setting Hysteresis)

Comparator Hysteresis Calculator Overview

The Comparator Hysteresis Calculator helps calculate the high threshold voltage, low threshold voltage, reference voltage, and resistor ratio for a comparator circuit with hysteresis. By entering the positive supply voltage, negative supply voltage, and the required threshold conditions, users can estimate the values needed to build a stable comparator threshold circuit.

This calculator is useful for circuits that must convert a noisy, slow-moving, or analog input signal into a clean digital output. Hysteresis adds two switching thresholds instead of one, which helps prevent output chatter when the input signal is close to the switching point.

Use this tool as a first-pass design aid. Final values should be checked against the comparator datasheet, output type, input common-mode range, pull-up voltage, resistor tolerance, input bias current, propagation delay, and real noise level in the circuit.

Comparator hysteresis circuit schematic

What Is Comparator Hysteresis?

Comparator hysteresis is a method of adding positive feedback so that a comparator changes state at two different input voltages. One threshold is used when the input is rising, and another threshold is used when the input is falling.

Without hysteresis, a comparator may switch repeatedly if the input signal has noise near the reference voltage. With hysteresis, the input must move past a second threshold before the output changes back. This creates a noise margin and makes the output transition cleaner.

The difference between the high threshold voltage and the low threshold voltage is the hysteresis voltage:

VHYST = VTH - VTL

What This Calculator Can Calculate

  • VTH, the high threshold voltage where the comparator changes state for one input direction.

  • VTL, the low threshold voltage where the comparator changes state in the opposite direction.

  • VREF, the reference voltage used by the comparator threshold network.

  • R, the resistor ratio used by the hysteresis feedback network.

  • R2/R1, the practical resistor ratio used to set the hysteresis window.

The calculator is most useful when you know the supply rails and target switching thresholds, or when you want to estimate the threshold voltages produced by a selected reference voltage and resistor ratio.

Input Parameters Explained

InputMeaning
VpPositive supply voltage or high output level used by the comparator circuit.
VnNegative supply voltage or low output level used by the comparator circuit.
VTHHigh threshold voltage. The input must cross this level in one direction to change the output state.
VTLLow threshold voltage. The input must cross this lower level in the opposite direction to change the output state.
VREFReference voltage used by the threshold network.
R or R2/R1Resistor ratio that sets the amount of positive feedback and the width of the hysteresis window.

Comparator Hysteresis Equations

For the calculator's comparator hysteresis model, the threshold equations can be written as:

VTH = VREF * (1 + R) / R - Vn / R

VTL = VREF * (1 + R) / R - Vp / R

The reference voltage can be calculated from a known high threshold:

VREF = Vn + (VTH - Vn) * R / (1 + R)

The resistor ratio can be calculated from the supply rails and hysteresis width:

R = (Vp - Vn) / (VTH - VTL)

Where:

  • VTH = high threshold voltage

  • VTL = low threshold voltage

  • VREF = reference voltage

  • Vp = positive supply or high output level

  • Vn = negative supply or low output level

  • R = resistor ratio, usually R2/R1 in the calculator model

Example Calculation

Suppose a comparator circuit uses:

  • Vp = 5 V

  • Vn = 0 V

  • Desired high threshold VTH = 3.0 V

  • Desired low threshold VTL = 2.0 V

The hysteresis width is:

VHYST = 3.0 V - 2.0 V = 1.0 V

The resistor ratio is:

R = (5 V - 0 V) / (3.0 V - 2.0 V) = 5

Using the reference voltage equation:

VREF = 0 V + (3.0 V - 0 V) * 5 / (1 + 5) = 2.5 V

This means a reference voltage of about 2.5 V and a resistor ratio of about 5 can create a 2.0 V to 3.0 V hysteresis window in this simplified model.

How to Use This Calculator

  1. Decide whether the comparator will use a single supply or dual supplies.

  2. Enter the high output level or positive supply voltage as Vp.

  3. Enter the low output level or negative supply voltage as Vn.

  4. Enter the desired high and low threshold voltages, or enter the reference voltage and resistor ratio if those are already known.

  5. Calculate VTH, VTL, VREF, and the resistor ratio.

  6. Select real resistor values that match the calculated ratio.

  7. Check the circuit with the selected comparator datasheet and expected input signal range.

How to Read the Results

ResultMeaningDesign Check
VTHThe upper trip point of the hysteresis window.Make sure it is above the expected noise band and inside the valid input range.
VTLThe lower trip point of the hysteresis window.Make sure it gives enough margin before the output switches back.
VHYSTThe difference between VTH and VTL.It should be larger than the expected input noise and ripple.
VREFThe reference level used by the threshold network.Use a stable reference if threshold accuracy matters.
R2/R1The resistor ratio that sets the feedback strength.Choose practical resistor values and check tolerance effects.

How a Comparator Works

A comparator compares two input voltages and drives its output high or low depending on which input is greater. In a simple comparator, the output changes state when the input crosses a reference voltage. This makes comparators useful for level detection, zero-crossing detection, window detection, overvoltage protection, undervoltage lockout, and analog-to-digital interface circuits.

Many comparator outputs are open-drain or open-collector. These outputs require a pull-up resistor to create a high output level. The pull-up voltage may be different from the comparator supply voltage, so the real high output level should be checked before using it in threshold equations.

Comparator threshold and hysteresis explanation

Why Hysteresis Is Important

If a slowly changing input signal contains noise, a comparator without hysteresis can switch rapidly when the signal is near the threshold. This unwanted switching is often called chatter. Hysteresis reduces chatter by creating a wider transition band.

For example, a temperature monitor, battery voltage detector, or sensor threshold circuit may have a noisy input. Instead of switching at exactly one voltage, a hysteresis comparator can switch on at one voltage and switch off at another. This makes the output more stable and easier for digital logic to read.

Comparator With Hysteresis vs. Comparator Without Hysteresis

FeatureWithout HysteresisWith Hysteresis
Switching thresholdOne threshold voltage.Two threshold voltages.
Noise immunityLower; output can chatter near the threshold.Higher; input must cross a second threshold to switch back.
Best forClean, fast-moving signals.Noisy, slow-moving, or ripple-heavy signals.
Circuit complexitySimpler.Requires positive feedback or a comparator with built-in hysteresis.

Choosing the Hysteresis Window

The hysteresis window should be wide enough to cover the expected input noise, ripple, and measurement uncertainty. If the hysteresis is too small, the output may still chatter. If the hysteresis is too large, the circuit may respond too late or require too much input change before switching back.

For precision designs, include resistor tolerance, reference tolerance, comparator input offset voltage, input bias current, output swing, and temperature drift in the threshold error budget.

Practical Design Notes

  • Use a dedicated comparator for fast or logic-level switching instead of a general-purpose op-amp when performance matters.

  • Check whether the comparator output is push-pull, open-drain, or open-collector.

  • Use a stable reference voltage if threshold accuracy is important.

  • Keep high-impedance threshold nodes away from noisy traces.

  • Add input filtering if the signal contains high-frequency noise that should not trigger the comparator.

  • Check propagation delay if the comparator is used in a time-critical circuit.

  • Verify the input common-mode range over all supply and signal conditions.

  • Use resistor values that are not so high that leakage and bias currents dominate the threshold accuracy.

Common Mistakes to Avoid

  • Assuming the comparator output reaches the exact supply rails.

  • Ignoring the pull-up resistor and pull-up voltage for open-drain outputs.

  • Using an op-amp as a comparator without checking recovery time and output behavior.

  • Choosing a hysteresis window smaller than the actual input noise.

  • Ignoring input offset voltage when threshold accuracy is important.

  • Using very large resistor values without checking input bias current and leakage effects.

  • Confusing high threshold and low threshold in an inverting comparator circuit.

When This Calculator Is Not Enough

This calculator is best for first-pass resistor-ratio and threshold estimates. More detailed analysis is needed for high-speed comparators, precision threshold detection, very low-power circuits, battery monitors, safety circuits, noisy industrial environments, and designs with open-drain outputs pulled to a different voltage rail.

For final designs, verify the thresholds with the comparator datasheet, tolerance analysis, simulation, and bench measurements across temperature, supply voltage, and input noise conditions.

Helpful Video Reference

Comparator Explained: Inverting Comparator, Non-Inverting Comparator and Window Comparator

Frequently Asked Questions

What is comparator hysteresis?

Comparator hysteresis is the use of two switching thresholds instead of one. It helps prevent unwanted output toggling when the input signal is noisy or slowly moving near the threshold.

What is the difference between VTH and VTL?

VTH is the high threshold voltage, and VTL is the low threshold voltage. Their difference is the hysteresis voltage.

Why does a comparator need positive feedback?

Positive feedback shifts the switching threshold depending on the current output state. This creates the two-threshold behavior needed for hysteresis.

Can an op-amp be used as a comparator?

Sometimes, but a dedicated comparator is usually better for switching applications. Op-amps can have slow recovery from saturation, limited output swing, and slower response when used as comparators.

How large should the hysteresis voltage be?

It should be larger than the expected input noise and ripple, while still allowing the circuit to switch at useful signal levels. Precision designs should include tolerance and temperature effects.

What if my comparator output is open-drain?

Use a pull-up resistor and include the pull-up voltage in the threshold analysis. The output high level is set by the pull-up rail, not necessarily by the comparator supply voltage.

Related Online Calculation Tools

Frequently Asked Questions

What does the Comparator Hysteresis Calculator do?

This tool calculates key parameters for designing a comparator circuit with hysteresis, including the high threshold voltage (VTH), low threshold voltage (VTL), resistor ratio (R2/R1), and reference voltage (VR). By inputting the positive and negative supply voltages, users can generate these values to ensure stable switching behavior in noisy environments.

How do I input negative supply voltages?

For negative supply voltages, use the minus sign ("-") before the numerical value (e.g., "-5V"). The calculator supports both positive and negative rails to accommodate various circuit configurations. Ensure the positive voltage is higher than the negative voltage for valid results.

Why is hysteresis important in comparator circuits?

Hysteresis prevents unwanted output oscillations ("chatter") caused by noise or slow input signal transitions. By creating two distinct thresholds (VTH and VTL), it ensures the output switches cleanly between states, avoiding erratic behavior in applications like temperature monitoring or mechanical switch debouncing.

What are common applications of comparators with hysteresis?

Noise filtering: Stabilizing signals in environments with electrical interference. Debouncing switches: Eliminating false triggers in mechanical systems. Relaxation oscillators: Generating stable square-wave outputs. Threshold detection: Monitoring critical levels in temperature or voltage sensors.
Hot products

ImagePart NumberManufacturerCategoryPackage/CaseDescriptionPriceQuantityBuy/Quote
BLM18PG121SN1DBLM18PG121SN1DMurata ElectronicsFerrite Beads and Chips0603 (1608 Metric)MURATA - BLM18PG121SN1D - Ferrite Bead, 0603 [1608 Metric], 120 ohm, 2 A, BLM18P Series, 0.05 ohm, ± 25%-

In stock : 355131

Minimum: 1

AD9364BBCZAD9364BBCZAnalog Devices Inc.RF Transceiver ICs144-LFBGA, CSPBGARF Transceiver 1.3V 144-Pin CSP-BGA Tray-

In stock

Minimum: 1

CY62256LL-70SNXCCY62256LL-70SNXCCypress Semiconductor CorpMemory28-SOIC (0.295, 7.50mm Width)IC SRAM 256K PARALLEL 28SOIC-

In stock : 305

Minimum: 1

M24C16-MN6M24C16-MN6STMicroelectronicsMemory8-SOIC (0.154, 3.90mm Width)IC EEPROM 16K I2C 400KHZ 8SO-

In stock : 98

Minimum: 1

MPZ2012S102AT000MPZ2012S102AT000TDK CorporationFerrite Beads and Chips0805 (2012 Metric)TDK - MPZ2012S102AT000 - FERRITE BEAD, 0.15OHM, 1.5A, 0805-

In stock : 51745

Minimum: 1

SE2537L-RSE2537L-RSkyworks Solutions Inc.RF Amplifiers16-VFQFN Exposed PadRF Amplifier 5GHz Gain 30 dB 3.3Volt -10C 85C-

In stock : 10000

Minimum: 1

CYBL10162-56LQXICYBL10162-56LQXICypress Semiconductor CorpRF Transceiver ICs56-UFQFN Exposed PadMCU 32-Bit CYBL10X6X ARM Cortex M0 RISC 128KB Flash 1.8V/2.5V/3.3V/5V 56-Pin QFN EP Tray-

In stock : 48

Minimum: 1

SKY81294-14-001SKY81294-14-001Skyworks Solutions Inc.PMIC - LED Drivers9-BGA, WLCSPIC LED FLASH DVR 1.2V 9CSP
  • 1:$0.524329
  • 10:$0.494650
  • 100:$0.466651
  • 500:$0.440237

In stock : 1000

Minimum: 1

HSMS-282P-TR1GHSMS-282P-TR1GBroadcom LimitedDiodes - RF6-TSSOP, SC-88, SOT-363Diode Schottky 15V 6-Pin SOT-363 T/R-

In stock

Minimum: 1

IS61LV12816L-8TLIS61LV12816L-8TLISSI, Integrated Silicon Solution IncMemory44-TSOP (0.400, 10.16mm Width)SRAM Chip Async Single 3.3V 2M-bit 128K x 16 8ns 44-Pin TSOP-II-

In stock : 5182

Minimum: 1

AT25DF161-SH-TAT25DF161-SH-TAdesto TechnologiesMemory8-SOIC (0.209, 5.30mm Width)Flash Memory 16M, 2.7V, 100Mhz Serial Flash-

In stock

Minimum: 1

80HCPS1432CRM80HCPS1432CRMRenesas Electronics America Inc.Specialized ICs576-BBGA, FCBGAIC SER RAPIDIO SWITCH 576FCBGA-

In stock

Minimum: 1

SZNUP3105LT1GSZNUP3105LT1GON SemiconductorTVS - DiodesTO-236-3, SC-59, SOT-23-3TVS DIODE 32V 66V SOT23-3-

In stock : 1000

Minimum: 1

DS1230AB-200INDDS1230AB-200INDMaxim IntegratedMemory28-DIP Module (0.600, 15.24mm)IC NVSRAM 256K PARALLEL 28EDIP-

In stock

Minimum: 1

STK17TA8-RF45ISTK17TA8-RF45ICypress Semiconductor CorpMemory48-BSSOP (0.295, 7.50mm Width)IC NVSRAM 1M PARALLEL 48SSOP-

In stock

Minimum: 1

ALT6702RM45Q7ALT6702RM45Q7Skyworks Solutions Inc.RF Amplifiers-IC RF AMP CELLULAR SMD-

In stock

Minimum: 1

SI8261BBD-C-ISSI8261BBD-C-ISSilicon LabsIsolators - Gate Drivers6-SOIC (0.295, 7.50mm Width)4A Gate Driver Capacitive Coupling 5000Vrms 1 Channel 6-SDIP
  • 1:$7.599505
  • 10:$7.169344
  • 100:$6.763532
  • 500:$6.380691

In stock : 2191

Minimum: 1

SI8261BAD-C-ISSI8261BAD-C-ISSilicon LabsIsolators - Gate Drivers6-SOIC (0.295, 7.50mm Width)Gate Drivers 5kV Opto input Sgl channel 4.0A driver
  • 1:$4.566234
  • 10:$4.307768
  • 100:$4.063932
  • 500:$3.833898

In stock : 100000

Minimum: 1

CSR8510A06-ICXR-RCSR8510A06-ICXR-RQualcommRF Transceiver ICs6-XFBGAIC RF TXRX BLUETOOTH 6XFBGA-

In stock

Minimum: 1

SZNUP4114UCLW1T2GSZNUP4114UCLW1T2GON SemiconductorTVS - Diodes6-TSSOP, SC-88, SOT-363TVS DIODE 5.5V 10V SC88
  • 1:$0.627281
  • 10:$0.591775
  • 100:$0.558278
  • 500:$0.526677

In stock : 84200

Minimum: 1