Skip to content
English
  • There are no suggestions because the search field is empty.

Troubleshooting a line-following robot

What to do when your line-following robot isn't following the line set out for it

"Line follower" sensors use multiple infrared (IR) light to detect contrasting edges - White surfaces reflect IR while black absorbs it, allowing the robot to sense the line's position and follow along - but if your robot is ignoring the line or veering off-course, there are a few common causes.

Below are some steps we can take to address the problem and get your robot back on-track.

1. Check the code. 

Often, very small errors in the code can add up to large changes in behavior - before getting into the hardware, it's a good idea to check your Makecode project over to ensure it's configured correctly and the right ports are assigned to the right components - If using unmodified example code from the lesson plan, skip to Step 2

2. Check the wiring. 

Ensure your robot's wires are securely connected, and that sensors and motors are plugged into their respective ports correctly. See the tutorials for the Line Sensor and Continuous Servos for more details on wire connections. 

3. Check the track/line being followed.

A Sharpie line or glossy electrical tape may look dark, but they can still reflect IR light, confusing the sensor and causing the robot to veer off-course.

For best results, it's best to use a white surface like poster-board for the "course" and wide, matte black tape for the "track" 

Ideally, the black line should be about as wide across as the three black sensors on the line-follower's underside.

Use: Black chalk markers, matte black tape, matte paint

Avoid: Glossy or narrow tape, markers, shiny surfaces, 

For best performance, avoid strong overhead lighting or direct sunlight that can interfere with the sensor.

4. Contact support

If the above steps fail to resolve the problem, reach out to our support team at  https://help.forwardedu.com/en/knowledge-base/kb-tickets/new with a description of the problem, and our team will be happy to help resolve the issue.