Autonomous Colour-Sensing Vehicle

The Autonomous Mine-Rescue Buggy was developed as coursework for the Embedded C for Microcontrollers module. It is a PIC-based vehicle that reads coloured waypoints, executes the mapped manoeuvre, and returns home by replaying the command log in inverse. The system uses a TCS3471 colour sensor over I²C, RGB to HSV classification, PWM motor control, wall-alignment, and turn calibration.

Results

Note: The outcome was influenced not only by control logic but also by hardware limitations. In particular, the low-grade components caused variability in performance: the motors produced slightly different outputs, leading to a tendency for the buggy to drift left or right. This required continual adjustment of power delivery and calibration routines to maintain a straight path and reliable navigation.

How it works

Final course with fast movement
Small example maze run with slow movement

Sensor: The colour sensor reads RGBC values, adjusts with a white reference, converts to HSV, and matches to preset colour ranges.

Control: Wheels run on PWM with side-specific tuning. The buggy reduces drift by bumping the wall before and after each card, then moves in fixed steps.

State: Each move is logged. On the finish card, the log is replayed in reverse so the buggy returns to the start.

Modes: Accuracy mode (power≈25) for careful runs, and Speed mode (power≈60) for faster but less precise runs.

Turn calibration
Colour sensing demo
Colour Instruction
Red Turn right 90°
Green Turn left 90°
Blue Turn 180°
Yellow Reverse 1 square, turn right 90°
Pink Reverse 1 square, turn left 90°
Orange Turn right 135°
Light blue Turn left 135°
White Finish — return home
Black Wall detected — return sequence
Colour code used for navigation
Mine-rescue buggy
Buggy hardware (PIC, motor driver, colour sensor and 3D printed light shield)
Buggy pinout
Pinout and available I/O
Course/logic schematic
Course logic
Platform, pinout, and control flow
Colour Click circuit
TCS3471 + tri-LED (I²C interface)
RGB to HSV conversion
RGB to HSV conversion used for robust thresholds
Perception pipeline