This line follower robot is built using an ESP32, TB6612FNG motor driver, 8-channel IR sensor array, and N20 motors. The bot uses PID control for smooth and accurate tracking of black lines on white surfaces. A button toggles start/stop mode, and all logic runs onboard with PWM motor control.
The PID controller uses Kp = 30 and Kd = 20. Ki is kept at 0 to avoid integral windup. The bot performs best at medium speed on sharp and smooth curves. The IR sensor values are inverted using !digitalRead() for compatibility with black-line-on-white tracks.