LineMaster Pro: A Low-Cost Intelligent Line Following Robot with PID Control and Ultrasonic Obstacle Avoidance for Educational Robotics
Authors: Jeni Shahi, Abhishek Shah, A. S. M. Ahsanul Sarkar Akib
Organizations: Department of Nursing (BSc), University of Nicosia, Nicosia, Cyprus · Central Department of Social Work, Tribhuvan University, Kathmandu, Nepal · Department of Robotics, Robo Tech Valley, Dhaka, Bangladesh
Line following robots are fundamental platforms in robotics education, yet commercially available solutions remain prohibitively expensive (150−300) while lacking integrated obstacle detection capabilities essential for real-world applications. This paper presents LineMaster Pro, an intelligent low-cost line following robot implemented on an Arduino Nano platform that integrates dual TCRT5000 infrared sensors for precision line tracking, an HC-SR04 ultrasonic sensor for real-time obstacle detection, a digitally tuned PID controller with Ziegler-Nichols optimization, and a hierarchical finite state machine for robust obstacle avoidance. A systematic four-phase sensor calibration methodology ensures reliable operation across varying lighting and surface conditions. Experimental validation through 200 controlled trials and 72-hour continuous operation demonstrates mean tracking accuracy of 1.18 cm at 0.4 m/s (95% CI [1.06, 1.30]), obstacle detection reliability of 96.7% within 10-40 cm range with 0.7% false positive rate, and 94% successful recovery from path deviations. The PID implementation achieves 43% improvement over conventional on-off control (p<0.001). At a total hardware cost of $28.50 based on verified Bangladesh market prices, LineMaster Pro achieves a 94% cost reduction compared to commercial alternatives, establishing a practical benchmark for accessible robotics education in resource-constrained environments.
Figures & tables
Comparative Analysis of Line Following Robot Systems
No.
Study
Sensors
Obstacle Avoid
Control
Error (cm)
Cost ($)
1
Balaji et al. [ 4 ]
2 IR
No
On-Off
3.2
35
2
Patel et al. [ 18 ]
2 IR+US
Yes
On-Off
2.8
40
3
Rakhmat et al. [ 10 ]
5 IR+US
Yes
PID-ZN
1.3
65
4
Minaya et al. [ 20 ]
8 IR+Cam
Yes
Neural Net
0.9
220
5
PlatROB [ 22 ]
Config.
Optional
PID/ROS
N/A
129-341
TABLE I : Comparative Analysis of Line Following Robot Systems
Fig. 1 : LineMaster Pro prototype showing sensor placement and component layout.
Fig. 2 : Robot following a black line during experimental validation.
Hardware Bill of Materials
No.
Component
Specifications
Qty
Unit (BDT)
Total (BDT)
USD
1
Arduino Nano clone
ATmega328P, 16 MHz, 32 KB Flash
1
420
420
3.50
2
TCRT5000 IR Sensor
940nm, 1-25mm range, analog output
2
120
240
2.00
3
HC-SR04 Ultrasonic
2-400cm range, 3mm accuracy, 40kHz
1
300
300
2.50
4
L298N Motor Driver
Dual H-bridge, 2A per channel, 5-35V
1
360
360
3.00
5
DC Motors (300 RPM)
12V, 300mA no-load, 1.2A stall
2
300
600
5.00
TABLE II : Hardware Bill of Materials
Fig. 3 : Block diagram of electrical connections.
Fig. 4 : Hierarchical finite state machine for obstacle detection and avoidance.
Tracking Error Analysis at Base Speed 150
No.
Control Type
Mean (cm)
Std Dev (cm)
Min (cm)
Max (cm)
95% CI
1
On-Off Control
2.08
0.52
1.2
3.5
[1.94, 2.22]
2
PID Control
1.18
0.34
0.6
2.2
[1.06, 1.30]
Improvement
43.3%
34.6%
p < 0.001
TABLE III : Tracking Error Analysis at Base Speed 150 (0.4 m/s, n=50 per condition)
Fig. 5 : Comparative tracking performance of PID vs. on-off control on curved track sections.
Performance Metrics Across Operating Speeds
No.
Base PWM
Speed (m/s)
Mean (cm)
Std Dev (cm)
Max (cm)
RMSE (cm)
1
100
0.25
0.80
0.27
1.5
0.89
2
125
0.32
0.96
0.30
1.8
1.05
3
150
0.40
1.18
0.34
2.2
1.28
4
175
0.47
1.52
0.41
2.9
1.65
5
200
0.55
1.89
0.49
3.7
2.04
TABLE IV : Performance Metrics Across Operating Speeds (n=40 per setting)
Obstacle Detection Performance
No.
Distance (cm)
Detection (%)
False Pos (%)
Response (ms)
95% CI (ms)
Samples
1
10
99.2
0.3
45
[44.2, 45.8]
25
2
20
98.5
0.4
48
[47.1, 48.9]
25
3
30
95.7
0.8
52
[51.0, 53.0]
25
4
40
89.6
1.4
58
[56.8, 59.2]
25
Overall
96.7
0.7
51
TABLE V : Obstacle Detection Performance by Distance (n=25 per distance)
Finite State Machine Performance Metrics
No.
Metric
Mean (s)
Std Dev (s)
Success (%)
95% CI (s)
Trials
1
Detect to avoid
1.2
0.15
100
[1.16, 1.24]
50
2
Avoid completion
3.1
0.3
98
[3.02, 3.18]
50
3
Line reacquisition
2.8
0.5
96
[2.66, 2.94]
50
4
Recovery from loss
3.5
0.8
94
[3.28, 3.72]
50
TABLE VI : Finite State Machine Performance Metrics (n=50)
Power Consumption Across Operating States
No.
Operating Mode
Current (mA)
Power (W)
Duty (%)
Weighted (mA)
Note
1
Following (straight)
380
1.90
60
228
2
Following (curves)
450
2.25
25
112.5
3
Obstacle avoidance
520
2.60
8
41.6
4
Search/rotation
480
2.40
5
24
5
Idle
85
0.425
2
1.7
TABLE VII : Power Consumption Across Operating States
Performance Benchmarking
No.
System
Error (cm)
Obstacle Avoid
Control
Cost ($)
Ref
1
Balaji et al.
3.2
No
On-Off
35
[ 4 ]
2
Patel et al.
2.8
Yes
On-Off
40
[ 18 ]
3
Rakhmat et al.
1.3
Yes
PID-ZN
65
[ 10 ]
4
Minaya et al.
0.9
Yes
Neural
220
[ 20 ]
5
Sharma et al.
6-10
No
On-Off
30
[ 7 ]
TABLE VIII : Performance Benchmarking Against Prior Works
Department of Electronics and Communication Engineering Krishna Institute of Engineering & Technology (KIET), Ghaziabad, Delhi-NCR, Uttar Pradesh, India.