Why is the line-following robot steering off-course?

Here are some things to check when your line-following robot isn't following the line set out for it

"Line follower" sensors use multiple infrared LEDs and sensors to detect contrasting surfaces - Bright surfaces reflect IR while dark surfaces absorb it, allowing the robot to sense the line's position and follow along - however, if your robot is ignoring the line or steering 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.

Check the code

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

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. 

Check the track/line

Ensure you're using the right materials for your course - It's best to use a white surface like paper or poster-board for the "course" and wide, matte black tape for the "track" or line. 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 steer off-course.


Ideally, the black line of the track 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, some markers, shiny surfaces, 

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

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 you resolve the issue.