STEM Robotics 4 All

STEM Resources for all

Lesson 6: Alignment

Hello! In this lesson we will discuss how to align youself perpendicular to a black line with two color sensors.

To begin with, let us think what is necessary to be aligned. Our color sensors should be more or less like this:

The red spots represent the positions of the color sensors FOV (Field of vision). Judging from the picture, we need to make sure that both of the color sensors have their eyes on the black.

One simple idea is to wait until one eye catches the black line, then do a pivot turn until the other one catches it.

The program of such an algorithm would resemble the following: