Line tracker, 5 channel
A five-channel line tracking board: five TCRT5000 sensors in a row, each with a comparator and lamp. Aliases: line follower sensor.
It is the strip across the front of a line-following car. Each channel is the single TCRT5000 board: an infrared LED and a phototransistor looking down at the floor, and a comparator that pulls its output low over white and lets it go high over the black line.
Pins
| Pin | What it does |
|---|---|
GND |
Ground. |
VCC |
Supply, 3.3 V to 5 V. |
S1 to S5 |
One per sensor, S1 at the left looking forward: high over the black line, low over white. Open collector with a 10 k pull-up. |
Properties
threshold is the board's one trimmer, as a fraction of the supply, 0.5 by default.
It sets all five channels.
While it runs
Above the board is the floor it looks at. Drag the slider to move the black tape across under the sensors, up to 45 mm either side of the middle one. Click the swatch to lay a black bar across the whole track, the finish line or a crossing. Each lamp is lit over white, as on the real board.
What the model gets right
One sensor or two. The sensors are 15 mm apart and the tape is 19 mm wide, the 3/4 inch roll. Each sensor looks at a spot 5 mm across and reads black once the tape covers about 60% of it, so with the tape under a sensor one channel is high, and with the tape between two, both are. That is what gives a sketch a position finer than the spacing.
Each channel is a TCRT5000. The phototransistor's current comes from the same datasheet curve as the single sensor, at its 2.5 mm peak height, over 90% white and 5% black.
The crossbar. A bar across the track turns all five on at once, which a sketch reads as the finish.
What it does not model
The chassis moving: the floor moves instead, from the slider. The 15 mm spacing is the model's choice, inside the spacing these boards are made with. Ambient infrared, glossy floors, and tape edges that are anything but sharp are not modeled. There is no hysteresis, as on the real board.
Common mistakes
Getting the line the wrong way around: high is the black line.
Mounting it too high. Past a centimeter a TCRT5000 cannot tell white from black.
Steering the wrong way. With the line to the right (toward S5), the left wheel has
to run faster.
See it in action
Line-following cart steers two motors on a TB6612FNG to keep the tape under the middle sensor. Open it at /templates.