Line Following Robot Project (RGB Integration)

The Problem

The problem was as stated: use your color sensor to autonomously navigate a maze by following a specific color line. Many challenges could be derived from the problem statement, and a few our team tackled are highlighted below:

Criteria for the project:

The Process

CAD/Manufacturing

The robot had 4 different parts, each serving a specific purpose:

CAD Model

Electronics

The wiring of the color sensor was complex, but the diagram below illustrates the connections required:

Wiring Diagram

Using an L298 dual H-bridge, we connected 2 DC motors to the Raspberry Pi by modifying the stepper motor setup from previous projects. Additionally, battery packs were used to power the Pi and the DC motors through the H-bridge.

Coding

The coding process was rigorous and divided into three sections to control the line-following robot:

The code works by detecting whether the color sensor reads a value closer to the specified color or white. If it reads white, the robot moves left; if it reads the specified color, the robot moves right.

The Solution

The video below shows the robot traversing through the blue line. The robot moves slowly due to overshooting issues that occur when the speed is increased. All challenges were completed, and the robot can traverse all 4 lines at different (slow) speeds, as well as go down one line, reset, and come back through any other line.