Line-following delivery robot for labs and hospitals
Hospitals and labs move small items between rooms many times a day. A robot that follows a taped path and stops at named stations shows the basics of warehouse automation.
- Parts
- ₹2,190
- Build
- 12 weeks
- Board
- Arduino Uno
- Objectives
- 6
Block diagram
- IR line sensorsSee the path
- Ultrasonic sensorStops before obstacles
- RFID station tagsMark the stations
- Arduino UnoSteers with PID
- PID controllerKeeps the output at the set value+
- 2S Li-ion pack7.4 V for motors and board
- L298N and motorsDrive the wheels
- Phone appShows readings and sends commands over Bluetooth+
Objectives
- To follow a taped path at a steady speed with PID steering.
- To stop at a chosen station read from an RFID tag under the path.
- To stop before an obstacle within 20 cm and resume when it clears.
- To measure lap time and path error at three speeds.
- To implement and tune a PID controller and compare its response with on/off control.
- To monitor and control the system from a phone over Bluetooth.
Parts and specifications
- Arduino Uno R3 (CH340 clone)ATmega328P 16 MHz, 32 KB flash, 2 KB SRAM, 5 V logic, 6 analog inputs (10-bit), 6 PWM pins₹450Buy
- TCRT5000 IR line sensorReflective sensor, best at 2 to 10 mm above the floor, digital and analog out₹250Buy
- HC-SR04 ultrasonic sensor2 cm to 4 m, 15° beam, 40 kHz, 10 µs trigger, echo pulse 58 µs per cm, 5 V₹80Buy
- RC522 RFID reader with card and tag13.56 MHz MIFARE, reads up to about 5 cm, SPI up to 10 Mbit/s, 3.3 V only₹180Buy
Total about ₹2,190 at typical online prices. Tap a part for its pinout and datasheet notes.
Design calculations
Weighted average: position = Σ(wi × si) / Σsi with weights −2, −1, 0, 1, 2. Sensors 3 and 4 on gives (0 + 1) / 2 = +0.5.
Correction = Kp × e + Ki × Σe + Kd × Δe. Start Kp = 40, Kd = 15, Ki = 0; left = base + correction, right = base − correction (PWM 0 to 255).
7.4 V pack minus about 2 V L298N drop leaves about 5.4 V for 6 V BO motors.
100 RPM × π × 65 mm wheel = 0.34 m/s at full voltage.
Pin map
| Signal | Pin or connection |
|---|---|
| Line sensors S1 to S5 | A0 to A3 and D2 |
| L298N ENA / IN1 / IN2 | D5 (PWM) / D7 / D8 |
| L298N ENB / IN3 / IN4 | D6 (PWM) / D9 / D10 |
| HC-SR04 TRIG / ECHO | D3 / D4 |
| RC522 SPI | D11 / D12 / D13, SS A4, RST A5 (3.3 V) |
Firmware outline
- Calibrate sensors over black and white at start.
- Every 5 ms compute line position and PID correction.
- Set both motor PWMs, clamped to 0 to 255.
- If ultrasonic distance < 20 cm, stop until clear.
- When an RFID tag under the path matches the target station, stop and wait for a button press.
- If all sensors are white for 300 ms, stop (line lost).
Test plan
| Test | Expected result |
|---|---|
| Oval track, three speeds | Lap time and largest error |
| Obstacle placed on the path | Stops before 20 cm, resumes |
| Target station 2 | Stops at station 2 only |
| Line lost | Stops within 300 ms |
These rows start your results table when you plan the project.
Viva practice
Say your answer out loud first, then check. The first 2 answers are free; Maker opens all 5.
Make it yours
One or two upgrades for a mini project, two to four for a major one.
Build these first
Datasheets and sources to cite
- STMicroelectronics L298 datasheet
- Vishay TCRT5000 datasheet
- Åström and Murray, Feedback Systems (PID tuning)
About this project
How much does the line-following delivery robot for labs and hospitals project cost?
About ₹2,190 for the parts in the base list: Arduino Uno R3 (CH340 clone), TCRT5000 IR line sensor × 5, L298N motor driver, 2WD robot chassis kit, HC-SR04 ultrasonic sensor, RC522 RFID reader with card and tag, 18650 cell 2600 mAh (branded) × 2, 18650 holder 2S, 2S BMS 10 A.
How long does it take?
About 8 weeks for the base project, built on an Arduino Uno. Each upgrade adds time.
Which branches is it suitable for?
Electronics and Communication, Electrical and Electronics, Mechanical / Mechatronics, Diploma (any electronics branch), as a mini or major project.
Which pins and design calculations does it use?
Line sensors S1 to S5 on A0 to A3 and D2; L298N ENA / IN1 / IN2 on D5 (PWM) / D7 / D8; L298N ENB / IN3 / IN4 on D6 (PWM) / D9 / D10. Worked calculations on this page: line position, pid steering, motor voltage, speed.
How do I test it?
Oval track, three speeds: Lap time and largest error. Obstacle placed on the path: Stops before 20 cm, resumes. Target station 2: Stops at station 2 only. Line lost: Stops within 300 ms.
What are the objectives?
To follow a taped path at a steady speed with PID steering. To stop at a chosen station read from an RFID tag under the path. To stop before an obstacle within 20 cm and resume when it clears. To measure lap time and path error at three speeds.
