CHAPTER 25 ■ LAUNCHING THE LINE-FOLLOWER
If the headlights and sensors are too near the floor, only fringe amounts of light (if any) can bounce
off the floor and into the sensors. The sensors will be unable to tell the difference between a light-colored
surface and a dark-colored surface; everything will look dark due to lack of light.
If the headlights and sensors are too far from the floor, stray ambient light from the room will bounce off
the floor and affect the sensors more than the light from the headlights does. As such, the robot may begin
following bright spots and room shadows, which is admittedly amusing. Placing some opaque tape across
the front of the robot helps a lot, but doesn’t look as stylish.
If you determine that the headlights and sensors are too high or too low, you can adjust the circuit
board’s mounting hardware. You can add additional washers above the circuit board to bring the sensors
nearer the floor. To move the sensors away from the floor, remove the inside upper washer or either cut the
spacers/standoffs shorter or substitute them with shorter pieces.
Headlights Too Dim or Too Bright
Take a closer look at the bottom of the photograph in Figure 25-4. Notice that the surface beneath the robot
is black. But, directly beneath the headlight, the glossy black surface appears mottled white. If the headlights
are too bright, the sensors will be unable to tell the difference between a light-colored surface and a glossy
dark surface reflecting too much light; everything will look light.
On the other hand, if the headlights are too dim, they won’t be contributing a reliable and predominant
light source to the sensors. The room’s ambient lighting and shadows will negatively affect the robot’s line-
following ability.
Fortunately, it’s easy to adjust the brightness of the headlights with the associated trimpot (R10).
After adjusting the headlight brightness, it may be necessary to rebalance the sensors using trimpot R2.
This is because each headlight LED likely produces a different amount of light than the other LED. Adjusting
the amount of current flowing through the headlight LEDs may alter the total difference in brightness
between them.
Objectively Evaluating the Sensors and Headlights
Adjusting trimpots and circuit board position by intuition may seem a little unscientific. For measurable
results, you need to be able to test the voltage at the sensor’s test points, TP1 and TP2. After all, that’s what
the comparator is looking at.
Grind a hole of approximately 1 cm in the side of the robot’s body. Or, you could put the hole in the
rear. Thread three IC hook jumper leads through the hole (see Figure 25-5). One jumper lead should be
connected to the negative power bus (or negative power test point).
Figure 25-4. Sensors placed at the optimal height to see the light reflected off the floor