This animation demonstrates the principle of aligning to a line with two color sensors and a LEGO Mindstorms Robot Inventor robot. This is a useful concept for FIRST LEGO League competitions where you want to know exactly where you are on the field and to achieve consistent behavior. In the course lesson you will also find a live video tutorial where we enter into more details about aligning. We align the robot to a line by moving both sensors slowly until they both see a black line. When one of them sees the line we move only the other. At the end we return the first sensor back.
- #1932
- 24 Mar 2022
- 0:15
- LEGO MINDSTORMS Robot Inventor
- FIRST LEGO League, Scratch, LEGO MINDSTORMS App Word Blocks, FLL, LEGO Mindstorms Robot Inventor, Light and Color Sensor, Sensors, Animation
Second sensor
Note that in this tutorial we need a second sensor. The LEGO MINDSTORMS Robot Inventor 51515 set does not come with a second color sensor and for this and a few of the other tutorials you will need a second sensor.
Different robot
As we need a second sensor we've also modified the construction and we've used a different construction. Make sure you follow the building instructinos.
Courses and lessons with this Tutorial
This Tutorial is used in the following courses and lessons

FIRST LEGO League with LEGO Mindstorms Robot Inventor. "Challenge" competition for 9-16 years old
The goal of this course is to take you through some of the most useful principles for building and using attachments to accomplish missions at FIRST LEGO League competitions. The whole course is based on a LEGO MINDSTORMS Robot Inventor and you need a single 51515 set and without additional parts (you will need a second color sensor for the lessons for using two color sensors, but feel free to skip them if you don't have it). For every mission there is a Scratch and Python program attachment. The course consists of 25 lessons suitable for beginner and advanced students. Every lessons consists of a video tutorial demonstrating the principle and how the mission could be accomplished along with building instructions for the robot, the attachment and programs for controlling the robot.
- 43
- 131:34
- 21

Align using two Color Sensors and a line
This animation demonstrates the principle of aligning to a line with two color sensors and a LEGO Mindstorms Robot Inventor robot. This is a useful concept for FIRST LEGO League competitions where you want to know exactly where you are on the field and to achieve consistent behavior. In the course lesson you will also find a live video tutorial where we enter into more details about aligning. We align the robot to a line by moving both sensors slowly until they both see a black line. When one of them sees the line we move only the other. At the end we return the first sensor back.
- 3
- 0
- 1
- 3d_rotation 1