Robot Building for Beginners, Third Edition

(Marvins-Underground-K-12) #1

CHAPTER 15


Comparators


You’re in the midst of prototyping a line-following robot on a solderless breadboard. At this point, the
breadboard has a power supply (9 V battery), a power switch, a power indicator (LED circuit), and two pairs
of brightness sensors. It’s time to add some brains.
In this chapter, you’ll learn about a comparator chip. Upon adding it to the breadboard, it compares the
sensors and illuminates an LED depending on which pair of sensors is receiving more light.


Voltage Comparator


An analog voltage comparator chip (see Figure 15-1) is somewhat like a tiny voltmeter with built-in switches.
It samples voltages at two points and turns on a switch if the first point’s voltage is greater than the second
point’s voltage. It turns off the switch if the first point’s voltage is less than the second point’s voltage.


Figure 15-1. 2903 and 393 analog voltage comparators


Like most chips, the comparator comes in different models and packages. To avoid intimidation, I chose
the most common comparator with the fewest connections.
The least expensive model is the LM393. The LM293, LM2903, and LM193 are completely compatible
with the LM393, with the added ability to operate at more extreme temperature ranges (below freezing and
above 70° C). Feel free to choose any of those model numbers from any manufacturer.

Free download pdf