Line Follower Robot

PID-controlled autonomous line follower robot implemented in C++ on an Arduino platform. GitHub repo available.

Line Follower Robot is an autonomous robot that tracks a line on a surface using an array of infrared sensors and a PID (Proportional–Integral–Derivative) controller for precise steering.

Control System

The core of the robot is a PID controller that minimizes the error between the robot’s current position relative to the line and the desired center position:

  • Proportional (P): Corrects steering proportional to the current offset from the line.
  • Integral (I): Eliminates steady-state error accumulated over time.
  • Derivative (D): Dampens oscillations by responding to the rate of change of error.

PID gains (Kp, Ki, Kd) were manually tuned on a test track to achieve smooth, fast, and stable tracking.

Hardware

  • Microcontroller: Arduino Uno
  • Sensors: 5-channel IR sensor array (TCRT5000)
  • Actuators: DC gear motors with L298N H-bridge motor driver
  • Power: 7.4V LiPo battery

Performance

Achieves reliable tracking on curved, straight, and intersecting line paths. Handles moderate speed variations without losing the line.

Repository

github.com/souravbasakshuvo/line-follower-robot