Oooooo

Download as pdf or txt
Download as pdf or txt
You are on page 1of 21

Line Follower Robot

Abstract
Line follower robot is one kind of autonomous robot which follows a line until that line exists. Generally,
the line is drawn on the floor. It can be either black or white. The line can also be normal visible color or
invisible magnetic field or electric field. The robot follows the line by using Infra-Red Ray (IR) sensors.
There are five IR sensors which makes it an IR sensor array. These sensors read the line and send that
reading to Arduino and then control the robot movement. In this paper, the authors will explain about the
robot design, implementation, coding, testing, problems they faced and their solutions.

Keywords:
Line Follower, Arduino Uno R3, Adafruit Motor shield, IR sensor array, DC Power Adapter (9V, 2A)

Dept of CSE,NIT, RAICHUR


Line Follower Robot
2

INTRODUCTION:

Line follower robot is autonomous that means it automatically follows a line which is pre-defined.
Generally, it follows a black line on a white surface or a white line on a black surface. Some of the
basic operation of a line follower is given below: ∙ Reading the pre-defined line by IR sensor array
which is installed on the front-down side of the robot and sends those readings to the Arduino. The
ATMega microcontroller which is built in on Arduino analyzes those readings and do the particular
operations. ∙ The steering mechanism is simple in this robot. Three wheels are used, two wheels are
on the back part connected with the motors and one independent wheel on the frontmiddle part of
the robot. ∙ On Straight line, the speed is fast and on a turn, speed is relatively slow depending on
turn angel. Good motor quality and good sensing quality will increase the robot movement
performance. Line follower robots can be used in many industrial purposes. It can be used
in carrying heavy and risky products. Radioactive products transportation inside a factory
is very much risky for human life. A line follower robot can help in that section. Also in a
hospital, it can monitor patients and inform doctors in critical situations. In the restaurant
business it can also help in many sections such as food servers and order taking jobs can
be easily done by this kind of robot. In this paper, the authors are explaining the robot
architecture, design, coding, implementation and other objectives. Robot structure and
architecture is explained in section 2, Pin diagram and connections in section 3,
programming subject in section 4, solution on robot path is discussed in section 5, future
plans on section 6 and the conclusion in section 7 consequently.

Dept of CSE,NIT, RAICHUR


Line Follower Robot
3

Dept of CSE,NIT, RAICHUR


Line Follower Robot
4

COMPONENETS REQUIRED

SOFTWARE:

1. Arduino IDE

HARDWARE:

1. Arduino UNO
2. IR Reflectance Sensor Array
3. Arduino IDE
4. Adafruit Motor Shield
5. Motors and Wheels
6. Body and the Chassis

Dept of CSE,NIT, RAICHUR


Line Follower Robot
5

SOFTWARE SPECIFICATION

1. ARDUINO IDE:

Arduino is the required software environment to program the Arduino by writing a code and upload
it to the Arduino. It also outputs the results for analysis using both serial monitor and serial plotter.
It is an Arduino software, making code complication too easy. It is available for all operating
systems i.e, Mac, Windows, Linux and runs on the Java Platform that comes with inbuilt functions
and commands that play a vital role in debugging, editing and compiling the code. It is easy to use,
it supports all the Arduino boards, it has a built-in library which is easy to use. The Arduino IDE
is very user-friendly

Dept of CSE,NIT, RAICHUR


Line Follower Robot
6

HARDWARE

2. LINE FOLLOWER ROBOT EQUIPMENT:


This robot is made by several parts:

▪ Arduino Uno R3 and IDE

▪ Digital IR sensor array

▪ Adafruit Motor Shield

▪ DC motors ▪ Chassis board

▪ Power supply (9V/12V DC)

The IR sensor reads the line and sends the analog reading to the Arduino through the analog
pin on Arduino Uno board (A0-A4 pin).On white line analog reading is less than 300 and
on black line analog reading is greater than 600. The minimum analog reading is 0 and
maximum is 1023 (10 bit binary). That reading distinguishes between black and white
colors by which robot senses the line. Arduino board and other devices get power supply
through EXT_PWR pin on Adafruit motor shield by 9V DC battery. If a 12V DC battery
is used, then a 12V to 9V DC power supply converter also will have to be used for the
device's safety

2.1 Digital IR sensor Array

The line follower robot uses a 7 array digital IR sensor array to sense the line. Among them, five
IR sensors are used because there are six analog pins on Arduino. For balancing left and right side
four sensors are used and one middle sensor for line detection. On each IR sensor, there are two
diodes. One of them sends Infra-red rays and another one receives it. If the receiver receives more
reflected light than it is on the white surface and if it receives less reflected light (or doesn't receive
any reflected light) that means it is on the black surface. One IR sensor includes one infrared
transmitter and one receiver. IR sensor array is the combination of five IR reflectance-sensors. The
distance between the surface and the IR sensors array should be less than 5mm and distance
between two IR sensors depends on line width. The sensors work well if it is shielded from ambient

Dept of CSE,NIT, RAICHUR


Line Follower Robot
7

light. The IR sensor array has been set up on the bottom side of the chassis. Those sensors are
giving analog reading to Arduino depending on the IR ray reflectance. For accuracy left two
sensors reading average and right two sensors reading average will decide the movement of the
robot.The width of the line is 15mm. When it will find "T" shape surface, the robot will stop. The
top length of the applied "T" shape is 50mm as the IR reflectance sensor's width. This is able to
move 120mm diameter of the curve in a circle. It will be forwarded to the break point between two
lines is 40mm. If the break point of two lines is larger than 40 mm, it may loss the path.

Fig. 2: IR Reflectance Sensor Array

2.2 Arduino Uno R3:

Arduino Uno R3 is a microcontroller board based on the ATmega328P (datasheet). Ithas 14 digital
input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a 16 MHz quartz
crystal, a USB connection, a power jack, an ICSP header and a reset button. It contains everything
needed to support the microcontroller; by simply connecting it to a computer with a USB cable
one can program it. It supports 5V DC to 12V DC. The safe power supply is 9V DC. Arduino
controls the whole robot actions. The motor shield is placed above it. Motor shield's pins are
connected to Arduino's pins. Arduino IDE is used for writing a program and inserting the code to
the Arduino is done by USB cable which connects Arduino and computer

Dept of CSE,NIT, RAICHUR


Line Follower Robot
8

Dept of CSE,NIT, RAICHUR


Line Follower Robot
9

2.3 Adafruit Motor Shield:

Authors have chosen the Adafruit motor shield because it suits well with Arduino. Moreover, it
has some more quality with classification. There is four connection point for four motors. As
authors used two motors, so among four points two points M1 and M2 are used. The motor shield
also has six analog pins (A0-A5). The IR sensors are connected to Arduino through this analog
pins (A0-A4). Motor speed is controlled through this motor shield. It allows the motor to spin both
clockwise and anti-clockwise. From the EXT_PWR point, external power supply is given by
battery. Arduino send instructions to motor shield and it controls the motors cause's four states.

a. Both motors are on and rotating forward causes forward movement.

b. Right motor is rotating forward and left motor is rotating backward causes a Right turn.

c. Left motor is rotating forward and the Right motor is rotating backward causes Left turn.

d. Both motors are off causes stop point of the robot.

Dept of CSE,NIT, RAICHUR


Line Follower Robot
10

2.4 Motors and Wheels:

Motors are very important part of this robot. Because the movement system is the main part of the
line following. Some most important things are that both motors must be the same kind, speed,
power supply and smooth. So choosing motors are very important as there are so many kinds of
motors available in markets. Here the authors have used 4V DC gear motors. Wheels also have to
be same size and radius. Wheel size effects on the robot speed. Authors are using three wheels.
Among them, two are connected back side of the chassis with motors and one wheel is independent
and connected to the front side of the chassis.

2.5 Body and the Chassis:

Robot body is another important thing. One can use many kinds of chassis but it should be kept in
mind that chassis has to support all devices and also has to be strong. It can be made from glass,
plastic, aluminum or any other lightweight materials. The authors have made car shape line
follower robot. Devices are installed above the chassis and motors and sensors are installed below
the chassis by screws. Nothing is installed permanently by any kind of glue.

Dept of CSE,NIT, RAICHUR


Line Follower Robot
11

ASSEMBLY AND PIN CONNECTION:

The motor shield is placed above the Arduino connecting Arduino with motor shield. The IR
sensor array gets 5V DC power supply from the motor shield's 5V pin, and sensors GND pin
is connected to motor shield's GND pin. Sensors pins are added to shield's analog A0-A4 pins.
External power supply is given through EXT_PWR pin.
Device Motor Shield
Pins
Pins

IR sensor 5V 5V
GND GND
IR1 A0
IR2 A1
IR3 A2
IR4 A3
IR5 A4
SEN D2
Motors Left motor M1 M2
Right motor

Power Supply 9V DC EXT_PWR

Table 1: Pin Specification

Dept of CSE,NIT, RAICHUR


Line Follower Robot
12

Chassis assembly according to pins are given below:

LINE FOLLOWER PATHS:


Line follower robot follows path drawn on the floor. The line will be mainly black on a white
surface. If it occurs any line break on its way, the robot will go forward. If it finds a cross line, the
robot will stop. Lines and robot movements can be changed by using programming code easily.
Some lines are that the robot can follow: The robot will follow a bad angle of 45° and cycle or bad
curves. It will stop when it finds a cross black line. On any kind of Polygon, it can follow the line
and maintain a particular speed. The line may have cycles and unwanted curves that it has to follow
on narrow space or moving one room to another.

FUTURE WORK:
Line following robot based industrial manufacturing process in India can play a vital role in the
field of industry. Using this robot in the government organization and Manufacturer Company,
especially the RMG sectors in India, the cost for the manpower can be reduced. This line following
robot can be used as carrying the load to deliver the goods from one place to another smoothly
without any damage. If any type of goods mishandling occurs then that system can stop its routine
function and call to the system administrator to check the occurred problem to repair. For this
purpose, a GSM module can be used to monitor the production process in real time basis. In real
time basis, the functional work of any industry can be more efficient for supply chain management
so that the industrial sectors of India will take a place in international markets.

Dept of CSE,NIT, RAICHUR


Line Follower Robot
13

APPLICATIONS
Intrusion Detection:
Detects unauthorized entry into restricted areas.
Alerts security personnel or property owners about potential intrusions
Object Avoidance in Robotics:
Enables robots to navigate around obstacles autonomously.
Prevents collisions and ensures safe operation in dynamic environments.
Home Automation:
Notifies homeowners of unexpected obstructions in doorways or pathways.
Integrates with smart home systemsto trigger actionssuch as turning on lights orsounding alarms.
Parking Assistance Systems:
Assists drivers in parking by detecting nearby obstacles or vehicles.
Provides audible alerts to indicate the proximity of obstacles during parking maneuvers
Interactive Installations:
Enhances interactive exhibits in museums, galleries, or public spaces.
Generates audiovisual feedback in response to the presence of visitors or objects
Assistive Technologies:
Aids individuals with visual impairments in navigating their surroundings.
Notifies users of obstacles or hazardsin their path to enhance mobility and safety.
Security Systems:
Integrates with surveillance cameras to trigger alerts when motion is detected.
Enhances perimeter security by detecting intruders attempting to breach fences or barriers
Automatic Door Control:
Activates automatic doors upon detecting approaching individuals.
Improves accessibility and convenience in public buildings or facilities.

Dept of CSE,NIT, RAICHUR


Line Follower Robot
14

CIRCUIT DIAGRAM AND WORKING

L293D Motor shield to be mounted on UNO R3.


Power the UNO R3 using the 4cell AA battery holder
Provide the connection as per the circuit diagram or watch the
video for complete instructions.
Install AFMotor.zip library
Upload the code to UNO R3 board.
Tune the IR sensors and place in the black line and see it follow

Dept of CSE,NIT, RAICHUR


Line Follower Robot
15

4. SOURCE CODE:
Arduino microcontroller has its own IDE for coding. It supports C as a programming language.
Arduino IDE has its own facility to connect Arduino to computer via USB cable and passes enough
current and code through it. As the authors used Adafruit motor shield, there is a library for that
motor shield. This library supports motor control functions. The main functional process is given
below:
#include //Adafruit Motor Shield Library
AF_DCMotor motor1(1, MOTOR12_8KHZ ); //create motor #1 using M1 output on Motor Drive Shield, set
to 8kHz PWM frequency AF_DCMotor motor2(2, MOTOR12_8KHZ ); //create motor #2 using M2 output
on Motor Drive Shield, set to 8kHz PWM frequency

void setup()
{
delay(1000);
pinMode(A0,INPUT);
pinMode(A1,INPUT);
pinMode(A2,INPUT);
pinMode(A3,INPUT);
pinMode(A4,INPUT);
analogWrite(2,255);
}
int sp=85; // setting motor speed
void loop()
{
int l,r,t=100; //300 is the value that distinguish between black and white
int left;
int right;
int middle;
l=analogRead(A0)+analogRead(A1);
r=analogRead(A3)+analogRead(A4);
middle=analogRead(A2);
left=l/2;
right=r/2;

Dept of CSE,NIT, RAICHUR


Line Follower Robot
16

if(leftif(left<t && right<t) //move forward


{
motor1.setSpeed(sp);
motor2.setSpeed(sp);
motor1.run(FORWARD);
motor2.run(FORWARD);
l=analogRead(A0)+analogRead(A1);
r=analogRead(A3)+analogRead(A4);
left=l/2;
right=r/2;
}
else if(left<t && right>t) //turn right
{
while(left<t && right>t)
{
motor1.setSpeed(sp);
lOMoARcPSD|27621661
motor2.setSpeed(sp);
motor1.run(BACKWARD);
motor2.run(FORWARD);
l=analogRead(A0)+analogRead(A1);
r=analogRead(A3)+analogRead(A4);
left=l/2;
right=r/2;
}
}
else if(left>t && right<t) //turn left
{
while(left>t && right<t)
{

Dept of CSE,NIT, RAICHUR


Line Follower Robot
17

motor1.setSpeed(sp);
motor2.setSpeed(sp);
motor1.run(FORWARD);
motor2.run(BACKWARD);
l=analogRead(A0)+analogRead(A1);
r=analogRead(A3)+analogRead(A4);
left=l/2;
right=r/2; }}
else if(left>t && right>t && middle>t) //stop
{
while(left>t && right>t && middle>t)
{
motor1.run(RELEASE);
motor2.run(RELEASE);

Dept of CSE,NIT, RAICHUR


Line Follower Robot
18

8.RESULTS

Dept of CSE,NIT, RAICHUR


Line Follower Robot
19

Dept of CSE,NIT, RAICHUR


Line Follower Robot
20

7. CONCLUSION:
Robotics has a significant role in global economy and everyday life. Another concern of robotics
research is to be competitive and design patents for global industries according to their nature of
applications. The demand of robotics technology is expanding in wide range of applications and
human activities, especially for manufacturing, medical, service, defense, and consumer industries.
The Designed robot has five IR sensors, Arduino microcontroller board, and Adafruit motor shield.
Arduino mainly controls the robot to follow the line. This line follower robot is the prototype of
robots for industrial use. By studying this one can build line follower robot for industrial use.
Performance can be improved by using good materials and great sensing power also improves
motor movement. The setup cost of line follower robot majorly depends upon the expensive
machinery, land, and building and round the clock staff to maintain and use that machinery. In
India where the population is humongous and resources are scarce.
So, it becomes really difficult to set up such a capital extensive project without any financial
supports from private sectors. Skilled staffs are also necessary for that. This is alternate to the
existing system by replacing skilled labor with robotic machinery. This robot will be able to handle
more goods in a manufacturing process in less time with better accuracy as well as lower per
capital cost.

REFERENCES:

Dept of CSE,NIT, RAICHUR


Line Follower Robot
21

[1] https://playground.arduino.cc/Main/AdafruitMotorShield
[2] http://www.buildtronix.com/arduino-uno-evelopment-board-with-atmega328.html
[3] International Journal of Advanced Research in Computer Engineering & Technology
(IJARCET) Volume 2, Issue 8, August 2013 ISSN: 2278 – 1323
[4] https://www.slideshare.net/rehnazrazvi/line-following-robot-16014541
[5] Miller Peter, “Building a Two Wheeled Balancing Robot”, University of Southern Queensland,
Faculty of Engineering and Surveying. Retrieved Nov 18, 2008.
[6] Datasheets of microcontroller AT89C51, LDR sensor, IR proximity sensor, Motor driver
L293D, Comparator, 16*2 LCD, Available: http://www.alldatasheet.com
[7] M. Zafri Baharuddin, Izham Z. Abidin, S. Sulaiman Kaja Mohideen, Yap Keem Siah, Jeffrey
Tan Too Chuan,"Analysis of Line Sensor Configuration for the Advanced Line Follower
Robot",University Tenaga Nasional.
[8] http://www.roboticsbible.com/simple-line-following-robot.html
[9] Nor Maniha Abdul Ghani, Faradila Naim, Tan Piow Yon, “Two Wheels Balancing Robot with
Line Following Capability,” World Academy of Science, Engineering and Technology, pp-634-
638, 2011.
[10] Author:-Jacob Millman, Christos Halkias, Chetan D Parikh, Publisher-McGraw

Dept of CSE,NIT, RAICHUR

You might also like