Line Follower / Delivery Robot
← Back to ProjectsFunction
Our Line Follower / Delivery Robot is an autonomous mobile robot designed to navigate along a predefined path using infrared (IR) sensors. It follows black tape on a surface and adjusts its movement based on real-time sensor feedback. This project gave us practical experience with embedded systems, sensors, motor control, and microcontroller programming.
Overview
The robot uses:
- IR sensors to detect the black line
- Arduino ESP32 as the main controller
- Two DC motors with motor driver for movement
- Rechargeable battery pack
- Chassis platform with wheels
Its purpose is to simulate small-scale delivery automation — the robot can be programmed to carry small items from one point to another while staying on a guided route.
How It Works
- The IR sensors continuously measure reflected light.
- Black tape absorbs more IR light → lower readings.
- White background reflects more → higher readings.
- The microcontroller compares left/right sensor values.
- It adjusts motor speeds to turn left or right and remain on the track.
This real-time feedback loop allows the robot to follow the path smoothly.
Challenges
The most challenging part of the project was the coding. We wanted the robot to follow a line, and at first we wrote code for each sensor to detect when the robot was not aligned while moving. We used simple if–else statements, but we forgot to use nested if–else structures. Because of that, the robot kept turning in circles or moving back and forth slowly, and the wheels rotated very sluggishly.
We spent about a week trying to fix the issue but couldn’t find the solution on our own. Eventually, we reached out to our professor for help. He suggested using nested conditions so that whenever the robot was misaligned—whether to the left or the right—it would continuously turn in the correct direction until the sensor detected the black line again.
Another difficulty we faced was positioning the IR sensors correctly. If they were placed too low, they constantly detected black, which made the robot behave incorrectly. We had to experiment and find the perfect height where the sensors could detect the line consistently.
Here is the code for the delivery bot:

Then we uploaded the code to our robot and testing at home before presenting in class.
Demo
Home testing robot following a track autonomously.
In class performance: robot following a track autonomously.
What I Learned
Working on this project improved my:
- Understanding of sensor calibration
- Motor speed control and PID logic
- Debugging physical hardware & software
- Team collaboration and testing
This project was a great hands-on introduction to robotics and automation. This is a great integration for warehouses that can speed up cargo handling and save time.