Robot Building for Beginners, Third Edition

(Marvins-Underground-K-12) #1

CHAPTER 15 ■ COMPARATORS


Recall that a circuit turns off if either end of its power is disconnected. Therefore, if you connect the
negative end of a circuit to pin 1 of the LM393, then the circuit can be turned on and off by the switch inside
the LM393.
On the LM393, pin 2 and pin 3 are labeled Input A- and Input A+, respectively. These are connected
to the test points that you’d like the chip to compare. If pin 2 has a higher voltage than pin 3, then pin 1
is switched to the battery (see left side of Figure 15-3). Otherwise, pin 1 is disconnected (see right side of
Figure 15-3).


Figure 15-3. Left: When pin 2 has a higher voltage (for example, 9 V) than pin 3 (for example, 0 V), then
pin 1 is switched to the negative end of the battery, thus allowing power to flow. Right: However, when
pin 2 has a lower voltage (for example, 0 V) than pin 3 (for example, 9 V), then pin 1 is disconnected, thus
preventing power from flowing


Don’t worry if this seems confusing. You can try it yourself with the comparator circuit coming up in
this chapter.


Obtaining Comparators


Comparators are useful for many robot functions other than robot brains. They are often used to simplify sensor
inputs by comparing the sensors to adjustable voltage levels. Table 15-1 shows the suppliers for the ordinary
LM393 and for the more temperature-tolerant LM2903. Either is acceptable for the line-following robot.

Free download pdf