Input: Color Line Follower - 图1

What Is It

The color line follower can detect lines on the ground and recognize the colors that it sees. By connecting it to the chassis, it can be turned in a compact line following car.

How It Works

The color line follower is composed of 1 color sensor (located on the middle) and 4 light sensors. Next to them 5 white LEDs are paired.
When the module is activated, the LEDs will emit light and bounce them off of the ground. The color sensor immediately receives the light reflection back and analyzes what color it is; meanwhile, the light sensors is detecting the color is dark or bright. Usually this is the way of how a robot car detects a black line on the ground.
The 5 sensors are located underside of the module and are certain distance apart. According to their position and knowing which one sends the signals, the color line follower will find out where the black line is. The line position could be indicated as: middle (right under the color sensor), left, leftmost, right, or rightmost.
The color line follower may lose the line due to the light relectance varies from different surface. If that happens, you can correct this behavior through calibration.
Input: Color Line Follower - 图2

Real World Analogy

Patrol robot

Codecraft

You can find blocks that control the color line follower in the tab Sensing in Codecraft.