# [SOLVED]comparator hysterisis

Status
Not open for further replies.

#### poster_girl

##### Newbie level 3
I have designed this comparator for 0.2V and 1V hysteresis and it works fine for 0.2V but for 1V it output is not correct. The supply voltage for opamp is (12,0). The ref voltage is 5.1V in both cases. Value of R1 is 1K and Rf is 56.4k for 0.2V hysteresis and 10.5k for 1V hysteresis. The thresholds are 5.2-5.0 V and 5.2-4.2V. but in case of 1V hysteresis the output switches b/w 5.64-4.64. Is smthng wrong with my calculations and do I have to change ref voltage as I change hysteresis?

#### Attachments

• 19.7 KB Views: 23

#### keith1200rs

##### Super Moderator
Staff member
What comparator are you using? What is its output voltage range? You calculations are not correct, I think. If the comparator output can reach 12V then you need to use that to calculate one threshold and 0V for the other (assuming the comparator output can reach 0V).

Keith

#### albbg

I don't see anything wrong:

R1 = 1k, Rf = 56.4k --> Vup = 5.1+(12-5.1)*0.017=5.2V, Vlow = 5.1+(0-5.1)*0.017=5V
R1 = 1k, Rf = 10.5K --> Vup = 5.1+(12-5.1)*0.087=5.7V, Vlow = 5.1+(0-5.1)*0.087=4.7V

#### keith1200rs

##### Super Moderator
Staff member
With a 12V supply and 5.1V reference your upper and lower trigger points will not be symmetrical about the reference. So, 5.0V and 5.2V are incorrect.

Keith

sudeepr

### sudeepr

points: 2

#### poster_girl

##### Newbie level 3
I am using Lm139 and its output range is 11.316-(-0.161).

@albbg
In second I want the thresholds to vary from 5.2-4.2 not from 5.7-4.7.

#### keith1200rs

##### Super Moderator
Staff member
LM139 is open collector so you need a load resistor pullup. It should reach 12V with a pullup resistor but the saturation voltage is around 250mV. The feedback resistors will limit the positive output voltage as the only thing you have to pull up is the load resistor.

If you want your thresholds to be 4.2V to 5.2V then you won't do that with a 5.1V reference. If the circuit was symmetrical (e.g. 5V threshold and 10V supply) then the reference voltage would be in the centre of the trigger range. With an asymmetric circuit like you have you will need to re-calculate using the formulae you already have.

Keith.

---------- Post added at 08:50 ---------- Previous post was at 08:45 ----------

I don't see anything wrong:

R1 = 1k, Rf = 56.4k --> Vup = 5.1+(12-5.1)*0.017=5.2V, Vlow = 5.1+(0-5.1)*0.017=5V
R1 = 1k, Rf = 10.5K --> Vup = 5.1+(12-5.1)*0.087=5.7V, Vlow = 5.1+(0-5.1)*0.087=4.7V
The results for your first line should be 5.217V & 5.013V. the variation from 5.1V +/-0.1V is significant because it is caused by the reference not being in the centre of the supply voltage range which causes the skew.

Your second line should show the Vlow result as 4.656V. That is to be expected because the hysteresis based on the resistor values is 1.044V not 1V.

Keith.

points: 2