Sie sind auf Seite 1von 8

INTRODUCTION

Line follower is an autonomous robot which follows either black line in white area or white line
in black area. Robot must be able to detect particular line and keep following it. There are
basically two ways of building a line following robot. First, using a light dependent resistor
(LDR) and second, using LEDs.
I. OBJECTIVE

To design a Line Following Robot using ACEDuino328 Microcontroller.

II. LIST OF MATERIALS

ACEDuino328 board
DC Motor (2)
0.1 F capacitor (2)
220 ohm resistor(2)
2.2 K ohm resistor (4)
100 ohm resistor (2)
LDR (2)
2N2222 transistor (2)
LEDs

III. BLOCK DIAGRAM

EXPLANATION OF THE BLOCK DIAGRAM


An array of sensor is used to detect the line. Based on the status of sensors, special circuit or
controller decides the position of line and also the required direction of motion required to follow
the line. Motor driver circuit is used to ON/OFF the LEFT/RIGHT motors of the robot to provide
desired motion.
IV. SCHEMATIC DIAGRAM

MAIN PARTS
Sensor
Consists of two LED/LDR pairs.
Resistors R1 and R2 limits the current through the LEDs.
Resistors R6, R8, R3,and R5 forms individual voltage divider networks in conjunction
with the corresponding LDRs.
The voltages dropped across the right and left LDRs are given as input to the analog input
pins of the Arduino board.

LIGHT DEPENDENT RESISTORS


LDRs or Light Dependent Resistors are very useful especially in light/dark sensor circuits.
Normally the resistance of an LDR is very high, sometimes as high as 1000 000 ohms, but
when they are illuminated with light resistance drops dramatically.
Arduino board

GIZDUINO328 MICROCONTROLLER
Arduino is an open-source platform used for building electronics projects. Arduino consists
of both a physical programmable circuit board (often referred to as a microcontroller) and a
piece of software, or IDE (Integrated Development Environment) that runs on your
computer, used to write and upload computer code to the physical board.
Motor Driver
based on two NPN transistors.

2N222A TRANSISTOR
The 2N222 transistor is a common negative-positive-negative (NPN) bipolar junction
transistor (BJT) that finds use in many different kinds of electronic equipment. It is used for
both analog signal amplification and switching applications. The functioning parts of the
2N2222 transistor are enclosed in what is known as a TO-18 package, which resembles a
small metal can. The broad range of uses for the 2N2222 transistor, and its small size, make it
and its variants the most widely used transistors in electronics.

V. CODES
In this project, we used the Arduino 1.0.6 interface to upload the codes into the Gizduino328
Microcontroller for program execution.

Actual guiding code


int leftInput=A0;
int rightInput=A1;
int leftMotor=13;
int rightMotor=12;
int leftValue = 0;
int rightValue = 0;
void setup()
{
pinMode (leftMotor, OUTPUT);
pinMode (rightMotor, OUTPUT);
pinMode(leftInput, INPUT);
Serial.begin(9600);
pinMode(rightInput, INPUT);
}
void loop()
{
leftValue = analogRead (leftInput);
rightValue= analogRead (rightInput);
if

( leftValue < 180 && rightValue < 180)


{
digitalWrite (leftMotor, HIGH);
digitalWrite (rightMotor, HIGH);
}
else
{
if
( leftValue > 180 && rightValue < 180)
{
digitalWrite (leftMotor, LOW);
digitalWrite (rightMotor, HIGH);
}
else {
if (leftValue < 180 && rightValue > 180)
{
digitalWrite (rightMotor, LOW);
digitalWrite (leftMotor, HIGH);
}
else
{
if (leftValue > 180 && rightValue > 180)
{digitalWrite (rightMotor, LOW);
digitalWrite (leftMotor, LOW);
}}
}
}}

Testing code (for threshold value)


This set of codes can be used to test for the threshold reading of the LDR sensor and in order
for the robot to convey accurate perception of the black line and white surface. The value of
the threshold should be closer to the white surface reading so that the sensor would be more
sensitive in detecting the black line. Values may vary in different ambient light conditions.
#include <Servo.h>
Servo myservo;
int ldr = A0;
int val;
int thresh = 500;
int pos = 0;
void setup()
{
myservo.attach(9);
Serial.begin(9600);

pinMode(ldr, INPUT);
myservo.write(pos);
}
void loop()
{
val = analogRead(ldr);
Serial.println(val);
if(val >= thresh)
{
myservo.write(140);
delay(400);
}
else if (val <=thresh)
{
myservo.write(50);
delay(300);
}
}
ASSEMBLY

After various testing of the output for the line follower, the final design for the robot can be
seen. Although there are still minor adjustments to be made for the program, it can be decided
that the robot may not be functioning a total of a hundred percent, but this project is not
considered a failure.

VI. CONCLUSION
We therefore conclude that this project is up and running if not for the unreliability of the LDR
resistor for the threshold defines the sensitivity of the LDR and is always affected by factors
surrounding the system.
VII. RECOMMENDATION
In making this project, make sure that there is a proper clearance between the sensor and the
surface so that it will not affect the performance of the sensor. Ambient light should also be
considered for it is affected by sensor sensitivity, but this problem could be solved by further
testing of the environmental conditions.
VIII. REFERENCE
http://www.circuitstoday.com/line-follower-robot-using-8051-microcontroller
http://www.engineerprojects.info/electronics-projects/59/
http://www.instructables.com/id/Line-following-Robot-with-Arduino/
http://www.engineersgarage.com/contribution/line-follower-robot

UNIVERSITY OF PERPETUAL HELP SYSTEM LAGUNA

College of Engineering and Tech-Voc

LINE FOLLOWING ROBOT

ALMENDRAL, Jane Nicole L.


BAYLON, Mary Angelou L.
BECONIA, Lizzy-Ann S.
DADOR, Catherine C.

ENGR. Leilani J. Avecilla - Gonzales

Das könnte Ihnen auch gefallen