All Projects
Autonomous SystemsYear 2026

Autonomous 5-Channel IR Line Follower Robot

An autonomous line follower robot with a 5-channel TCRT5000 IR sensor array, L298N differential drive, and PID weighted error logic for smooth trajectory execution.

Arduino C++PID ControlIR SensingDifferential Drive
5-Channel IR sensor array & L298N chassis layout

5-Channel IR sensor array & L298N chassis layout

Overview

This autonomous line follower employs a 5-sensor IR array (Far Left, Near Left, Center, Near Right, Far Right) paired with an L298N dual H-bridge motor driver. By calculating weighted spatial errors across the array (-4 to +4), the robot dynamically computes smooth differential motor speeds using a PID algorithm (BaseSpeed ± Kp×Error + Kd×ΔError). If the line is momentarily lost, an error-memory recovery loop executes sharp pivot recovery.

Highlights

  • 5-Channel TCRT5000 IR sensor array with weighted error scale
  • Proportional-Integral-Derivative (PID) dynamic motor control
  • L298N Dual H-Bridge motor driver with PWM speed regulation
  • Last-error tracking for automatic off-track pivot recovery

The Challenge

Eliminating mechanical jerks on sharp 90-degree track curves required fine-tuning the proportional (Kp=25.0) and derivative (Kd=15.0) gain parameters.

The Outcome

Achieved smooth, high-speed line tracking with zero oscillation on sharp bends, serving as a core hands-on control theory model.

Project Media & Build Gallery

[4 PHOTOS]
5-Channel IR sensor array & L298N chassis layout

5-Channel IR sensor array & L298N chassis layout