CHAPTER 15 ■ COMPARATORS
Examining the LM393
The LM393’s full title is “Low Power, Low Offset Voltage, Single Supply, Dual, Differential Comparators.”
That’s a mouthful.
- The “Low Power” term indicates that the chip doesn’t use much electricity. That’s
valuable to a battery-powered robot. - The “Low Offset Voltage” term indicates that the chip can compare voltages that
are very close to each other. That’s going to be useful for the subtle differences in
brightness encountered during line following. - The “Single Supply” term indicates that the chip operates using only one power
source. A “Dual Supply” chip needs two back-to-back power supplies (or circuitry)
to produce a positive, neutral, and negative. Some comparators are designed to be
flexible, and can operate with either single or dual supplies, depending on how you
connect them. - The “Dual” term indicates that there are two independent comparators in each chip.
It’s a two-for-one special! “Quad” chips contain four independent comparators. - The “Differential” term indicates the chip has circuitry to convert the comparison
between two voltages in the input voltage range to a single digital output in the
power supply’s voltage range. For example, the chip’s output voltage won’t drop
when the input voltages are very small, nor will it rise when the input voltages are
very large.
Turning to the Datasheet
Vital information regarding each chip or part is contained in a document called a datasheet. The datasheet is
freely available from the manufacturer, often on their web site.
The datasheet begins with a brief description of the part, usually pointing out the features that have
been improved over prior models. This is helpful in that it emphasizes attributes that professional engineers
find particularly important (or that were previously lacking) in that kind of component.
The datasheet contains typical and maximum values for a selective list of electrical characteristics,
such as: how much current it uses (battery drain), what voltage range it can tolerate, what temperatures it
operates under, and so on. According to the datasheet, the LM393 can be powered from 2 V to 36 V. This
generous range easily fits within a 9 V battery’s voltage characteristics (5 V to 10 V).
There are a couple of significant issues revealed in the LM393 datasheets.
The first issue is that the LM393 can’t compare voltages within the upper 1.5 V of the current battery
level. So, if both test point’s voltages are hovering in the 8 V range and the battery is 9 V, the comparator
won’t make a correct comparison.
The second issue is that the comparator can’t guarantee that it has enough strength by itself to switch
on a circuit that uses more than 6 mA. The datasheet indicates that the comparator can typically switch up
to 16 mA, but you may legitimately receive a batch of chips with only 6 mA capability.
Both of these issues are compensated for in the robot’s design, as will be pointed out later.
Inspecting the Pinouts
On chips, the metal wires sticking out are called pins. By far the most necessary information about a chip
is how to hook up the pins to the rest of the circuit. The tiny chip case is too small of a surface on which to
print text descriptions or numbers for the pins. So, the datasheet provides an annotated illustration called a
pinout, which shows all of the pins and their respective functions.