CHAPTER 15 ■ COMPARATORS
For the purpose of solderless-breadboard experiments, I settled on a current-limiting resistor of 470 W.
Pick 330 W, 220 W, or even 150 W if you’d prefer brighter headlights. Remember that 93 W results in the
absolute maximum current (30 mA), not the recommended current. LEDs are usually driven at currents
between 2 mA and 20 mA.
Do not use any color other than white for the robot’s headlights. For example, if you choose red
headlight LEDs, then the robot will be unable to follow a blue tape line. The blue color of the tape reflects
very little red, and the photoresistor sensors won’t see any reflected light. White headlights provide the most
universally satisfactory results.
Building the Headlight Circuit
The headlights should go within the cluster of photoresistor sensors. There happened to be three empty
solderless-breadboard columns in the center of my sensor circuit. If you don’t have enough room, just shift
some parts over. Ease of rewiring is a dominant feature of solderless breadboards..
Rather than extending a wire from the upper bus above the trimpot, I chose to add the headlights with
power coming from the positive bus on the lower side of the breadboard. Figure 15-11 shows the current-
limiting resistor (R9) connected to positive power and then going up to the anode of LED9. This is the same
technique as the LED power indicator circuit uses.
Figure 15-11. Headlight circuit built on solderless breadboard
With the headlights installed, the photoresistor sensors are no longer as sensitive to ambient shadows.
That’s a desirable feature for line following, as the robot won’t start following deep shadows instead of the
line. However, shadow ignoring takes some of the fun out of testing.
The sensors will likely need to be rebalanced. This is because the LEDs are lighting the photoresistors
from behind. Some of the light is leaking through the backside of the photoresistor ceramic and
contaminating the sensor values. For my finished robot, I tried to keep the heights of the LEDs the same as
the heights of the photoresistors. I also painted the backs of the photoresistors black to prevent leakage.
Now that the circuit no longer needs ambient light, take the breadboard into a dark closet for hand-
waving testing. Aren’t you glad you’re using a battery as a power source so that the breadboard is portable?