This project involved the design and programming of an autonomous robotic car capable of following a black line while detecting and avoiding obstacles. Built using an Arduino-based SunFounder Zeus Car platform, the system integrates grayscale line-tracking sensors, ultrasonic distance sensing, and infrared obstacle detection. I developed and implemented control algorithms for smooth line following using weighted sensor averaging, proportional control, and filtering, alongside a state-based obstacle avoidance strategy. The project demonstrates practical skills in embedded systems, robotics, sensor integration, control logic, testing, and system optimisation.
This project involved developing an autonomous robotic car capable of following a predefined line while detecting and avoiding obstacles in real time. Using an Arduino-based platform with grayscale, ultrasonic, and infrared sensors, I implemented control algorithms for smooth line tracking and reliable obstacle avoidance, demonstrating practical skills in embedded systems, robotics, sensor integration, and testing.
Mathematical Calculation & Control Analysis
Line tracking was achieved by computing a weighted average of grayscale sensor readings to determine lateral position error, which was converted into a steering angle using proportional control and smoothed with a low-pass filter. Obstacle avoidance used distance thresholds from ultrasonic sensing and infrared state detection, applying a rule-based decision algorithm with state memory to select safe navigation paths. Together, these methods ensure stable motion, smooth steering, and reliable collision avoidance in dynamic environments.
Code & Algorithm Overview
The control software was implemented in Arduino C/C++ and structured around two primary algorithms: line tracking and obstacle avoidance. Line tracking processes raw grayscale sensor data to compute a weighted positional error, which is converted into a steering command using proportional control and filtered to reduce sensor noise. Motor commands are generated by combining a constant forward velocity with the calculated steering angle.
Obstacle avoidance operates as a state-based decision algorithm, using ultrasonic distance thresholds and infrared sensor states to detect obstructions. When an obstacle is detected, the algorithm temporarily overrides line tracking, selects a turning direction based on sensor availability and stored state variables, and resumes forward motion once a clear path is detected.
Gained Experience
Through this project, I developed practical skills in embedded systems programming, sensor integration, and control algorithm design. I gained hands-on experience with Arduino C/C++, grayscale line sensors, ultrasonic and infrared obstacle detection, and motor control. I also strengthened my abilities in algorithm optimisation, real-time decision making, testing, and debugging autonomous robotic systems, while improving problem-solving, system integration, and technical documentation skills.