Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
A Project Report on
Line follower
robot
Preface
The Line Follower Robot gives you information about various aspects of Robotics.
This robot is developed by the Computer Science Department.
You can visit the our Robot video on the YouTube channel at the
following link. https://www.youtube.com/watch?v=3wQew9-XNUU
Abstract
CONTENTS:
Sr. No. Content Page No.
1 Introduction 05
2 Aim and Objectives 06
3 Hardware Equipment 08
4 Software Requirement 17
5 Control Section 29
6 Component Description 32
7 Applications 33
8 Conclusion 34
9 References 35
CHAPTER 1
INTRODUCTION
Robot can replace humans job in industry because robot can do many things faster
than humans. Robots do not need to be paid, eat, drink, or go to the bathroom like
people. They can do repetitive work that is absolutely boring to people and they will
not stop, slow down, or fall asleep like a human. Individual stationary sensors have
limited ranges and applications. Robotic site security sentries are able to work long
hours at a consistently high level of precision and vigilance.
People are interested in places that are sometimes full of danger, like outer
space, or the deep ocean. Thus, when they cannot go there themselves, they make
robots which are able to go there for exploration. The robots are able to carry cameras
and other instruments so that they can collect information and send it back to their
human operators. The continuing development of autonomous robot technologies
furthers our abilities to explore the universe.
The line following robot can follow the black lines, its motion still needs
to be improved.
CHAPTER 2:
AIM AND OBJECTIVE
AIM:
To understand the basic parts of robotics like sensor, motors and controller etc and
correlate the different parts so how any application will work as a part of skill
development.
OBJECTIVE
i. To design and construct the platform of line following robot using infrared sensors.
Infrared (IR) radiation is electromagnetic radiation of a wavelength longer than that of
visible light.
Criteria for choosing a microcontroller is because it must meet the task at hand
efficiently and cost effectively, then the availability of software and hardware
development tools such as compilers, assemblers, debuggers, and emulators, and
lastly microcontroller have a wide availability in needed quantities both now and in
the future
In short:-
CHAPTER 3:
HARDWARE REQUIREMENT
There are number of microcontrollers, motors and sensor in the market with varying
specification. Therefore in this chapter we choose the most suitable microcontroller,
motor and sensor to be used for our project.
Further the project can be enhanced by adding more advanced sensors to it. This will
add more features to the existing project. For example, we can use ultrasonic sensors
for detect any obstacle in front of the robot and to take appropriate action.
COMPONENT
PIC 18F4450
DC Motor
DC motors are so called because they are powered by a current placed across the
electrodes of the motor. The speed rating of a DC motor is the top speed it can run at.
The actual speed the motor runs at is a function of how strong the current is that is
applied to the motor. DC motors can be run both forwards and backwards depending
on the direction of the applied current. Special circuits called "H-bridges" allow the
use of switches and transistors to change the direction a motor moves without having
to change any of the wires. For the most part, DC motors come with very high speed
ratings, and thus very low torque. Gears and transmissions allow us to convert the
speed of a DC motor into torque that can be used for other tasks, such as moving
heavy robots or lifting objects.
Figure DC Motor
L293D is a typical Motor driver or Motor Driver IC which allows DC motor to drive
on either direction. L293D is a 16-pin IC which can control a set of two DC motors
simultaneously in any direction. It means that you can control two DC motor with a
single L293D IC.
It works on the concept of H-bridge. H-bridge is a circuit which allows the voltage to
be flown in either direction. As you know voltage need to change its direction for
being able to rotate the motor in clockwise or anticlockwise direction, hence H-bridge
IC are ideal for driving a DC motor.
In a single l293D chip there two h-Bridge circuit inside the IC which can rotate two
dc motor independently. Due its size it is very much used in robotic application for
controlling DC motors. Given below is the pin diagram of a L293D motor controller.
There are two Enable pins on l293d. Pin 1 and pin 9, for being able to drive the motor,
the pin 1 and 9 need to be high. For driving the motor with left H-bridge you need to
enable pin 1 to high. And for right H-Bridge you need to make the pin 9 to high. If
anyone of the either pin1 or pin9 goes low then the motor in the corresponding section
will suspend working. Its like a switch.
Working of L293D
The 4 input pins for this l293d, pin 2,7 on the left and pin 15, 10 on the right as shown
on the pin diagram. Left input pins will regulate the rotation of motor connected
across left side and right input for motor on the right hand side. The motors are
rotated on the basis of the inputs provided across the input pins as LOGIC 0 or
LOGIC 1. In simple you need to provide Logic 0 or 1 across the input pins for
rotating the motor.
L293D Pins Pin 2 Pin15 Pin 7 Pin 10
Move forward 0 1 0 1
Move 1 0 1 0
Backward
Turn Left 0 1 0 0
Turn Right 0 0 0 1
Figure: L293 Logic Table
IR Sensor
IR Sensors work by using a specific light sensor to detect a select light wavelength in
the Infra-Red (IR) spectrum. By using an LED which produces light at the same
wavelength as what the sensor is looking for, you can look at the intensity of the
received light. When an object is close to the sensor, the light from the LED bounces
off the object and into the light sensor.
Since the sensor works by looking for reflected light, it is possible to have a sensor
that can return the value of the reflected light. This type of sensor can then be used to
measure how "bright" the object is. This is useful for tasks like line tracking.
Detecting Brightness
Since the sensor works by looking for reflected light, it is possible to have a sensor
that can return the value of the reflected light. This type of sensor can then be used to
measure how "bright" the object is. This is useful for tasks like line tracking.
Voltage regulator IC's are the ICs that are used to regulate voltage. IC 7805 is a 5V
Voltage Regulator that restricts the voltage output to 5V and draws 5V regulated
power supply. It comes with provision to add heatsink. The maximum value for input
to the voltage regulator is 35V. It can provide a constant steady voltage flow of 5V for
higher voltage input till the threshold limit of 35V. If the voltage is near to 7.5V then
it does not produce any heat and hence no need for heatsink. If the voltage input is
more, then excess electricity is liberated as heat from 7805.
It regulates a steady output of 5V if the input voltage is in rage of 7.2V to 35V. Hence
to avoid power loss try to maintain the input to 7.2V. In some circuitry voltage
fluctuation is fatal (for e.g. Microcontroller), for such situation to ensure constant
voltage IC 7805 Voltage Regulator is used.
IC 7805 is a series of 78XX voltage regulators. Its a standard, from the name the last
two digits 05 denotes the amount of voltage that it regulates. Hence a 7805 would
regulate 5v and 7806 would regulate 6V and so on.
The schematic given below shows how to use a 7805 IC, there are 3 pins in IC 7805,
pin 1 takes the input voltage and pin 3 produces the output voltage. The GND of both
input and out are given to pin 2.
Pin Description:
Solder
Solder is the tool that used to melting a soldering iron for component pin. Solder
commonly used in electronics, plumbing and assembly of metal part. This is
important tools for make sure the component pin have connect with copper path at
board.
Figure : Solder
Soldering Iron
This tool was actually used with solder, without this tools the component will not
soldering to the board because the solder design for melting this iron to component
pin for make the component connect with copper path.
Soldering Iron
Hand Drill
This tool is used to make a hole such as metal, plastic and wood. We also used this
tool for some work such as drilling our robot base for placing the IR sensor and make
a hole to put a bold and nut. The drill bit also can be change in any variable size we
want.
CHAPTER4:
SOFTWARE REQUIREMENT
2) Install mplabc18-v3.47-windows-eval-installer.exe
4) Go to Menu->Project->Project Wizard.
5) Hit Next to bypass the Welcome screen and select the PIC processor PIC18F4450
for the project and hit Next.
6) Select the Microchip C18 Toolsuite and hit Next (This assumes C18 was installed
previously).
8) Give file name to file which is saved in workspace as .mcp >next > next> finish
10) Type your code hear > save as > .c extension and tick mark to add to Project
Connect your pic microcontroller board to pickit2 through usb cable and click
establish connection you see controller name and its power supply(5v)
as program EEPROM. Some models also feature logic analyzer and serial
communications (UART) tool. The people who develop open-source software for the
PICkit use a mailing list for collaboration.
The PICkit 2 uses an internal PIC18F2550 with FullSpeed USB. The latest PICkit 2
firmware allows the user to program and debug most of the 8 and 16 bit PICmicro and
dsPIC members of the Microchip product line.
The PICkit 2 is open to the public, including its hardware schematic, firmware source
code (in C language) and application programs (in C# language). End users and third
parties can easily modify both the hardware and software for enhanced features. e.g.
GNU/Linux version of PICKit 2 application software, DOS style CMD support, etc.
The PICkit 2 has a programmer-to-go (PTG) feature, which can download the hex file
and programming instructions into on-board memory (128K byte I2C EEPROM or
256K byte I2C EEPROM), so that no PC is required at the end application. The
Microchip version of PICkit 2 has a standard 128K byte memory. 256K byte memory
can be achieved by modifying the hardware or from third party.
Additionally, a 500 kHz three-channel logic analyser and a UART tool are built into
the PICKit 2. These features are missing from the PICkit 3. Since release of V2.55,
PICkit 2 PC software now support maximum 4M bytes of memory for programmer-
to-go feature. This modification makes the PICKit 2 support 8x more memory than
the PICKit 3. This enhancement has been contributed by Au Group Electronics and
the PICkit 2 firmware is also reported to be submitted to Microchip PICkit 2 team in
the middle of March 2009.
In this section we discuss about Assembly language format and define some widely
used terminology associated with Assembly language programming.
While the CPU can work only in binary, it can do so at very high speed. It is quite
tedious and slow for human, however to deal with 0s and 1s is called machine
language. Although the hexadecimal system was used as a more efficient way to
represent binary numbers, the process of working in machine code was still
cumbersome for humans. Eventually, Assembly languages were develop, which
provided mnemonics for the machine code instructions, plus other features that made
programming faster and less prone to error. The term mnemonic is frequently used in
computer science and engineering literature to refer to codes and abbreviations that
are relativity easy to remember. Assembly language programs must be translated into
machine code by a program called an assembler. Assembly language is referred to as
a low-level language because it deals directly with the internal structure of the CPU.
To program in Assembly language, the programmer must know all the registers of the
CPU and the size of each, as well as other details.
Today, one can use many different programming languages, such as BASIC, Pascal,
C, C++, Java, and numerous others. These languages are called high-level languages
because the programmer does not have to be concerned with the internal details of the
CPU. Whereas an assembler is used to translate an Assembly language program into
machine code, high level languages are translated into machine code by program
called a compiler. For instance, to write a program in C, one must use a C compiler to
translate the program into machine language.
The steps to create an executable Assembly language program are outlined as follows:
First we use a text editor to type our programming. In the case of the PIC
microcontrollers, we use the MPLAB IDE, which has a text editor, assembler, linker,
simulator and much more all in one software package. It is excellent development
software that supports all the PIC chips and is free. Assembler has the file names
follow the usual DOS conventions, but the source file has the extension asm. The
asm extension for the source file is used by an assembler in the next step.
1. The asm source file containing the program code created in step 1 is fed to the PIC
assembler. The assembler converts the instructions into machine code. The assembler
will produce an object file and an error file. The extension for the object file o. The
extension for the error file, which contains any syntax error and their line numbers, is
err. The error file can be viewed with any text editor.
2. Assemblers require a third step called linking. The link program takes one or more
object files and produces a hex file, a list file, a map file, an intermediate object file,
and a debug file. The hex file has the extension hex, the list file extension is lst,
the map file extension is map, the intermediate object file extension is out, and
the debug file extension is cod. After a successful link, the hex file is ready to be
burned into the PICs program ROM and is downloaded into the PIC Trainers.
CHAPTER 5
Control Section
{
TRISA =0xFF;
LATA=0X00;
TRISB =0x00;
LATB =0X00;
CMCON = 0X07; //Disable Comparator
ADCON1bits.PCFG0=1;
ADCON1bits.PCFG1=1;
ADCON1bits.PCFG2=1;
ADCON1bits.PCFG3=1;
ADCON0bits.ADON=0; //Disable ADC
while(1)
{
if( sensor1==1 & sensor2 ==0 & sensor3==0 & sensor4==1 & sensor5==1 ||
sensor1==1 & sensor2 ==1 & sensor3==0 & sensor4==0 & sensor5==1 ||
sensor1==1 & sensor2 ==0 & sensor3==0 & sensor4==0 & sensor5==1 ||
sensor1==1 & sensor2 ==0 & sensor3==1 & sensor4==1 & sensor5==1 ||
sensor1==1 & sensor2 ==1 & sensor3==0 & sensor4==1 & sensor5==1 ||
sensor1==1 & sensor2 ==1 & sensor3==1 & sensor4==0 & sensor5==1 )//robot
forward
{
LATBbits.LATB3 = 0; // RB-0 to LOW
LATBbits.LATB2 = 1; // RB-1 to LOW
LATBbits.LATB1 = 0; // RB-0 to LOW
LATBbits.LATB0 = 1; // RB-1 to LOW
}
else if(
sensor1==0 & sensor2 ==1 & sensor3==1 & sensor4==1 & sensor5==1||
sensor1==0 & sensor2 ==0 & sensor3==1 & sensor4==1 & sensor5==1||
sensor1==0 & sensor2 ==0 & sensor3==0 & sensor4==1 & sensor5==1||
sensor1==0 & sensor2 ==0 & sensor3==0 & sensor4==0 & sensor5==1) //robot turns
right
{
LATBbits.LATB3 = 0 ; // RB-0 to LOW
LATBbits.LATB2 = 1; // RB-1 to LOW
LATBbits.LATB1 = 0; // RB-0 to LOW
LATBbits.LATB0 = 0; // RB-1 to LOW
}
else if(sensor1==1 & sensor2 ==1 & sensor3==1 & sensor4==0 & sensor5==0 ||
sensor1==1 & sensor2 ==1 & sensor3==1 & sensor4==1 & sensor5==0 ||
sensor1==1 & sensor2 ==1 & sensor3==0 & sensor4==0 & sensor5==0 ||
sensor1==1 & sensor2 ==0 & sensor3==0 & sensor4==0 & sensor5==0)// robot turns
left
{
LATBbits.LATB3 = 0; // RB-0 to LOW
LATBbits.LATB2 = 0; // RB-1 to LOW
LATBbits.LATB1 = 0; // RB-0 to LOW
LATBbits.LATB0 = 1; // RB-1 to LOW
}
else
{
LATBbits.LATB3 = 0; // RB-0 to LOW
LATBbits.LATB2 = 0; // RB-1 to LOW
LATBbits.LATB1 = 0; // RB-0 to LOW
LATBbits.LATB0 = 0; // RB-1 to LOW
}
}
}
COMPONENT
NO DESCRIPTION QUANTITY
1. It can act as maze solver. Basically it follows a line, therefore it can be used in
mining where the robots are used to find the way out of the mine.2.
2. If we implement a robotic arm along with the line follower then it can be used to
pick and place the objects in its way and can be very useful in our day to day life.3.
3. Apparatus to control the automatic placing of material along a junction between surfaces with
reference to the form and position of the junction including a tool controllably movable
to deposit material progressively along the junction in response to a control signal.
4. An imager linked to the movement of the tool to produce an image of the surfaces.
5. By modifying the position of the sensors, same principle can be used in obstacle
avoidance and edge detection.
CONCLUSION
This is the first step of making intelligent robots capable of making their own
decisions on the situations provided. The design, implementation and testing of a
working project proved to be very challenging. The primary objective of detecting
and following a specific coloured line proved to be a great learning experience, as we
did not have prior hands-on experience in Embedded Systems. The difficulties in
project management as well as those brought to light during experimentation provided
an opportunity to work on problem-solving abilities. Despite many problems
encountered, I found this experience a rewarding and educational one. This project
can have many uses in practical fields, from teenagers toy cars to robots working in
industries and even in wars. It can be further improved to have more decision taking
capabilities by employing varied types of sensors and thus could be used in big
industries for different applications.
References
Books-
Websites-
1. www.robosoft.com
2 http://www.rakeshmondal.info/microcontroller-tutorials
3. http://www.pic18f.com\18f4550-c-tutorial/2009/11/16/tutorial-4-hello-world-program-
in-c\