Line Follower

Scout wins first place!

New: Video of Line Followers from San Francisco. Robotics Society of America's Spring Robot Games.

The Robot can find its way around the maze easily.

This page describes how students can build a robot using two motors and two light sensors to be able to follow a dark line on white paper.

I discovered that when I attempted to use my linefollower in different situations, I would have problems because of the brightness. The Linefollower Robot has been updated with the addition of light shields that cover the light sensors. This makes them far less subject to problems related to the brightness of the room. Even with great changes in brightness, the readings are now fairly constant. Also, the program has been slightly improved, so that instead of using a numeric constant as the brightness that it references, it uses a value based on a reading taken at the beginning of its journey. If it begins with sensor number 1 over white paper, it will take the brightness reading of that paper, and subtract 3 to get a rough dark line value.

The course: I built the course using white butcher paper and 1" strips of black construction paper. I began with right angles, but after a while, I decided any angle would be fine. The width between the lines is an issue. Some robots with sensors very far apart would have difficulty if their robot detected an adjacent line by accident. Using a single light sensor seems possible, but far more difficult and more easily fooled.

The paper lines were simply taped down here and there with scotch tape: note scotch tape is reflective and shows up brighter than the black paper. That didn't really seem to cause many problems unless the tape completely covered a section of paper. Being paper, it was cheap and easy to make, and easy to change also.

The Scout line follower robot design:

The Scout was built with large wheels in front, geared down, but that still makes for a fast, low powered robot. Other than the RCX, two light sensors, two motors, two large front drive wheels, and a tiny rear wheel, there really weren't very many parts. I set the light sensors just inside the two large front wheels, so that the wheels would accurately guide the light sensors. Wherever the wheels turned, the sensors would follow.

The rear wheel was made to pivot easily.

Below is an image of the Robolab program that controlled the Scout. It may look complicated for a beginning programmer, but its concept is simple:

Drive forward: If you hit the line from the right, turn right until you leave the line. If you hit the line from the left, turn left until you leave the line.

You'll notice that the numeric constant attached to all of the icons relating to the light sensor is 45. In my classroom and in most areas where I have tested this robot, the number 45 was about what it took to detect the dark line verses the paper. When I used the default value, my robot always thought it was hitting a line. Unless there is very bright light, this seems to work for my robot. You can use the view button on the RCX to read a value from a sensor:

By hitting the view button you can observe data from each of the different inputs/outputs.

Click here to download the actual Robolab Code.

The updated program can be seen here:

Click here to see a quicktime video of the Scout in Action

.