A Report of Mini Project Line Following Robot Car Using Ardino
A Report of Mini Project Line Following Robot Car Using Ardino
A Report of Mini Project Line Following Robot Car Using Ardino
1
Abstract:
The line follower robot is a mobile machine that can detect and follow the line drawn on the
floor. Generally, the path is predefined and can be either visible like a black line on a white
surface with a high contrasted color or it can be invisible like a magnetic field. Therefore, this
kind of robot should sense the line with its Infrared Ray (IR) sensors that installed under the
robot. After that, the data is transmitted to the processor by specific transition buses. Hence, the
processor is going to decide the proper commands and then it sends them to the driver shield and
thus the path will be followed by the line follower robot.
2
Table of Contents
1.1 Objective 4
1.2 Introduction 4
1.6 Applications 7
1.7 Limitations 7
1.8 Code 7
1.9 Conclusion 9
3
1.1 Objective:
In this mini project, we will design a simple Line Follower Robot car using Arduino and
some other components.
1.2 Introduction:
A line follower robot car is a robot car which follows a certain path controlled by a
feedback mechanism. This robot car has TWO IR sensors installed under the front part of
the body, and two DC motors connected through shield driver. A circuit inside takes an
input signal from two sensors and controls the speed of wheel rotation. A basic line
follower robot car follows certain path and the motion of the robot along the path is
controlled by controlling the rotation of wheels. The control circuitry involves the use of
sensors to sense the path and the microcontroller (Arduino) to control the motor operation
through the motor shield driver, based on the sensor output.
Controller (Arduino UNO): Arduino UNO is the main controller in the project. The
data from the sensors (IR Sensors) will be given to Arduino and it gives corresponding
signals to the Motor Driver IC.
Motor Shield (L293D): L293D is a Motor Driver IC used to control motors with a
microcontroller. This motor shield consists of three ICs. We can control 4 motors with
4
this shield. The motor shield is used for Arduino UNO board. The best thing about the
shield is we don’t need to write the whole function for driving a motor there is special
library for this module. We just recall some command to run the motors.
DC Motors: A DC motor must not connect directly to the Arduino pin because it can burn
your Arduino so we must use transistor or in our case we use shield between Arduino and
motor. By using motor shield we can control speed and as well as direction of the motor.
5
Sensors (IR Sensor): We have used Two IR Sensors as the line detecting sensor for the
project that are mounted on left and right side of car. It consists of an IR LED and a Photo
diode and some other components like comparator, LED etc.
6
Motor
Sensors Arduino Motors
Shield
1.6 Applications:
1.7 Limitations:
1.8 Code:
////////////////////////////////////////////////////////
// LinoBot v1.0 //
// By Asad,Asad Medhi,Haris //
7
////////////////////////////////////////////////////////
//defining motors
AF_DCMotor motor1(4, MOTOR12_8KHZ);
AF_DCMotor motor2(3, MOTOR12_8KHZ);
/*
AF_DCMotor motor1(3, MOTOR12_8KHZ);
AF_DCMotor motor2(4, MOTOR12_8KHZ);
*/
void setup() {
//setting the speed of motors
motor1.setSpeed(100);
motor2.setSpeed(100);
//declaring pin types
pinMode(lefts,INPUT);
pinMode(rights,INPUT);
//begin serial communication
Serial.begin(9600);
void loop(){
//printing values of the sensors to the serial monitor
Serial.println(analogRead(lefts));
Serial.println(analogRead(rights));
//line detected by both
if(analogRead(lefts)<=400 && analogRead(rights)<=400){
//stop
motor1.run(RELEASE);
motor2.run(RELEASE);
8
}
//line detected by left sensor
else if(analogRead(lefts)<=400 && !analogRead(rights)<=400){
//turn left
motor1.run(BACKWARD);
motor2.run(FORWARD);
/*
motor1.run(RELEASE);
motor2.run(FORWARD);
*/
}
//line detected by right sensor
else if(!analogRead(lefts)<=400 && analogRead(rights)<=400){
//turn right
motor1.run(FORWARD);
motor2.run(BACKWARD);
/*
motor1.run(FORWARD);
motor2.run(RELEASE);
*/
}
//line detected by none
else if(!analogRead(lefts)<=400 && !analogRead(rights)<=400){
//stop
motor1.run(FORWARD);
motor2.run(FORWARD);
/*
motor1.run(BACKWARD);
motor2.run(BACKWARD);
*/
}
1.9 Conclusion:
In this report we conclude from our project that if we give input through sensor in analog
form then it converted into output in digital form. We also conclude that we can make car
to follow the certain path of our choice. In this project, the sensors sense the colour of
surface and according to the code the car will move left, right or straight.
9
10