A Report of Mini Project Line Following Robot Car Using Ardino

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 10
At a glance
Powered by AI
The report discusses the design and implementation of a line follower robot using an Arduino microcontroller. It describes the components, code, and applications of such robots.

The line follower robot is designed to detect and follow a predefined path or line using infrared sensors to sense the line and motors controlled by an Arduino to navigate along the path.

Infrared sensors detect the line and send signals to the Arduino microcontroller. The Arduino processes the sensor readings and controls the motor driver shield to rotate the motors accordingly to keep the robot on the line.

A REPORT OF MINI PROJECT LINE FOLLOWING ROBOT

CAR USING ARDINO


FOR
MICROPROCESSORS SYSTEM (EE-502)
BY

Rao Asad Abdullah 17-EE-04


Muhammad Haris 17-EE-14
Asad Ali Mehdi 17-EE-32

Course Instructor: Dr. Abdul Sattar Malik

UNIVERSITY COLLEGE OF ENGINEERING &


TECHNOLOGY, BAUAHIDDIN ZAKARIYA
UNIVERSITY MULTAN.
Electrical Engineering Department.

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.3 Body of the Project 4

1.4 Project Activity 6

1.5 Block Diagram 6

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.

1.3 Body of Project:


The body of our project contains:

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.

1.4 Project Activity:


The whole Arduino line follower robot can be divided into 3 sections:
 1: Sensor section
2: Control section
3: Driver section.
The Sensor Section consists of both IR sensors. Sensor detects the line and sends a signal to
Control Section. Control Section consist of Arduino and a code was uploaded in Arduino.
Arduino reads the signal and gives command to Driver shield. Driver Section consists motor
shield and two DC motors. Motor shield is used for driving motors because we cannot
connect the motors directly to Arduino it may burn out that’s why we use motor shield
between the Arduino and motors. Arduino sends commands to this motor shield and then it
drive motors. In our case the robot car follows the line, the sensors we use doesn’t detect
the black colour and detect all other colour. We will make a path of define boundary in
which our robot moves.

1.5 Block Diagram:

6
Motor
Sensors Arduino Motors
Shield

1.6 Applications:

 Industrial automated equipment carriers.


 Automated cars.
 Tours guides in museums and other similar applications.
 Deliver the mail within the office building.
 Deliver medication in a hospital.
 Used in place of crane.

1.7 Limitations:

 It requires power supply.


 Lack of speed control makes it unstable.
 Choice of line is made in the hardware abstraction and cannot be changed by
software.
 It moves on a fixed track.

1.8 Code:
////////////////////////////////////////////////////////
// LinoBot v1.0 //
// By Asad,Asad Medhi,Haris //

7
////////////////////////////////////////////////////////

//I have added the possibilities of testing


//The values of analogRead could be changed for trouble shooting

//including the libraries


#include <AFMotor.h>

//defining pins and variables


#define lefts A4
#define rights A5

//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

You might also like