Robo Fest Document How to Build a Line

Embed Size (px)

Citation preview

  • 8/6/2019 Robo Fest Document How to Build a Line

    1/15

    How to build a basic line following Robot

    6/27/2011

  • 8/6/2019 Robo Fest Document How to Build a Line

    2/15

    2 | P a g e

    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

  • 8/6/2019 Robo Fest Document How to Build a Line

    3/15

    3 | P a g e

    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

    http://c/Users/Charith/Desktop/Robo%20fest%20document-super%20final.docx%23_Toc296949014http://c/Users/Charith/Desktop/Robo%20fest%20document-super%20final.docx%23_Toc296949015http://c/Users/Charith/Desktop/Robo%20fest%20document-super%20final.docx%23_Toc296949016http://c/Users/Charith/Desktop/Robo%20fest%20document-super%20final.docx%23_Toc296949017http://c/Users/Charith/Desktop/Robo%20fest%20document-super%20final.docx%23_Toc296949018http://c/Users/Charith/Desktop/Robo%20fest%20document-super%20final.docx%23_Toc296949019http://c/Users/Charith/Desktop/Robo%20fest%20document-super%20final.docx%23_Toc296949021http://c/Users/Charith/Desktop/Robo%20fest%20document-super%20final.docx%23_Toc296949022http://c/Users/Charith/Desktop/Robo%20fest%20document-super%20final.docx%23_Toc296949023http://c/Users/Charith/Desktop/Robo%20fest%20document-super%20final.docx%23_Toc296949024http://c/Users/Charith/Desktop/Robo%20fest%20document-super%20final.docx%23_Toc296949025http://c/Users/Charith/Desktop/Robo%20fest%20document-super%20final.docx%23_Toc296949026http://c/Users/Charith/Desktop/Robo%20fest%20document-super%20final.docx%23_Toc296949028http://c/Users/Charith/Desktop/Robo%20fest%20document-super%20final.docx%23_Toc296949028http://c/Users/Charith/Desktop/Robo%20fest%20document-super%20final.docx%23_Toc296949026http://c/Users/Charith/Desktop/Robo%20fest%20document-super%20final.docx%23_Toc296949025http://c/Users/Charith/Desktop/Robo%20fest%20document-super%20final.docx%23_Toc296949024http://c/Users/Charith/Desktop/Robo%20fest%20document-super%20final.docx%23_Toc296949023http://c/Users/Charith/Desktop/Robo%20fest%20document-super%20final.docx%23_Toc296949022http://c/Users/Charith/Desktop/Robo%20fest%20document-super%20final.docx%23_Toc296949021http://c/Users/Charith/Desktop/Robo%20fest%20document-super%20final.docx%23_Toc296949019http://c/Users/Charith/Desktop/Robo%20fest%20document-super%20final.docx%23_Toc296949018http://c/Users/Charith/Desktop/Robo%20fest%20document-super%20final.docx%23_Toc296949017http://c/Users/Charith/Desktop/Robo%20fest%20document-super%20final.docx%23_Toc296949016http://c/Users/Charith/Desktop/Robo%20fest%20document-super%20final.docx%23_Toc296949015http://c/Users/Charith/Desktop/Robo%20fest%20document-super%20final.docx%23_Toc296949014
  • 8/6/2019 Robo Fest Document How to Build a Line

    4/15

    4 | P a g e

    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)

  • 8/6/2019 Robo Fest Document How to Build a Line

    5/15

    5 | P a g e

    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

    DC motor Gear box

    Figure 1

    Figure 2

  • 8/6/2019 Robo Fest Document How to Build a Line

    6/15

    6 | P a g e

    Chassis plate

    Wheel sets

    Trackball

    Figure 4

    Figure 3

    Figure 5

    Figure 6

  • 8/6/2019 Robo Fest Document How to Build a Line

    7/15

    7 | P a g e

    L293D IC

    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

    Figure 7

  • 8/6/2019 Robo Fest Document How to Build a Line

    8/15

    8 | P a g e

    LM324 IC

    IR Transmitters and Receivers

    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.

    Figure 9

    Figure 10

  • 8/6/2019 Robo Fest Document How to Build a Line

    9/15

    9 | P a g e

    Figure 11

  • 8/6/2019 Robo Fest Document How to Build a Line

    10/15

    10 | P a g e

    These are some IR sensor patterns you can use to detect the Black line. However number of

    sensors can be varied.

    (1)

    (2)

    (3)

  • 8/6/2019 Robo Fest Document How to Build a Line

    11/15

    11 | P a g e

    L7805 voltage regulator

    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 roboticdevices. 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 roboticdevice. Click on the sections below to view a detailed explanation

    Figure 12

    Figure 13

  • 8/6/2019 Robo Fest Document How to Build a Line

    12/15

    12 | P a g e

    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 ofthe microcontroller. For practical reasons, as it is much easier for us to deal with hexadecimal

    Figure 14

  • 8/6/2019 Robo Fest Document How to Build a Line

    13/15

    13 | 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 languagebeing 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.

  • 8/6/2019 Robo Fest Document How to Build a Line

    14/15

    14 | 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.

  • 8/6/2019 Robo Fest Document How to Build a Line

    15/15

    15 | P a g e

    Basic line following robot include three main parts.

    Chassis part Motor controller part Sensor circuit part