Professional Documents
Culture Documents
Line Following Robot Full Report
Line Following Robot Full Report
Faculty of Engineering
Name: Perera P N D
EN Number: EN20401412
Date of Performance:
Date of Submission: 27-06-2021
1. Snapshots of finished Prototype
LED Panel
IR panel
Figure 6 Components
Switch
Battery Pack
IR
Figure 7 Components
Buck Converter
(Voltage step down
unit)
Figure 8 Components
2. List of components
Component Specifications
Arduino MEGA Arduino MEGA 2560 is the microcontroller
which I have used for the line following robot.
It’s a 10-bit microcontroller which can be power
up using 7v-12v. It’s a programmable unit
where we put all the commands of the robot.
L293D Motor shield L293D is motor shield which is used to control
the motors using the commands according to the
Arduino MEGA. L298N does the same thing.
L298N model has H bridge switches.
18650 Li-ion Battery To control all these components, we need a
power source. We can use rechargeable Li-Ion
batteries. Here I used 4, 3.7v Li-Ion 18650
batteries.
4 gear motors We can use dc motors but using a gear motor
gives the vehicle more torque than using the dc
motor.
4 wheel car chassis We need a chassis to carry the components. It’s
where we assemble the Arduino board and
shield or the driver 4 motors and the batteries.
4 wheels 4 wheels are used to move the robot. Wheels are
rotating using the gear motors.
switch Switch is used to turn On and Off the Arduino
board and shield. (Arduino board and the shield
is powered separately)
8Channel IR 8 TCRT5000 IR sensors assembled as a line of
IR. This IR is used to identify the robot’s path.
IR gives the reflection value and according to
that value robot finds his path to follow.
Buck converter (Optional) It’s a step-down voltage controller. When we
supply it 12V voltage it can reduce the voltage
to 7-3V. For the safety of Arduino mega board I
used a 12v to 5 v step down voltage controller
4LEDs 4 LEDs are used to indicate a junctions
IR sensor (Optional) Another IR is used to avoid accidents
Jumpers Jumper wires are used to connect the
components and to complete the circuit.
Battery casing Battery casing is used to hold the batteries.
Nuts and bolts Nuts and bolts are used to assemble the chassis
and the components to the chassis
//defining motors
AF_DCMotor M1(1);//rear left
AF_DCMotor M3(3);// front right
AF_DCMotor M2(2);// front left
AF_DCMotor M4(4);//rear right
Straight line
// turn right
//left
if ((digitalRead(ir0) == 1) && (digitalRead(ir1) == 0) &&
(digitalRead(ir2) == 0) &&
(digitalRead(ir3) == 0) && (digitalRead(ir4) == 0) && (digitalRead(ir5)
== 0) &&
(digitalRead(ir6) == 0) && (digitalRead(ir7) ==
0)){left();return(0);}// ir 0
First, I bought all the components need for the line following robot. I used QTR 8 Array IR panel.
Although it has libraries auto calibration and many more functions it did not meet the requirements I
need. Then I used 3 single IRs for the references I used YouTube videos. It also did not work for me.
Then I used Aptinex Reykha S8 IR panel which has 8 TCRT500 IRs. It was fine but for the analog
reads I could not give the command robot to move. Maybe it’s because of the light condition where I
have tested my robot. Then I used digital reads value either 1 or 0 it works very fine. Only hard thing I
found was calibrating the IR panel manually. My first IR panel broke while I was trying to calibrate.
Then I used a potential meter (10k variable resistor) externally to calibrate. Unless I have to remove
all the nuts and bolts to calibrate the IR panel. After doing so many changes to the code I found
something work better than the previously uploaded codes. Then I found another issue on my wheels.
When the robot is trying to turn its wheels are getting slipped. Then I realized it is because of
unplanned weight distribution. I corrected it but it did not work perfectly but it’s fair. The very first
code I used is if 3 and 4 detect go forward 0, 1, 2 detects turn left, if 5, 6, 7 detects turn right. It
worked but there were some issues. What is 2, 3, 4 detects? what if 3, 4, 5 detects? likewise there
were some confusion points. Then I used permutations and combinations knowledge to get all the
possible inputs. Then I was able to make kind of lengthy but working code. Another issue I met is
robot is too fast to identify the junction. It detects junctions and passes the junction go straight
forward. Reacting time was not sufficient to take a decision to the robot. Then I used different speeds
for different commands. Then I was able to find a better speed for the robot after doing so many test
runs. Now it runs on the black line it detects junctions. And unfortunately, my chassis was broken
during a repair on the place I have circled in red. I used glue and 2 pieces of acrylic boards to fix it.
But wheels started to slip more than before. Anyhow it performs well. It needs a support when it
needs to turn, because of the slipping. Only issue right now is the wheels are slipping. It can be seen
in the video. It was trying to turn but the unbalance of the wheels does not let it turn. Overall, the
project is successful. Robot turns go forward and act to every command. Throughout this project I
have learnt lot of things. Arduino coding, planning, how to face problems occurs while doing the
project and working on time. It was a great experience.