What is a line sensor and what is it good for?
A robot Line Sensor is a short range Infra Red (IR) sensor. Its range is less than 1.5 cm and it will react to changes in reflected light from light to dark. Put a strip of black electrical tape on a light colored surface and these sensors can tell the robot when they ‘see’ it. The output is a simple Yes or No, 1 or 0.
Students can build line following robots and compete. It is one of the challenges in The BotBrain Educational Robots curriculum.
Line following tournaments can be done in a classroom, a club or between classes or clubs. They are usually run as time trials, rather than side-by-side, although you could construct two matching courses next to each other. Loops of five to 15 feet of tape work well with suitable twists and turns. Mark a start/finish line, use a stopwatch, and the fastest robot wins.
Courses can also be a winding line with two unconnected ends. Robots can race one direction only. More challenging is an out and back course. When the line ends, the bot must turn around, find the line again and return to where it started.
If your floor is light color, use black electrical tape and make a race course (actually a time trial course). If it is dark you can use white electrical tape and reverse the way the program reads the sensors.
Robots can follow a line with two or even one sensor. We prefer to use three sensors side-by-side and that is what we include in our Advanced and Classroom sets.
Think of the three sensor array as 1 for yes (“saw” the line) and 0 for NO (“saw” the floor).
Programming is simple: in a repeating loop:
These are the common combinations of sensor readings. (first number = left side): 000, 001, 010, 100.
Other combinations will occur infrequently and fleetingly but your students may need to handle them. 110, 011 might indicate the bot is crossing the line diagonally. 111 means it is at right angles to the line.
Students get really excited when they watch their robot actually following the program they loaded.
And with BotBrain robots you can program with traditional pBasic code or with our new Picture language, which lets them concentrate on logic and ignore syntax.
There are dedicated line following robot kits on the market and large international competitions.
These robots sometimes reach very high speeds without driving off the line. Here are two links to Line Following videos:
Bill Bechtel 717-448-4855
Joe Osborne 717-448-7555