I think your calculations assume the LM339 output goes all the way up to +5V and all the way down to 0V. You need to measure the actual V0(max) and V0(min) and base your calculations on that.
The error is due to the tolerance in the resistors you are using. If you use high precision resistors you will get more accorate results but with added cost.
I think your calculations assume the LM339 output goes all the way up to +5V and all the way down to 0V. You need to measure the actual V0(max) and V0(min) and base your calculations on that.
The error is due to the tolerance in the resistors you are using. If you use high precision resistors you will get more accorate results but with added cost.
Thanks for your response. I had considered that. However, if I allow for a 5% error in all the resistors my calculated Vlow is still 1.34v. That's way off the 1.07v that I'm actually getting. Hence there appears to be something more fundamental wrong.
Your measured results seem about right. I am not sure how you arrive at your calculated values but the hysteresis will be non-symetrical about the 2V reference. This is because your output voltage is not symetrical about the 2V reference.
When the output is at 5V, the input will trigger when (2V-Vin)/330k = (5V-2V)/1M or around 1.01V. This ignores the input bias current (and approximates Vref to 2V). How did you get 1.4v?
Your measured results seem about right. I am not sure how you arrive at your calculated values but the hysteresis will be non-symetrical about the 2V reference. This is because your output voltage is not symetrical about the 2V reference.
When the output is at 5V, the input will trigger when (2V-Vin)/330k = (5V-2V)/1M or around 1.01V. This ignores the input bias current (and approximates Vref to 2V). How did you get 1.4v?
Hi Keith. I didn't realise that the hysteresis would be non-symetrical. The way I calculated it was to use the formula from the datasheet (attached above) and then split VH equally about the reference point. So:
Vref =
VCC*R1
5 * 10k
-----------
-------------
Rref + R1
14.7k + 10k
Giving a Vref of 2.024V
VH =
R2
330k
---------
* VO(max)-VO(Min)
------------ *5
R2 + R3
330k + 1M
Giving a VH of 1.24V (Hysteresis)
I then assumed that 1.24V would be symetrical around the Vref point:
1.24v
-----
2 =0.62V Therefore VHigh = 2.64V (Vref of 2.02V + 0.62V) and VLow = 1.40V (Vref of 2.02V - 0.62V)
I accept I've probably done this completely wrong, hence I'm requesting help. Thanks for your time it's appreciated.
Thanks. The ON Semiconductor equation is wrong. It will give the correct answer for small values of hysteresis, but not large values. However, as the correct equation, show on page 17 of the ST document is even simpler, I don't know why they don't use that!
Hopefully now you have the correct equations you will have no problem getting the right answers.
Thanks. The ON Semiconductor equation is wrong. It will give the correct answer for small values of hysteresis, but not large values. However, as the correct equation, show on page 17 of the ST document is even simpler, I don't know why they don't use that!
Hopefully now you have the correct equations you will have no problem getting the right answers.
Keith, thank you very much. I would never have worked out that the equation was wrong. I thought it was my maths.
You've been extremely helpful, I spent a lot of time trying to solve it. Thanks once again.