With this circuitry I'll be turning it off above 29V. I can design similiar comparator to turn it on below 24V. What would be the best way of combining these circuitries? And how do I add hysteresis? Is it a feedback resistor to the OpAmp?
The window comparator circuit is the best for selecting a range of voltages, which requires another comparator, you may have to have to watch the impedance of the transistor stage, or provide a buffer as this circuit is more for a high impedance input as it has a pull up.
Another way to do this would be to use diodes between the window comparator and the transistor.
With hysteresis the diode design might be better, however with a feedback resistor and a high impedance reference voltage this may prove difficult. Make sure you size the resistors of the feedback network to be higher impdeance than the voltage dividers so the reference voltage doesn't sag.
You don't really need separate hysteresis at each end of your range, for a total of 4 thresholds. You only need a single hysteretic comparator that covers the entire range, for a total of two thresholds. In your case, those thresholds would be 5V apart.
When the input exceeds 29V, the circuit switches and starts looking for 24V. When the input drops below 24V, the circuit switches and starts looking for 29V.
This circuit should get you started:
The VR's are the adjustment points. The two other resistors around each one are to limit the range if you need, or you can calculate the exact values that you need and eliminate some adjustment.
sis the scale factor that the input is reduced by. Set this first so that the input is always in the opamp's range.
cis the center of the hysteretic range.
ris the hysteretic range itself.
The feedback to the positive input is what creates the hysteresis.
In this variation, you might think of it as the threshold staying fixed and the apparent input "jumping" up or down following the output. An alternate version would swap the
Input ladders so that the threshold seems to jump instead. Either way works, and you can make it inverting or non-inverting simply by the way you connect it.
Using a 555 timer in schmitt trigger mode. When your Vin is lower than 24V, the TRIGGER voltage is below 5V when it passes thru a 19V zener diode; this will cause the OUTPUT to go high.
When the Vin exceeds 29V, TRIGGER voltage will >10V. This will cause the OUTPUT to go low.
The IC cost less than 10 cents if you buy in bulk.