

SUMMARY
For this project, I worked with a teammate to create a colored line following robot. Unlike the IR robots simple potentiometer, we were working with the more complex sensor of a raspberry pi camera. The objective was to have a robot that could follow one of the colored lines from start to finish, despite the overlaps and track irregularities. An additional challenge of switching roads at a junction was added.
Our design was driven by two DC motors mounted on a chassis, with the camera placed above. The code was created using a provided code snippet for a black-and-white line identifier, which we modified to add motor controls and change to color sensing. We were able to complete the challenge of following a single line, and were also able to get it to switch to a different colored line.
INITIAL PROTOTYPE DESIGN
Or first design had a low front mount for sensors, taking inspiration from our past sensor experience. However, we quickly realized that the camera could not accurately image the line or even focus, so we quickly swapped to a higher mounting plate.
Again taking inspiration from our past line following robots, We placed the sensors close to in-line with the motors turning radius, in hopes that this would improve its turn accuracy. Unfortinatley, this would cause the robot to overshoot the line, so we tilted the camera mount up to show more of the path.

Camera Mount
Our code relied on the contour tracking we were provided, with adjustments to the colors and cropping. we found that we needed a much longer crop than the one provided to accurately predict turns, and calibrated the colors for the lines by creating ranges around the averages. From here we implemented PID controls for the motors, along with a stronger "pivot" command for sharper turns.
While our single color code can be adjusted for different colors by changing the range, our swapping code is more specific due to a delay to allow the line follower to switch further down the pathway.
FINAL PROTOTYPE DESIGN

Final Robot Design
In the end, our robot traversed the yellow line an was able to switch between the yellow and green lines.
Track Swapping Demonstration






