# Comparator with Hysteresis (Schmitt Trigger) Calculator

## This calculator will compute the required resistor ratio (R2/R1) and reference voltage (VREF) to create the desired high (VTH) and low (VTL) threshold voltages in a non-inverting comparator circuit with hysteresis (commonly called a Schmitt trigger).

### Input

###
Calculate V_{th} and V_{tl} given R
(=R_{2}/R_{1}) and V_{ref}

_{1}/ R

_{2}) should be greater than or equal to 1.

###
Calculate R and V_{ref} given V_{th} and V_{tl}

_{1}/ R

_{2}) should be greater than or equal to 1.

### Overview

A comparator with hysteresis has a nonlinear response with different switching threshold voltages depending upon whether the input is transitioning from low to high, or high to low. The circuit employs positive feedback to generate the nonlinear response. The low-to-high transition input voltage is called the high threshold voltage (V_{TH}). Similarly, the high-to-low transition input voltage is called the low threshold voltage (V_{TL}). This calculator assumes that the output can swing from the positive supply rail (V_{P}) to the negative supply rail (V_{N}).

### Circuit Design

One common method for designing a comparator with hysteresis uses an operational amplifier and positive feedback from the output to the input as shown in the following figure. The hysteresis of this circuit is a function of the resistor ration (R_{2} / R_{1}), the reference voltage (V_{ref}), and the positive (V_{p}) and negative (V_{n}) supply voltages.

### Equations

$$V_{TH} = (\frac{1 + R}{R})V_{REF} - (\frac{1}{R})V_{N}$$

$$V_{TL} = (\frac{1 + R}{R})V_{REF} - (\frac{1}{R})V_{P}$$

$$V_{REF} = V_N + (\frac{R}{1 + R})(V_{TH} - V_{N})$$

$$R = (\frac{(V_P - V_N)}{V_{TH} - V_{TL})}$$,

where:

*V _{P}* = positive supply voltage

*V _{N}* = negative supply voltage

*V _{TH}* = high threshold voltage

*V _{TL}* = low threshold voltage

*V _{REF}* = reference voltage

*R *= resistance ratio (R_{2} / R_{1})

### Applications

Hysteresis is often added to comparator circuits to minimize output noise or undersireable output transitions that occur with slowly varying or noisy input signals. For example, a traditional comparator circuit with a single switching point (i.e. no hysteresis) will "chatter" with extraneous output transitions when the input is near the switching point. A Schmitt triggers can eliminate this chatter. Schmitt triggers are also used in debouncing the outputs from mechanical switches and creating relaxation oscillators.

2 CommentsSome really nice and useful info on this website, also I conceive the design and style holds good features.

https://www.elpasotxautoglass.com/mobile-auto-glass-service-el-paso-texas-usa

In the calculator, the resistance ratios are stated incorrectly, it should read R2/R1. And not R1/R2.