Datasheet: https://www.ti.com/lit/ds/symlink/lm397.pdf
Compares an input voltage V_IN at the noninverting pin to the reference voltage V_REF at the inverting pin.
If V_IN is less than V_REF, the output V_O is low (V_OL) Else if V_IN is greater than V_REF the output voltage V_O is high (V_OH)
For this use case: V_REF = 0V = GND V_IN = CC1 ~= 0.19V V_OH = 5V
Input stage: bipolar Output stage: open-collector ground-emitter NPN output transistor, meaning it needs a pull-up resistor tied between V_S and OUTPUT.
Since the desired threshold voltage and reference are close (0.0 vs 0.19 V), we will add hysteresis to prevent the problem of switching spurriously. This creates two switching thresholds:
- One for the rising input voltage
- One for the falling input voltage
For an inverting configured comparator, hysteresis can be added with a three resistor network and positive feedback. When the input voltage (V_IN) at the inverting node is less than the non-inverting node (V_T), the output is high.
The lower threshold voltage V_T1 is calculated by Equation 1:
V_T1 = ((V_S * R2) / (((R1 * R3) / (R1 + R3)) + R2))
When V_IN is greater than V_T, the ouput voltage is low. The upper threshold voltage V_T2 is calculated by Equation 2:
V_T2 = V_S * ((R2 * R3) / (R2 + R3)) / (R1 + ((R2 * R3) / (R2 + R3)))
The hysteresis is defined in Equation 3:
ΔV_IN = V_T1 - V_T2
Design example: Inverting comparator with hysteresis
Let's say:
V_T2 = 0.05 V
V_T1 = 0.15 V
--> ΔV_IN = 0.10 V
Need to determine:
-
Input voltage range: 0.0 V to V_S - 1.5 V --> 0.0V to 3.5 V this seems fine if we can use 0.0 V as reference and 0.19 V as the signal for 'high'
-
Minimum overdrive voltage: This is the differential betwwen the positive and negative inputs on the comparator over the offset voltage.
-
Output and drive current: