Attention: Safety Recall of Vernier Go Direct Charge Station. Click to learn more.




Most self-driving vehicles are able to detect and follow road markings. In this activity, students program mBot to use the Line-Follower Sensor to follow the edge of a black line.


  • Use the output of the Line-Follower Sensor to allow mBot to navigate autonomously by following a line.
  • Apply an understanding of the mBot Line-Follower Sensor to mimic the actions required of real-world autonomous vehicles.
  • Practice writing code and troubleshooting when problems arise.

Sensors and Equipment

This experiment features the following sensors and equipment. Additional equipment may be required.

Ready to Experiment?

Ask an Expert

Get answers to your questions about how to teach this experiment with our support team.

Purchase the Lab Book

This experiment is #M6 of Coding with mBot: Self-Driving Vehicles. The experiment in the book includes student instructions as well as instructor information for set up, helpful hints, and sample graphs and data.

Learn More