Robot Building for Beginners, Third Edition

(Marvins-Underground-K-12) #1
CHAPTER 15 ■ COMPARATORS

Test point 1 (TP1) connects to IC1 input B-, which is then connected to IC1 input A+. Test point 2 (TP2)
connects to IC1 input B+, which is then connected to IC1 input A-. So, both test points are connected to both
comparators, except the connections are reversed on one of the comparators.
R7 and LED7 form an LED indicator circuit. As stated earlier, R7 is a current-limiting resistor that
protects LED7 from the full force of the battery. This is the same simple LED circuit design that you use for
the solderless breadboard power indicator. The big difference here is that the negative end of the LED circuit
is connected to IC1 output A instead of the negative terminal of the battery.
When the comparator chooses to switch output A to the negative terminal of the battery, then power
can flow from the positive terminal of the battery, through R7, through LED 7, through IC1 output A, and
into the negative terminal of the battery. This flow of electricity turns on the LED. When the comparator
chooses to disconnect output A, no power can flow and the LED turns off.


Having Fun with the LED Indicators and Light Sensors


When you turn on power, either the green LED or the yellow LED will light. One at a time, cover each
photoresistor with your finger. Try waving your hand across the sensors right to left and left to right
(see Figure 15-7). The LEDs should blink back and forth as each side receives more or less light.
Now you have everything you need to tune the balance between the photoresistor sensor pairs by
adjusting the trimpot (R2). Turning the dial far to one side should light one LED and turning the dial far to
the other side should light the other LED. At some point, toward the middle of the dial, both LEDs should be
lit or they should switch back and forth with only a slight turn of the trimpot dial to the left or right.
That’s the balanced position. Although not strictly impossible, you’re not likely to get both LEDs to light
at the same time.
With balanced sensors, the LEDs should switch back and forth with even a faint shadow across the
photoresistors. I noticed that the light reflecting off of my shirt was enough to activate the appropriate LED
depending on which way I leaned.


Diagnosing Problems in the Brightness Comparator Circuit


What if your circuit isn’t having fun at this point? If the circuit isn’t working correctly, there are a bunch of
tests you can perform to pinpoint the problem.


Confirming Power Across the Board


Make sure power is on. The LED power indicator circuit installed on the solderless breadboard should be
lit. If not, disconnect the battery and measure its voltage independent of the circuit. If the battery’s voltage is
less than 6 volts, replace it with a fresh battery.
If the battery seems to have plenty of voltage when removed from the circuit, but voltage drops
significantly when installed, the circuit probably has a short. This occurs when a positive wire is mistakenly
connected to a negative wire somewhere on the breadboard. In that case, the power goes straight through
the shorted wires without bothering to go through the routes containing all the electronic components.
Carefully compare all of your wires to the schematics and photographs.
If the battery is fine and you don’t have a short circuit, check that positive and negative connections to
power are being supplied throughout the buses. To do this, connect the multimeter’s black test probe and
red test probe to each quadrant of the board to ensure that full battery voltage is being delivered.

Free download pdf