# Schmitt trigger with Comparator

I want to design a schmitt trigger which triggers 3.3V above -8V (independent of whether inverting or non-inverting schmitt trigger) when the input voltage is greater than 14V and less than -6V. my total supply voltages are +15V and -8V and 3.3V above -8V (i-e -4.7). My comparator is a open collector comparator which can be connected to 3.3V to match to the output logic. The output signal of Schmitt trigger should go to microcontroller.

simulate this circuit – Schematic created using CircuitLab

As my output voltage is allowed to be in range of -8V and -4.7V (uC GND is -8V and Vcc = -4.7V), I dont know how to calculate R1 and R2 to reach this. If I calculate using +Vsat = -4.7V and -Vsat = -8V, I get negative values of Resistors.

e.g to trigger at upper threshhold of +14V.

14V = -4.7V (10K) / 10K + R1 => R1 = -13.35 KOhm

Could you please tell me where I am wrong. How to do this ? Should I use voltage divider at inverting input to scale +15V - (-8V) = 23V to 3.3V frame ?

I expect hysteresis like shown in a graph.

Thanks.

• Since your using an open collector part R1 needs to be considered along with R3, (the comparator has no positive output of its own). – Nedd Mar 1 '18 at 14:00

There are two mistakes you made:

First, you should consider that the circuit has two independant parts: the comparator with hysteresis part, and the logic level translation part. So to calculate the feedback resistors and opamp input resistors, you can completely ignore the fact that the final output is in the -4.7/-8V range. Just consider the opamp output voltage (-8/+15) and the input thresholds you need. Then you'll add a resistor divider at a second stage to bring the output in the required MCU range, but that will be done later.

The second mistake is that the R2 resistor is tied to ground on your circuit. Finding a solution here is impossible, because the opamp + input voltage needs to be somewhere between the two rails, but not necessarily ground, given the thresholds you need. So you need a three-resistor network at the + input, one resistor going to the positive rail, one to the negative rail, and one to the output (the feedback). Then you can find a solution. For information, there is a good TI app note here giving all required formulas, so you don't have to recalculate them.

Here is the final circuit:

simulate this circuit – Schematic created using CircuitLab

And the formulas used to deduce the values:

$\frac{Ry}{Rx} = \frac{Vl}{Vcc-Vh}$

$\frac{Rh}{Rx} = \frac{Vl}{Vh-Vl}$

$\frac{Rdy}{Rdx+Rdy} = \frac{Vout}{Vcc}$

With Vh, Vl the hysteresis levels required, Vcc the supply voltage and Vout the required output high level (all these should be considered as voltage differences with respect to the negative opamp supply, so e.g. Vcc is 23V).

Calculate R1 and R2 using +Vsat = 3.3V and -Vsat = 0v.