# Comparator Hysteresis

Status
Not open for further replies.

#### hithesh123

##### Full Member level 6 I can't find the right formula for calculating hysteresis.
For example, my Vref is 0.5V. I want the output to go high when Vin is 0.55V and low when Vin is 0.45V. Hysteresis band of 100mv.

Supply rails are +5V and -5V. Output is 0V to 5V.

I tried using the formula :

Vth+ = Vcc(R1/R1+R2) + Vref(R2/R1+R2)

Vth- = Vss(R1/R1+R2) + Vref(R2/R1+R2)

Can't get R1 and R2 to get the required hysteresis voltage.

#### JoannesPaulus Do you want to have two threshold voltages? Usually hysteresis is done dynamically, using the output of the comparator as the threshold control.

At any rate, it seems that you are using a voltage divider to create Vth+ and Vth-. Attached is the correct one, with formulas:
Vth+=(Vcc-Vss)*(R2+R3)/(R1+R2+R3)
Vth-=(Vcc-Vss)*R3/(R1+R2+R3)

V
points: 2

#### hithesh123

##### Full Member level 6 Where do i feed my Vref?
Also, when the output hits -ve rail, wouldn't R1 see Vss at its terminal.

#### JoannesPaulus I am afraid you need to make a sketch of your idea.

#### hithesh123

##### Full Member level 6 Here's the ckt, but please ignore the inverter in the feedback loop.
It has Vref and positive feedback from the output.

Your resistors were connected to Vcc and Vss. Was that from the output or from rails?

#### JoannesPaulus ### hithesh123

points: 2

#### hithesh123

##### Full Member level 6 Sorry, I meant to post the first circuit in the link you posted.
Will the hysteresis formula be same for that circuit too?

#### hithesh123

##### Full Member level 6 Joannes,

I tried to solve for hysteresis of inverting comparator.
Vin is connected to V- terminal

Vref is connected to V+ terminal along with positive feedback.

Now, V- = Vin

V+ = Vref(R2/R)+Vout(R1/R) , where R=R1+R2

The comparator changes state when V+ = V-

Vin = Vref(R2/R)+Vout(R1/R)

This will be Vth+

and

Vth- = Vref(R2/R)-Vout(R1/R)

Are these correct?

#### JoannesPaulus I believe this is correct.

#### hithesh123

##### Full Member level 6 Thanks. That link helped a lot. I googled, but found a lot of other, not so complete articles.

Status
Not open for further replies.