# Comparator has Independent Trip Voltages

## Texas Instruments LM393

For an inverting amplifier with hysteresis, resistors RA, RB, and RF determine the crossover voltages (Figure 1). Unfortunately, using three resistors to set the upper and lower trip voltages creates a dependence between the two trip voltages: It’s impossible to set one voltage without affecting the other. However, you can achieve the same output-voltage response with two independent trip voltages by using a comparator with an open-collector output, such as the LM393 or LM339. In Figure 2, the resistor divider of R1, R2, and R3 determines the upper trip voltage, V1. R4 and R5 determine the lower trip voltage, V2.

 Figure 1. Three resistors determine the trip voltages of an inverting comparator (a) with hysteresis (b), but the trip voltages are not independent.

When VIN is between 0 and V1, VOUT is high and prohibits any current flowing through R4 and R5, which sets V2 to VCC and thus keeps the output of Comparator B high.

When the output of Comparator B is high,

When VIN exceeds V1, VOUT goes low, to 0.7 V, allowing current to flow through the resistor divider. V2 then changes from VCC to

On this change, the output of Comparator B also goes low, bringing V1 to

V1 is now lower than VIN, so VOUT goes low. VOUT stays low until VIN drops below V2. When VIN drops below V2, VOUT goes high again; V2 = VCC; and R1, R2, and R3 set V1.

 Figure 2. Using a dual comparator with open-collector outputs allows you to set either trip voltage without affecting the other.

You can easily set either trip voltage without affecting the other. However, V1 must be greater than V2 or both trip voltages will be equal to V1. A disadvantage of this circuit is that it requires two comparators, but comparators usually come in dual packages.