Line Following Car Using Arduino UNO and Infrared Sensors

by albertomsagaon in Circuits > Arduino

28 Views, 0 Favorites, 0 Comments

Line Following Car Using Arduino UNO and Infrared Sensors

ChatGPT Image 2 ene 2026, 04_38_47 p.m..png

In this project, I present the development of a line following car using an Arduino UNO and infrared sensors.

The main objective of this project is to design a car capable of following a predefined path marked with a black line on a light surface, automatically correcting its trajectory.

This project is ideal for beginners in robotics and electronics, as it covers basic concepts such as sensors, motor control, and Arduino programming.

Supplies

ChatGPT Image 2 ene 2026, 04_44_39 p.m..png

Electronics

  1. Arduino UNO
  2. Motor Shield
  3. DC Motors with Wheels
  4. 9V Battery
  5. Infrared Sensors
  6. Dupont Cables (Male–Male and Male–Female)

Structure

  1. 3D Printed Chassis

These components were used to build a functional line following car.

PROJECT OBJECTIVE

LDR-Based-Line-follower-Robot-Car-using-PIC-Microcontroller-615x467.jpg

The objective of this project is to build a car that can follow a predefined path using a black line as guidance, detected by infrared sensors.

DESIGN AND WORKING PRINCIPLE

WhatsApp Image 2026-01-02 at 8.05.13 PM.jpeg

The car uses two infrared sensors placed at the front of the chassis.

When both sensors detect the black line, the car moves forward.

If one sensor stops detecting the line, the car adjusts its direction to correct the trajectory until the line is detected again.

This simple logic allows the car to follow the path accurately.

COMPONENT CONNECTIONS

ChatGPT Image 2 ene 2026, 04_44_39 p.m..png

The infrared sensors are connected to the digital inputs of the Arduino.

The motors are controlled using a motor shield, which receives commands from the Arduino to control speed and direction.

Below is the wiring diagram and the physical connections used in the project.

CODE

WhatsApp Image 2026-01-02 at 8.18.21 PM.jpeg
WhatsApp Image 2026-01-02 at 8.17.36 PM.jpeg

The following Arduino program controls the line following behavior of the car.

The code reads the infrared sensors and adjusts the motors accordingly to keep the car on the black line.

TESTING AND RESULTS

oplk.jpeg

Several tests were performed on a track with a black line to verify the correct operation of the car.

The car successfully followed the line and made the necessary corrections without leaving the path.