Robot Building for Beginners, Third Edition

(Marvins-Underground-K-12) #1

CHAPTER 6 ■ ROBOT LINE-FOLLOWING


When the switch is in the left position, the left motor is connected to the left sensors and the right motor
is connected to the right sensors. This allows the robot to follow dark-colored lines. When the switch is in
the right position, the motor wires are crossed. The left motor is connected to the right sensors and the right
motor is connected to the left sensors. This allows the robot to follow light-colored lines.
Believe it or not, switching the motor connections is all that it takes to follow different line brightnesses.
No fancy algorithms or circuitry!


Power Source and Power Switch


Also at the rear of the robot is a battery and a power switch (see Figure 6-10). The battery is an ordinary 9 V
consumer battery.


Figure 6-10. Rear-mounted power switch (left) and battery (right)


Figure 6-11. Front-mounted sensors and headlights


Sensors and Headlights


Underneath the front of the robot are two headlights and four brightness sensors (see Figure 6-11). The
headlights allow the robot to drive in darkness. By lighting the floor evenly, the headlights help prevent the
robot from thinking a shadow is a dark line.


The four sensors are arranged in pairs: two sensors for the left side and two sensors for the right side.
Technically, each side only requires a single sensor, but the leftmost and rightmost sensors act as safety nets
in case the line sneaks by the middle sensors on a sharp turn.

Free download pdf