Download as pdf or txt
Download as pdf or txt
You are on page 1of 15

How to build a basic line following Robot

6/27/2011

Contents
CONTENTS.......................................................................................................................................... 2

LIST OF FIGURES .............................................................................................................................. 3

INTRODUCTION ............................................................................................................................... 4

HOW TO BUILD A BASIC LINE FOLLOWING ROBOT ............................................................ 5


Required Items ................................................................................................................................................ 5
PIC 16F877A ....................................................................................................................................................... 5
DC motor Gear box ............................................................................................................................................. 5
Chassis plate ....................................................................................................................................................... 6
Wheel sets .......................................................................................................................................................... 6
Trackball ............................................................................................................................................................. 6
L293D IC ............................................................................................................................................................. 7
LM324 IC ............................................................................................................................................................ 8
IR Transmitters and Receivers ............................................................................................................................ 8
L7805 voltage regulator ................................................................................................................................... 11
PIC microcontrollers ...................................................................................................................................... 11
Pic programming............................................................................................................................................ 12

2|Page

List of Figures
Figure 1 ................................................................................................................................................... 5
Figure 2 ................................................................................................................................................... 5
Figure 3 ................................................................................................................................................... 6
Figure 4 ................................................................................................................................................... 6
Figure 5 ................................................................................................................................................... 6
Figure 6 ................................................................................................................................................... 6
Figure 8 ................................................................................................................................................... 7
Figure 7 ................................................................................................................................................... 7
Figure 9 ................................................................................................................................................... 8
Figure 10 ................................................................................................................................................. 8
Figure 11 ................................................................................................................................................. 9
Figure 12 ............................................................................................................................................... 11
Figure 13 ............................................................................................................................................... 11
Figure 15 ............................................................................................................................................... 12
Figure 14 ............................................................................................................................................... 12
Figure 16 ............................................................................................................................................... 13
Figure 17 ............................................................................................................................................... 14
Figure 18 ............................................................................................................................................... 14

3|Page

Introduction
School competitors of SLIIT Robofest 2011 should develop a line following robot. This
document will give the basic guidelines to develop a line following robot.
Remember this is only a basic guide.
(You do not need to limit only these components)

4|Page

How to build a basic line following Robot


Required Items
Following items should be purchased to develop a line following robot.

Microcontrollers (Ex:- PIC 16f877A)


DC Motor gear box
Chassis plate
Wheel sets
Operational Amplifiers (Ex:- LM324 IC)
Motor controllers (Ex:- L293D IC)
Trackball
L7805 voltage regulator
IR Transmitters and Receivers

Details of these items are given bellow.

PIC 16F877A

Figure 1

DC motor Gear box

Figure 2

5|Page

Chassis plate

Figure 4

Figure 3

Wheel sets

Figure 5

Trackball

Figure 6

6|Page

L293D IC

Figure 7

This is a 14 pin IC which we can use to interface two DC motors. It contains two H-Bridges
which can control the direction of two dc motors (both clockwise and anti-clockwise). L293D
has output current of 600mA and peak output current of 1.2 A per channel. The output supply
(VCC2) has a wide range from 4.5 V to 36 V. Moreover for protection of circuit from back
EMF, output diodes are included within the IC.
(Further details refer data sheets)

Figure 8

7|Page

LM324 IC

Figure 9

IR Transmitters and Receivers

Figure 10

Infra-Red LED is used as a source of infrared rays. It comes in two packages, 3mm or 5mm.
3mm is better as it requires less space. IR sensor is nothing but a diode, which is sensitive for
infrared radiation.
This infrared transmitter and receiver are called as IR TX-RX pair. It can be obtained from
any decent electronics component shop and costs less than 40Rs. The above snap shows 3mm
and 5mm IR pairs.
Colors of IR transmitter and receiver are different. However you may come across pairs
which appear exactly same or even has opposite colors than shown in above picture and it is
not possible to distinguish between TX and RX visually. In case you will have to take help of
millimeter to distinguish between them.
You can design the IR transmitter and receiver circuit as shown in the diagram given below.
It has 4-Infrared sensors to detect black tracking path. When the some sensors detect black
color output of the associated comparators, LM324, are low logic and the other the outputs
are high. Due to this logic, when the sensor detects black color, LED is lighted up and for
other colors (such as white) it will not light up.
8|Page

Figure 11

9|Page

These are some IR sensor patterns you can use to detect the Black line. However number of
sensors can be varied.
(1)

(2)

(3)

10 | P a g e

L7805 voltage regulator

Figure 12

Last two digits of LM78XX indicate output voltage. For an example assume if it is LM7805,
last two digits are 05 and they indicate that regulator IC output is 5V.

PIC microcontrollers
PIC Microcontrollers are quickly replacing computers when it comes to programming robotic
devices. These microcontrollers are small and can be programmed to carry out a number of
tasks and are ideal for school and industrial projects. A simple program is written using a
computer; it is then downloaded to a microcontroller which in turn can control a robotic
device. Click on the sections below to view a detailed explanation

Figure 13

11 | P a g e

Figure 14

Pic programming

Figure 15

The microcontroller executes the program loaded in its Flash memory. This is the so called
executable code comprised of seemingly meaningless sequence of zeros and ones. It is
organized in 12-, 14- or 16-bit wide words, depending on the microcontrollers architecture.
Every word is considered by the CPU as a command being executed during the operation of
the microcontroller. For practical reasons, as it is much easier for us to deal with hexadecimal
12 | P a g e

number system, the executable code is often represented as a sequence of hexadecimal


numbers called Hex code. It is used to be written by the programmer. All instructions that the
microcontroller can recognize are together called the Instruction set. As for PIC16F
microcontrollers the programming words of which are comprised of 14 bits, the instruction
set has 35 different instructions in total.

Figure 16

As the process of writing executable code was endlessly tiring, the first human friendly
programming language called assembly language was created. The truth is that it made the
process of programming more complicated, but on the other hand the process of writing
programs stopped being a nightmare. Instructions in assembly language are represented in the
form of meaningful abbreviations, and the process of their compiling into executable code is
left over to a special program on a PC called Assembler. The main advantage of this
programming language is its simplicity, i.e. each program instruction corresponds to one
machine instruction in the microcontroller. It enables a complete control of what is going on
within the chip, thus making this language commonly used today.
However, programmers have always needed a programming language close to the language
being used in everyday life. As a result, the higher programming languages have been
invented. One of them is C. The main advantage of these languages is simplicity of program
writing. It is no longer possible to know exactly how each command executes, but it is no
longer of interest anyway. In case it is, a sequence written in assembly language can always
be inserted in the program, thus enabling it.

13 | P a g e

Figure 17

Similar to assembly language, a specialized program in a PC called Compiler is in charge of


compiling program into machine language. Unlike assemblers, these create an executable
code which is not always the shortest possible.

Figure 18

The above figure gives a rough illustration of what is going on during the process of
compiling the program from higher to machine language.

14 | P a g e

Basic line following robot include three main parts.

Chassis part
Motor controller part
Sensor circuit part

15 | P a g e

You might also like