Line tracker TCRT5000 with TinkerPie
Two of them under a robot make a line follower.
| Type | Digital sensors |
|---|---|
| Connect to | any accessory pin |
| Gives | true over a black line |
| Simulator | Yes: a control appears under the simulated board |
How it works
The TCRT5000 shines infrared light down and measures how much reflects back. White or shiny surfaces reflect a lot; black tape absorbs it. So the sensor can tell when it is over a black line.
How to wire it
Signal (DO / OUT / S) to any accessory pin: S1-S4, P10-P13, P43 or P44. Power from 3.3 V where the module allows it.
Code
In blocks: Accessories category in TinkerPie Studio. As code:
// JavaScript
sensors.lineTracker(Pin.S1)
// Arduino C++
sensors::lineTracker(Pin::S1) Good to know
- Mount it about 5-10 mm above the floor.
- Two sensors (left and right) make a simple line follower; three are even better.
- Turn the blue knob to set the switching point.
Projects with the Line tracker TCRT5000
Similar modules
- PIR motion sensor HC-SR501
- IR obstacle sensor
- Touch sensor TTP223
- Push button module
- Tilt switch SW-520D
- Reed switch (magnet)
- Vibration sensor SW-420
- Hall effect sensor A3144
Questions
Can I try the Line tracker TCRT5000 without buying one?
Yes. In TinkerPie Studio the simulator shows a control for it under the board, so you can test your program before you build it.
Why does my line follower lose the line?
Check the height above the floor, use matt black tape on a light floor, slow the robot down and make the curves gentler.