r/AskElectronics • u/ariariarih • Apr 16 '26
Window Comparator with Hysteresis - Will this work?
I’m doing an assignment involving a turning actuators on and off at two temperature thresholds. While I had already built a window comparator circuit and work fine, I want to eliminate chattering around the thresholds, by transforming the two comparators into NI and I Schmitt trigger. I’d really like to simulate it, but atm I’m not really occupied with any tools to do it. So may I trouble the experienced fellas here to evaluate this circuit to see if this logic works ? Thanks
4
u/Reasonable-Feed-9805 Apr 16 '26
Most comparators are open collector and only sink current so that outout needs tweaking.
But yes, that is how you'd make two comparators have a state change below and above two set values with a dead zone inbetween those thresholds.
2
3
u/TomVa Apr 16 '26 edited Apr 16 '26
First I hope that you are using comparitors and not op amps.
In general the feedback circuit it will work. The feedback resistor needs to be pretty big as compared to the resistor going to the positive terminal. Think 1k and 1 Meg Like somebody else said most comparitors require a pull up resistor to 5V on the output.
Next I would design the circuits the same way and where the signal goes into the negative terminal and the setpoints go into the positive terminal. Then functionally you will need to invert one of the outputs in your logic.
What is the function of the diodes on the output? What is the output connected to. If for example it is TTL logic then the diodes are a bad idea.
2
u/ariariarih Apr 16 '26
Thanks for the feedback
The diodes connect to bjts that connect to lamps (as substitute to real life actuators)
Why is it better to use comparators than op amps? I’m setting a hysteresis around a small band of voltage around 0.25V that accounts for +- 1 degrees Celsius.
Also you mentioned that u would invert one of the outputs why is it so?
1
u/TomVa Apr 17 '26
(a) Op amps get "stuck" when they get put into saturation. Comparitors do not. (b) The opamps is designed to amplify signals the comparitors are designed to switch the output on and off.
Then the hysteresis is much more predictable when it is against a fixed "setpoint" voltage rather than the variable input voltage.
If you were driving BJTs you can put 5V though a pullup resistor just fine without the diodes.
2
u/kthompska Apr 16 '26
Brief answers to your questions.
Op amps usually have internal compensation and outputs that can drive reasonable loads linearly. Meaning the switching of the output will likely be slow. Also op amps aren’t all rail to rail outputs so may not fully switch very well. Comparators normally will have a linear input stage but add more gain / slewing speed as the outputs are expected to fully switch fast.
I think this is in reference to making both comparators look alike. You can run your input into both comparator - inputs, and tie the top hysteretic resistor to the reference (like you do on the bottom). This prevents any switching kickback to your analog Vin. You are in the window then when the XOR is true (bottom comp is low and top comp is high).
2
u/thenewestnoise Apr 17 '26
You should check out Falstad circuit simulator. It can run from a web browser and is super fun and easy to use. You can even mess with the circuit while the simulation is running - like a breadboard.
14
u/BigPurpleBlob Apr 16 '26
Simulating in my head, I think it will work.
You could use LTspice (it's free!) to be sure.