5K9 Line Follower Using DC Motor
5K9 Line Follower Using DC Motor
5K9 Line Follower Using DC Motor
ELECTRONICS ENGINEERING
MICRO PROJECT
A Micro Project on
Submitted by
B. Rahul - 23R01A05K8
B. Taraka Ramachandra - 23R01A05K9
Shaik Sohail - 23R01A05Q7
Tharak Patel - 23R01A05R1
P. RAJASHEKHAR
(Associate Professor, CSE Department)
CMR INSTITUTE OF TECHNOLOGY
(UGC AUITONOMOUS)
(Approved by AICTE, Affiliated to JNTU, Kukatpally, Hyderabad)
Kandlakoya, Medchal Road, Hyderabad
CMR INSTITUTE OF TECHNOLOGY
(UGC AUTONOMOUS)
(Approved by AICTE, Affiliated to JNTU, Kukatpally, Hyderabad)
(Kandlakoya, Medchal Road, Hyderabad)
CERTIFICATE
This is to certify that a Micro project entitled with: “Designing a Line Follower using DC Motor” is being
Submitted by
B. Rahul - 23R01A05K8
B. Taraka Ramachandra - 23R01A05K9
Shaik Sohail - 23R01A05Q7
T. Tharak Patel - 23R01A05R1
In partial fulfillment of the requirement for award of the ‘Basic Electrical and Electronics Engineering’
of I-B.Tech I-Semester in Freshman Engineering towards a record of a bonafide work carried out under
We are extremely grateful to Dr. M. Janga Reddy, Director, Dr. B. Satyanarayana, Principal and Mr.
Technology for their inspiration and valuable guidance during entire duration.
We are extremely thankful to our in-charge of Basic Electrical and Electronics Engineering, Dr. P.
Rajashekhar, Freshman Engineering Department, CMR Institute of Technology for his constant guidance,
We express our thanks to all staff members and friends for all the help and coordination extended in
Finally, we are very much thankful to our parents and relatives who guided directly or indirectly for
In industries, giant line follower robots are used for assisting the automated production process. They are
also used in military applications, human assistance purposes, delivery services, etc.
The concept of the line follower robot is related to light. Here, we use the behaviour of light on the black
and white surface. The white colour reflects all the light that falls on it, whereas the black colour absorbs the
light.
In this line follower robot, we use IR transmitters and receivers (photodiodes). They are used to send and
receive the lights. When IR rays fall on a white surface, it is reflected towards IR receiver, generating some
voltage changes.
When IR rays fall on a black surface, it is absorbed by the black surface, and no rays are reflected; thus, the
In this project, when the IR sensor senses a white surface, an Arduino gets 1 ( HIGH ) as input, and when it
senses a black line, an Arduino gets 0 ( LOW ) as input. Based on these inputs, an Arduino Uno provides the
Arduino Uno
IR sensor
BO motor
Wheels
Lithium-ion battery
Jumper cables
Robot Chassis
About Components
ARDUINO UNO
Arduino Uno is an 8-bit ATmega328P microcontroller. To support the microcontroller, it uses the
components such as crystal oscillator, serial communication, voltage regulator, etc. It has 14 digital I/O pins
( 6 pins can be used as PWM pins). It has six separate analog input pins, a USB connection, a Power barrel
This board is programmable with the Arduino IDE (Integrated Development Environment) platform via a
INFRARED SENSOR
An infrared sensor emits the light to detect some surroundings. In the infrared spectrum, all the objects
Radiate some form of thermal radiation that is invisible to our eyes, but an IR sensor can detect these
radiations.
Here, IR LED is an emitter, and the IR photodiode is a detector. An IR LED emits the IR light, and the
photodiode is sensitive to this IR light. When IR light falls on the photodiode, the output voltages and the
The Infrared detection system uses the five essential elements: an infrared source, a transmission medium, optical
component, infrared detectors, and signal processing. An infrared transmission can be done through the vacuum,
L298N is one of the easiest and chipset way to control DC motors. It is the two-channel motor driver that
This L298N Motor Driver is a high-power motor driver module. It is used for driving DC and Stepper
Motors. This motor driver consists of an L298N motor driver IC and a 78M05 5V voltage regulator,
When the jumper is placed, it enables the 78M05 Voltage regulator. When the power supply is less than or
equal to 12V, the voltage regulator will power on the internal circuitry. When the power supply is more than
12v, then the jumper should not place and should give a separate 5v to power the internal circuitry.
Here, ENA & ENB pins are speed control pins for Motor A, and Motor B. IN1& IN2 and IN3 & IN4 are
BO MOTORS
BO Motor is known as Battery Operated motor. These motors are commonly used in hobby-grade projects where
BO series linear motor provides good torque and rpm at lower operating voltages. The BO motors are available in
single Shaft, Dual Shaft, and DC Plastic Gear BO. These motors consume low current. In this project, we have
Fig. 4 BO Motors
LITHIUM-ION BATTERY
A lithium-ion battery is a rechargeable battery. It is commonly used in portable devices such as mobiles,
laptops, electronics, and electric vehicles. Also, they are growing in popularity for military
CHASSIS
Another place where you should not compromise is with your robot’s chassis. You can use cardboard,
wood, plastic anything that you are good with line following robot. But, just make sure the chassis is
sturdy and should not wiggle when the robot is trying to run. I have designed my own chassis with
cardboard.
Fig. 6 Chassis
APPLICATIONS OF ARDUINO LINE FOLLOWER ROBOT
Line following robots are in use for automation processes in industries, military applications, etc.
They are very useful as they can work without any supervision i.e. they work as automatic guided vehicles.
With additional features like obstacle avoidance and other security measures, line follower robots can be
Building an Arduino line following robot offers numerous advantages. Firstly, it provides a hands-on
learning experience in robotics and programming and problem-solving skills. Secondly, it introduces the
concept of sensor-based navigation, allowing the robot to autonomously follow lines with high
precision. The versatility of Arduino allows for customization and expansion, enabling the robot to
perform additional tasks beyond line following, such as obstacle avoidance or object detection.
CONNECTION DIAGRAM
Here, we have used four BO motors. Motors 1 & 2 are connected to the first channel of L298N, whereas
motors 3 & 4 are connected to the second channel of the motor driver.
IN1, IN2, IN3, and IN4 pins are connected to pin 9, 6, 5, 3 of Arduino Uno. Here, we have used the jumper
between +5V and enables pins (EN1 &EN2). You can remove it and make the external connection, as
shown in the below image.
int mot1=9;
int mot2=6;
int mot3=5;
int mot4=3;
int left=13;
int right=12;
int Left=0;
int Right=0;
pinMode(mot1,OUTPUT);
pinMode(mot2,OUTPUT);
pinMode(mot3,OUTPUT);
pinMode(mot4,OUTPUT);
pinMode(left,INPUT);
pinMode(right,INPUT);
digitalWrite(left,HIGH);
digitalWrite(right,HIGH);
}
void loop()
{
analogWrite(mot1,255);
analogWrite(mot2,0);
analogWrite(mot3,255);
analogWrite(mot4,0);
while(1)
{
Left=digitalRead(left);
Right=digitalRead(right);
if((Left==0 && Right==1)==1)
LEFT();
else if((Right==0 && Left==1)==1)
RIGHT();
}
}
void LEFT (void)
{
analogWrite(mot3,0);
analogWrite(mot4,30);
while(Left==0)
{
Left=digitalRead(left);
Right=digitalRead(right);
if(Right==0)
{
int lprev=Left;
int rprev=Right;
STOP();
while(((lprev==Left)&&(rprev==Right))==1)
{
Left=digitalRead(left);
Right=digitalRead(right);
}
}
analogWrite(mot1,255);
analogWrite(mot2,0);
}
analogWrite(mot3,255);
analogWrite(mot4,0);
}
void RIGHT (void)
{
analogWrite(mot1,0);
analogWrite(mot2,30);
while(Right==0)
{
Left=digitalRead(left);
Right=digitalRead(right);
if(Left==0)
{
int lprev=Left;
int rprev=Right;
STOP();
while(((lprev==Left)&&(rprev==Right))==1)
{
Left=digitalRead(left);
Right=digitalRead(right);
}
}
analogWrite(mot3,255);
analogWrite(mot4,0);
}
analogWrite(mot1,255);
analogWrite(mot2,0);
}
void STOP (void)
{
analogWrite(mot1,0);
analogWrite(mot2,0);
analogWrite(mot3,0);
analogWrite(mot4,0);
}
CONCLUSION
In conclusion, the Arduino line following robot offers an exciting opportunity to the world of robotics.
With its versatile capabilities and simple programming, it provides an excellent platform for learning and
experimentation. By mastering the art of line following, you can develop valuable skills in sensor
integration, motor control, and algorithm design. Whether you’re a hobbyist or an engineer, building an
Arduino line following robot opens doors to endless possibilities and sparks creativity in the field of
robotics.
RESULT: