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.

Arduino UnoMini or Major projectECE, EEE, MECH, Diploma
UNOIRRFID102 cmFeatured
Parts
₹2,190
Build
12 weeks
Board
Arduino Uno
Objectives
6

Block diagram

Inputs
  • IR
    IR line sensorsSee the path
  • Ultrasonic sensorStops before obstacles
  • RFID
    RFID station tagsMark the stations
Controller
  • UNO
    Arduino UnoSteers with PID
  • PID
    PID controllerKeeps the output at the set value+
Power
  • +
    2S Li-ion pack7.4 V for motors and board
Outputs
  • L298N and motorsDrive the wheels
  • PHONE
    Phone appShows readings and sends commands over Bluetooth+

Objectives

  1. To follow a taped path at a steady speed with PID steering.
  2. To stop at a chosen station read from an RFID tag under the path.
  3. To stop before an obstacle within 20 cm and resume when it clears.
  4. To measure lap time and path error at three speeds.
  5. To implement and tune a PID controller and compare its response with on/off control.
  6. To monitor and control the system from a phone over Bluetooth.

Parts and specifications

Total about ₹2,190 at typical online prices. Tap a part for its pinout and datasheet notes.

Design calculations

Line position

Weighted average: position = Σ(wi × si) / Σsi with weights −2, −1, 0, 1, 2. Sensors 3 and 4 on gives (0 + 1) / 2 = +0.5.

PID steering

Correction = Kp × e + Ki × Σe + Kd × Δe. Start Kp = 40, Kd = 15, Ki = 0; left = base + correction, right = base − correction (PWM 0 to 255).

Motor voltage

7.4 V pack minus about 2 V L298N drop leaves about 5.4 V for 6 V BO motors.

Speed

100 RPM × π × 65 mm wheel = 0.34 m/s at full voltage.

Pin map

SignalPin or connection
Line sensors S1 to S5A0 to A3 and D2
L298N ENA / IN1 / IN2D5 (PWM) / D7 / D8
L298N ENB / IN3 / IN4D6 (PWM) / D9 / D10
HC-SR04 TRIG / ECHOD3 / D4
RC522 SPID11 / D12 / D13, SS A4, RST A5 (3.3 V)

Firmware outline

  1. Calibrate sensors over black and white at start.
  2. Every 5 ms compute line position and PID correction.
  3. Set both motor PWMs, clamped to 0 to 255.
  4. If ultrasonic distance < 20 cm, stop until clear.
  5. When an RFID tag under the path matches the target station, stop and wait for a button press.
  6. If all sensors are white for 300 ms, stop (line lost).

Test plan

TestExpected result
Oval track, three speedsLap time and largest error
Obstacle placed on the pathStops before 20 cm, resumes
Target station 2Stops at station 2 only
Line lostStops 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.

1. What does each PID term do?
2. Why does the L298N waste power?
3. How do IR line sensors work?
4. How do you tune PID?
5. How would a real hospital robot navigate?

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.