Colored Line Following Robot Using Camera
Class: ME35 - Robotics
Skills: Camera, PID, Robotics
​
Project Description:
In this project, we used a camera connected to a Raspberry Pi to identify the color of a line and enable the robot to follow it. To achieve precise line tracking, we implemented a PID controller, which helped adjust the robot's movements by continuously correcting its trajectory based on deviations from the detected line. The robot was powered by two 12V DC motors, which provided the necessary mobility and responsiveness for smooth navigation.​


Program / Design
The program that enabled the camera to detect the color and follow the line worked by first capturing the HSV values of the target color. Using contour detection, it identified the centroid of the line and determined its position relative to the camera's field of view. A PID controller was then implemented to continuously adjust the robot's movement, ensuring that the line remained centered in the camera's frame. This approach allowed for smooth and accurate line tracking. Mechanically, the robot functioned in almost the same way as our previous IR sensor-based line-following robot.
Video of the Robot in Action!
Here's a video of our finalized robot in action following a pink line!
