INTRODUCTION
A line follower robot is a simple and popular beginner project in robotics. This robot follows a black line using IR sensors and controls motors using Arduino.
In this project, we use Arduino UNO, L298N motor driver, and IR sensors to build an automatic robot. This is perfect for students and beginners.
WATCH YOUTUBE VIDEO
Watch full working of Line Follower Robot:
COMPONENTS REQUIRED
| Item Image | Item Name | Quantity | Buy |
|---|---|---|---|
![]() |
Arduino UNO | 1 | {getButton} $text={Buy Now} $icon={cart} $color={#007bff} |
![]() |
L298N Motor Driver | 1 | {getButton} $text={Buy Now} $icon={cart} $color={#007bff} |
![]() |
IR Sensor Module | 2 | {getButton} $text={Buy Now} $icon={cart} $color={#007bff} |
![]() |
DC BO Motors | 4 | {getButton} $text={Buy Now} $icon={cart} $color={#007bff} |
| Robot Chassis | 1 | {getButton} $text={Buy Now} $icon={cart} $color={#007bff} | |
![]() |
Wheels | 4 | {getButton} $text={Buy Now} $icon={cart} $color={#007bff} |
| 18650 cells | 2 | {getButton} $text={Buy Now} $icon={cart} $color={#007bff} | |
![]() |
18650 cells holder | 1 | {getButton} $text={Buy Now} $icon={cart} $color={#007bff} |
![]() |
Jumper Wires | As Required | {getButton} $text={Buy Now} $icon={cart} $color={#007bff} |
TOOLS REQUIRED
| Image | Tool Name | Quantity | Buy |
|---|---|---|---|
![]() |
Screwdriver | 1 | {getButton} $text={Buy Tool} $icon={cart} $color={#007bff} |
![]() |
Wire Cutter | 1 | {getButton} $text={Buy Tool} $icon={cart} $color={#007bff} |
![]() |
Hot Glue Gun | 1 | {getButton} $text={Buy Tool} $icon={cart} $color={#007bff} |
| Double Side Tape | Optional | {getButton} $text={Buy Tool} $icon={cart} $color={#007bff} |
APPS AND ONLINE SERVICES
| Image | App Name | Access |
|---|---|---|
|
|
Arduino IDE | {getButton} $text={download} $icon={download} $color={#007bff} |
|
|
Arduino Web Editor | {getButton} $text={Open} $icon={link} $color={#007bff} |
|
Tinkercad Circuits | {getButton} $text={Open} $icon={link} $color={#007bff} |
|
|
Google Chrome / Browser | {getButton} $text={download} $icon={download} $color={#007bff} |
CIRCUIT DIAGRAM
Refer below image for wiring:
WIRING CONNECTIONS
Arduino ↔ IR Sensors
| IR Sensor Pin | Arduino Connection |
|---|---|
| Left Sensor OUT | Pin 2 |
| Right Sensor OUT | Pin 3 |
| VCC | 5V |
| GND | GND |
Arduino ↔ L298N Motor Driver
| L298N Pin | Arduino Connection |
|---|---|
| ENA | Pin 11 (PWM) |
| IN1 | Pin 10 |
| IN2 | Pin 9 |
| IN3 | Pin 8 |
| IN4 | Pin 7 |
| ENB | Pin 6 (PWM) |
| GND | GND |
Motor Connections ↔ L298N
| Motor | L298N Output |
|---|---|
| Left Motor (Motor A) | OUT1 & OUT2 |
| Right Motor (Motor B) | OUT3 & OUT4 |
Power Connections
| Component | Connection |
|---|---|
| Battery (+) | L298N 12V / VCC |
| Battery (-) | L298N GND |
| Arduino GND | L298N GND (Common Ground) |
| 5V Output (L298N) | Arduino 5V (Optional) |
ARDUINO CODE
WORKING PRINCIPLE
IR sensors detect black and white surfaces. Black line gives LOW signal and white surface gives HIGH signal. Based on this, the robot moves forward, left, or right.
TIPS
- Adjust IR sensor using potentiometer
- Use black tape for best results
- Keep battery fully charged
Conclusion
This project helps beginners understand sensors, motors, and automation. It is the perfect starting point in robotics.
More projects coming soon 🚀










