3–308
Motorola Sensor Device Data
For More Information On This Product,
Go to: www.freescale.com
threshold design, positive feedback can be used to provide
hysteresis for both switching points. The window compara-
tor and the other comparator circuits will be explained in the
following section.
EXAMPLE COMPARATOR CIRCUITS
Several comparator circuits were built and evaluated.
Comparator stages using the LM311 comparator, LM358
Op–Amp (with and without an output transistor stage), and
LM339 were examined. Each comparator was evaluated on
output voltage levels (dynamic range), transition speed, and
the relative component count required for the complete
pressure switch design. This comparison is tabulated in
Table
2
.
RH
R2
Vin
R1
RPU
Vout
U1
LM311
VCC
LM311 Used in a Comparator Circuit
The LM311 chip is designed specifically for use as a
comparator and thus has short delay times, high slew rate,
and an open collector output. A pull–up resistor at the output
is all that is needed to obtain a rail–to–rail output. Additionally,
the LM311 is a reverse logic circuit; that is, for an input lower
than the reference voltage, the output is high. Likewise, when
the input voltage is higher than the reference voltage, the
output is low. Figure 2 shows a schematic of the LM311 stage
with threshold setting resistor divider, hysteresis resistor, and
the open–collector pull–up resistor. Table 2 shows the
comparator’s performance. Based on its performance, this
circuit can be used in many types of applications, including
interface to microprocessors.
The amount of hysteresis can be calculated by the following
equations:
VREF
R2
R1
R2VCC,
neglecting the effect of RH
.
VREFH
R1R2
R2RH
R1R2
R1RH
R2RH
R1RH
R2RH
VCC
VREFL
R1R2
R2RH
VCC
HYSTERESIS
VREF
VREFL
HYSTERESIS
VREFH
VREF
when the normal state is below VREF, or
when the normal state is above VREF.
áááááááááááááááááááááááááááááááááá
á
áááááááááááááááááááááááááááááá
áááááááááááááááááááááááááááááá
áááááááááááááááááááááááááááááá
áááááááááááááááááááááááááááááá
áááááááááááááááááááááááááááááá
áááááááááááááááááááááááááááááá
áááááááááááááááááááááááááááááá
áááááááááááááááááááááááááááááááá
Characteristic
Switching Speeds
á
Table 2. Comparator Circuits Performance Characteristics
LM311
LM358
LM358 w/ Trans.
Unit
áááááááááááááááááááááááááááááá
áááááááááááááááááááááááááááááá
Circuit Logic Type
NEGATIVE
NEGATIVE
POSITIVE
The initial calculation for VREF will be slightly in error due to
neglecting the effect of RH. To establish a precise value for
VREF (including RH in the circuit), recompute R1 taking into
account that VREF depends on R1, R2, and RH. It turns out that
when the normal state is below VREF, RH is in parallel with R1:
VREF
R2
RH
R1
R2
VCC
which is identical to the equation for VREFH
Alternately, when the normal state is above VREF, RH is in
parallel with R2:
VREF
R2 RH
R2 RH
R1
VCC
which is identical to the equation for VREFL
These two additional equations for VREF can be used to
calculate a more precise value for VREF.
F
Freescale Semiconductor, Inc.
n
.