# What is the upper and lower threshold of the comparator circuit?

#### vt600

Joined Jul 30, 2018
15
I was trying to analyse the following existing circuit. My intention was to calculate the hysteresis of the comparator.

Circuit working: For both compartor input, there will be voltage inputs ranging from 40 mV to 250 mV. This will vary as per the connected circuit and will trigger the output of the comparator either as HIGH or LOW.
I have worked on comparators with one input pin as fixed-reference voltage and other pin as the varying-input voltage.

Comparator Part Number: TS332 comparator from ST.

For me this seems bit new and I failed to understand the working of the comparator completely.
Basically I am looking for a guide to calculate the upper and lower threshold and finally the hysteresis.

Could someone help me with this.
Thanks a lot for your consideration

#### ericgibbs

Joined Jan 29, 2010
10,018
hi vt,
This PDF may help.
E

#### Attachments

• 178.6 KB Views: 9
• vt600

#### MrChips

Joined Oct 2, 2009
21,087
Just consider the circuit connected to the inverting input.
This is a summing junction consisting of R2 and the rest of the circuit along the R3 path.

Consider the two states of Vo, ON and OFF.

When Vo = OFF
ignore the transistor. R5 is pulled up to 3.3V

When Vo = ON
ignore R4 and R5
treat R2 and R3 as a voltage divider with R3 connected to GND.

• vt600

#### vt600

Joined Jul 30, 2018
15
Hello MrChips,

That is really great, as per that I got the threshold point as follows,
3.3 V * ( R5 / (R5 +R6 ) ) = 3.3 V ( 2.7 kΩ / ( 2.7 kΩ + 97 kΩ ) = 0.089 V

Can I call this value as lower threshold value, fundamentally will there be absolute lower and upper threshold values?
Or will it depend on the input voltage as well ?

And I understood the voltage divider path for the other threshold value -> R2 and R3

#### MrChips

Joined Oct 2, 2009
21,087
Remember that you are measuring the differential input between the left-hand side of R1 and R2.

• vt600

#### ebp

Joined Feb 8, 2018
2,332
No, almost none of that is correct.

When the output is HIGH, the transistor is ON so the voltage at the input is determined by the divider or R2 and R3, if the saturation voltage of the transistor is ignored. It perhaps should not be.

When the output is LOW, it is a much more complex. The transistor is OFF, so you now have a network with R2, R3, R4 and R5 and two sources (input, presumed to be variable, and 3.3 V). If the source impedance of whatever is connected to R2 is very low, it can probably be ignored, otherwise it must be considered. You can assume that the current into the comparator input is insignificant (100 nA max at high temperature. so error will be about a millivolt, max, if the source impedance is low). You then need to use your favorite method to solve the network.

R6 plays no direct role in setting the thresholds.

• vt600

#### AnalogKid

Joined Aug 1, 2013
8,448
In a circuit with only 3.3 V of total headroom and very small input voltages, you cannot ignore the transistor saturation voltage. The max value on the datasheet will be too high for your application; better to measure it in the circuit. If you can't, I start with 50 mV as realistic, 100 mV as conservative for a small signal transistor.

Ignore R6 all the time.

Ignore R5 when the transistor is on.

4.2K and 97K are not standard resistor values.

ak

• vt600