coursefor12th.docx

Upload: sonu-mehta

Post on 05-Apr-2018

214 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/31/2019 coursefor12th.docx

    1/25

    Introduction

    This course will provide senior secondary class students a base torobotics. This course and associated workshop doest aim at giving thedeep technical knowledge to the student but to aware them that where theworld is in term of robotics and to create their interest in robotics . They willlearn the Automation technology and get better understanding and grip onits application. They will be developing their own models by their ownhands. The workshop focus on the application and use of technology ratherthan their internal working so that the student can grasp the concepts well.

    Course Content

    1. Introduction to robotics

    2. Locomotion in Robotics3. Introduction to Mechanical systems4. Motor and its control5. Introduction to Microcontrollers (8051 microcontroller family)6. Sensors7. Introduction to Unmanned & Intelligent Systems8. Introduction to basic programming language(c/c++).9. Building line follower robot

    1. Introduction to robotics

    Robotics is the branch oftechnology that deals with the design,construction, operation, structural disposition, manufacture and applicationofrobots.[3]Robotics is related to the sciences ofelectronics, engineering,mechanics, and software

    History of robotics

    The word robotwas introduced to the public by the Czech writerKarelapekin his playR.U.R. (Rossum's Universal Robots), published in1920.[5]The play begins in a factory that makes artificial people calledrobotscreatures who can be mistaken for humans - though they are closerto the modern ideas ofandroids. Karel apek himself did not coin the word.

    http://en.wikipedia.org/wiki/Technologyhttp://en.wikipedia.org/wiki/Robothttp://en.wikipedia.org/wiki/Robotics#cite_note-OED-2http://en.wikipedia.org/wiki/Robotics#cite_note-OED-2http://en.wikipedia.org/wiki/Sciencehttp://en.wikipedia.org/wiki/Electronicshttp://en.wikipedia.org/wiki/Engineeringhttp://en.wikipedia.org/wiki/Mechanicshttp://en.wikipedia.org/wiki/Computer_softwarehttp://en.wikipedia.org/wiki/Computer_softwarehttp://en.wikipedia.org/wiki/Czechoslovakiahttp://en.wikipedia.org/wiki/Karel_%C4%8Capekhttp://en.wikipedia.org/wiki/Karel_%C4%8Capekhttp://en.wikipedia.org/wiki/Karel_%C4%8Capekhttp://en.wikipedia.org/wiki/R.U.R._(Rossum%27s_Universal_Robots)http://en.wikipedia.org/wiki/R.U.R._(Rossum%27s_Universal_Robots)http://en.wikipedia.org/wiki/R.U.R._(Rossum%27s_Universal_Robots)http://en.wikipedia.org/wiki/Robotics#cite_note-KapekWebsite-4http://en.wikipedia.org/wiki/Robotics#cite_note-KapekWebsite-4http://en.wikipedia.org/wiki/Robotics#cite_note-KapekWebsite-4http://en.wikipedia.org/wiki/Android_(robot)http://en.wikipedia.org/wiki/Android_(robot)http://en.wikipedia.org/wiki/Android_(robot)http://en.wikipedia.org/wiki/Robotics#cite_note-KapekWebsite-4http://en.wikipedia.org/wiki/R.U.R._(Rossum%27s_Universal_Robots)http://en.wikipedia.org/wiki/Karel_%C4%8Capekhttp://en.wikipedia.org/wiki/Karel_%C4%8Capekhttp://en.wikipedia.org/wiki/Czechoslovakiahttp://en.wikipedia.org/wiki/Computer_softwarehttp://en.wikipedia.org/wiki/Mechanicshttp://en.wikipedia.org/wiki/Engineeringhttp://en.wikipedia.org/wiki/Electronicshttp://en.wikipedia.org/wiki/Sciencehttp://en.wikipedia.org/wiki/Robotics#cite_note-OED-2http://en.wikipedia.org/wiki/Robothttp://en.wikipedia.org/wiki/Technology
  • 7/31/2019 coursefor12th.docx

    2/25

    He wrote a short letter in reference to an etymology in theOxford EnglishDictionaryin which he named his brotherJosef apekas its actualoriginator.[5]

    In 1927 theMaschinenmensch("machine-human") gynoid humanoid robot(also called "Parody", "Futura", "Robotrix", or the "Maria impersonator")was the first and perhaps the most memorable depiction of a robot ever toappear on film was played by German actress Brigitte Helm) in Fritz Lang'sfilm Metropolis.

    In 1942 the science fiction writerIsaac Asimov formulated his Three Lawsof Robotics and, in the process of doing so, coined the word "robotics" (seedetails in "Etymology" section below).

    In 1948 Norbert Wienerformulated the principles ofcybernetics, the basisof practical robotics.

    Fully autonomous robots only appeared in the second half of the 20thcentury. The first digitally operated and programmable robot, the Unimate,was installed in 1961 to lift hot pieces of metal from a die casting machineand stack them. Commercial and industrial robots are widespread todayand used to perform jobs more cheaply, or more accurately and reliably,than humans. They are also employed in jobs which are too dirty,dangerous, or dull to be suitable for humans. Robots are widely used in

    manufacturing, assembly, packing and packaging, transport, earth andspace exploration, surgery, weaponry, laboratory research, safety, and themass production of consumer and industrial goods.[8]

    http://en.wikipedia.org/wiki/Etymologyhttp://en.wikipedia.org/wiki/Oxford_English_Dictionaryhttp://en.wikipedia.org/wiki/Oxford_English_Dictionaryhttp://en.wikipedia.org/wiki/Oxford_English_Dictionaryhttp://en.wikipedia.org/wiki/Oxford_English_Dictionaryhttp://en.wikipedia.org/wiki/Josef_Capekhttp://en.wikipedia.org/wiki/Josef_Capekhttp://en.wikipedia.org/wiki/Josef_Capekhttp://en.wikipedia.org/wiki/Robotics#cite_note-KapekWebsite-4http://en.wikipedia.org/wiki/Robotics#cite_note-KapekWebsite-4http://en.wikipedia.org/wiki/Robotics#cite_note-KapekWebsite-4http://en.wikipedia.org/wiki/Maschinenmenschhttp://en.wikipedia.org/wiki/Maschinenmenschhttp://en.wikipedia.org/wiki/Maschinenmenschhttp://en.wikipedia.org/wiki/Gynoidhttp://en.wikipedia.org/wiki/Humanoid_robothttp://en.wikipedia.org/wiki/Brigitte_Helmhttp://en.wikipedia.org/wiki/Fritz_Langhttp://en.wikipedia.org/wiki/Filmhttp://en.wikipedia.org/wiki/Metropolis_(film)http://en.wikipedia.org/wiki/Isaac_Asimovhttp://en.wikipedia.org/wiki/Three_Laws_of_Roboticshttp://en.wikipedia.org/wiki/Three_Laws_of_Roboticshttp://en.wikipedia.org/wiki/Norbert_Wienerhttp://en.wikipedia.org/wiki/Cyberneticshttp://en.wikipedia.org/wiki/Unimatehttp://en.wikipedia.org/wiki/Industrial_robothttp://en.wikipedia.org/wiki/Manufacturinghttp://en.wikipedia.org/wiki/Robotics#cite_note-7http://en.wikipedia.org/wiki/Robotics#cite_note-7http://en.wikipedia.org/wiki/Robotics#cite_note-7http://en.wikipedia.org/wiki/Manufacturinghttp://en.wikipedia.org/wiki/Industrial_robothttp://en.wikipedia.org/wiki/Unimatehttp://en.wikipedia.org/wiki/Cyberneticshttp://en.wikipedia.org/wiki/Norbert_Wienerhttp://en.wikipedia.org/wiki/Three_Laws_of_Roboticshttp://en.wikipedia.org/wiki/Three_Laws_of_Roboticshttp://en.wikipedia.org/wiki/Isaac_Asimovhttp://en.wikipedia.org/wiki/Metropolis_(film)http://en.wikipedia.org/wiki/Filmhttp://en.wikipedia.org/wiki/Fritz_Langhttp://en.wikipedia.org/wiki/Brigitte_Helmhttp://en.wikipedia.org/wiki/Humanoid_robothttp://en.wikipedia.org/wiki/Gynoidhttp://en.wikipedia.org/wiki/Maschinenmenschhttp://en.wikipedia.org/wiki/Robotics#cite_note-KapekWebsite-4http://en.wikipedia.org/wiki/Josef_Capekhttp://en.wikipedia.org/wiki/Oxford_English_Dictionaryhttp://en.wikipedia.org/wiki/Oxford_English_Dictionaryhttp://en.wikipedia.org/wiki/Etymology
  • 7/31/2019 coursefor12th.docx

    3/25

    2. Locomotion in Robotics

    Rolling robots

    For simplicity most mobile robots have fourwheels or a number ofcontinuous tracks. Some researchers have tried to create more complexwheeled robots with only one or two wheels. These can have certainadvantages such as greater efficiency and reduced parts, as well asallowing a robot to navigate in confined places that a four wheeled robotwould not be able to.

    Two-wheeled balancing robots

    Balancing robots generally use a gyroscope to detect how much a robot isfalling and then drive the wheels proportionally in the opposite direction, tocounter-balance the fall at hundreds of times per second, based on thedynamics of an inverted pendulum. Many different balancing robots havebeen designed. While the Segway is not commonly thought of as a robot, itcan be thought of as a component of a robot, such as NASA's Robonautthat has been mounted on a Segway.

    http://en.wikipedia.org/wiki/Wheelhttp://en.wikipedia.org/wiki/Continuous_trackhttp://en.wikipedia.org/wiki/Gyroscopehttp://en.wikipedia.org/wiki/Inverted_pendulumhttp://en.wikipedia.org/wiki/Segway_PThttp://en.wikipedia.org/wiki/NASAhttp://en.wikipedia.org/wiki/Robonauthttp://en.wikipedia.org/wiki/File:Segway_01.JPGhttp://en.wikipedia.org/wiki/Robonauthttp://en.wikipedia.org/wiki/NASAhttp://en.wikipedia.org/wiki/Segway_PThttp://en.wikipedia.org/wiki/Inverted_pendulumhttp://en.wikipedia.org/wiki/Gyroscopehttp://en.wikipedia.org/wiki/Continuous_trackhttp://en.wikipedia.org/wiki/Wheel
  • 7/31/2019 coursefor12th.docx

    4/25

    One-wheeled balancing robots

    Main article:Self-balancing unicycle

    A one-wheeled balancing robot is an extension of a two-wheeled balancing

    robot so that it can move in any 2D direction using a round ball as its onlywheel. Several one-wheeled balancing robots have been designedrecently, such as Carnegie Mellon University's "Ballbot" that is theapproximate height and width of a person, and Tohoku Gakuin University's"BallIP". Because of the long, thin shape and ability to maneuver in tightspaces, they have the potential to function better than other robots inenvironments with people.

    Six-wheeled robots

    Using six wheels instead of four wheels can give better traction or grip inoutdoor terrain such as on rocky dirt or grass.

    Tracked robots

    Tank tracks provide even more traction than a six-wheeled robot. Trackedwheels behave as if they were made of hundreds of wheels, therefore arevery common for outdoor and military robots, where the robot must drive onvery rough terrain. However, they are difficult to use indoors such as oncarpets and smooth floors. Examples include NASA's Urban Robot"Urbie".[55]

    http://en.wikipedia.org/wiki/Self-balancing_unicyclehttp://en.wikipedia.org/wiki/Carnegie_Mellon_Universityhttp://en.wikipedia.org/wiki/Ballbothttp://en.wikipedia.org/wiki/Robotics#cite_note-54http://en.wikipedia.org/wiki/Robotics#cite_note-54http://en.wikipedia.org/wiki/Robotics#cite_note-54http://en.wikipedia.org/wiki/Robotics#cite_note-54http://en.wikipedia.org/wiki/Ballbothttp://en.wikipedia.org/wiki/Carnegie_Mellon_Universityhttp://en.wikipedia.org/wiki/Self-balancing_unicycle
  • 7/31/2019 coursefor12th.docx

    5/25

    3.Motor and its control

    The output system consists of the motors (DC geared or withoutgears) and a motor driver (L293D IC).For the line follower robot we have two DC motors attached with thewheels.Dc motors are most easy to control. A DC motor requires only twosignals for its operation. To change its direction we just need toreverse the polarity of the battery.

    *DC geared motors are advantageous over the DC motors withoutgears because the torque provided by the geared motors is quite highas compared to the simple ones.

    The use of two motors:By using two motors we can move the robot in any direction. Thissteering mechanism of the robot is called differential drive.Lets check how it works.

    counterclockwise.(SHARP LEFT TURN)Left wheel is reversed and the right wheel is forwarded

    stopped and the right wheel is forwarded

    forwarded and right wheel is stopped.

    forwarded and right wheel is reversed.

  • 7/31/2019 coursefor12th.docx

    6/25

    4.Introduction to Microcontrollers

    A microcontroller(also MCU or _C) is a functional computersystem-on-a-chip. It contains a processor core, memory, andprogrammable input/output peripherals.Microcontroller is sum times compared to microprocessor butthere are significant differences between them. Microprocessoris just the processing unit while microcontroller is the wholesystem on chip (including the input/output ports, RAM, ROMetc).

    What is the difference between microcontroller and

    microprocessor?

    Microcontroller Microprocessor

    1. It is also known as systemon chip i.e. processor, I/OPorts, Timer, interrupt, RAM,

    ROM on a single chip.

    1. It is just the processing unit.External RAM, ROM, Bus, I/OPorts, must be added to make a

    functional unit.

    2. It is also known as MPU

    (micro processing unit).

    2. It is also known as CPU

    (central processing unit).

    3. This type of system is cost

    efficient.

    3. System becomes costly and

    bulky.

    8051 microcontroller was introduced in 1981 by INTELCorporation. Its a 8 bit microcontroller (CPU works on 8 bits at

  • 7/31/2019 coursefor12th.docx

    7/25

    a time)8051 microcontrollerThe 8051 is the original member of the 8051 family. Intel refersto it as MCS-51.Here is a table showing its main features.

    Feature QuantityROM 4K bytesRAM 128 bytesTimer 2

    I/O Pins 32Serial port 1Interrupt sources 6

    ARCHITECTURE OF 8051The simple architecture of 8051 microcontroller is shown in thefollowing figure.

  • 7/31/2019 coursefor12th.docx

    8/25

    This figure shows the main features and components that thedesigner can interact with. The 8051 microcontroller has 4different ports, each one having 8 Input/output lines providing atotal of 32 I/O lines. Those ports can be used to output DATAand orders do other devices, or to read the state of a sensor, or a

    switch. Most of the ports of the 8051 have 'dual function'meaning that they can be used for two different functions: thefist one is to perform input/output operations and the second oneis used to implement special features of the microcontroller likecounting external pulses, interrupting the execution of theprogram according to external events, performing serial data

  • 7/31/2019 coursefor12th.docx

    9/25

    transfer or connecting the chip to a computer to update thesoftware. Each port has 8 pins, and will be treated from thesoftware point of view as an 8-bit variable called 'register', eachbit being connected to a different Input/ Output pin. You can

    also notice two different memory types: RAM and EEPROM.Shortly, RAM is used to store variable during programexecution, while the EEPROM memory is used to store theprogram itself, that's why it is often referred to as the 'programmemory'.The special features of the 8051 microcontroller are grouped inthe blue box at the bottom of figure. 8051 incorporates hardwarecircuits that can be used to prevent the processor from executing

    various repetitive tasks and save processing power for morecomplex calculations. Those simple tasks can be counting thenumber of external pulses on a pin, or generating precise timingsequences.It is clear that the CPU (Central Processing Unit) is the heart ofthe microcontrollers; it is the CPU that will Read the program

    PIN DESCRIPTION OF 8051

  • 7/31/2019 coursefor12th.docx

    10/25

    PIN DESCRIPTION (MUST FOR ALL)1. Port 0: Pins 32-40 are the 8 pins of port 0.They are used asaddress lines or data lines when the microcontroller isinterfaced with external memory.2. Port 1: Pins 1-8 are the 8 pins of port 1.3. Port 2: Pins 21 to 28 are the pins of port 2.They are used asaddress lines when microcontroller is interfaced with externalmemory.4. Port 3: Pins 10-17 are pins of port 3.Cn be used for specialpurpose as mentioned in brackets.5. Pin 9:Reset pin; when high its sets the value of program

  • 7/31/2019 coursefor12th.docx

    11/25

    counter to first instruction, hence whole code is executed fromthe beginning.6. RXD: Serial input port.7. TXD: Serial output port.

    8. INT0: External interrupt 0(active low).9. INT1: External interrupt 1(active low).10. T0: Timer 0 external input.11. T1: Timer 1 external input.12. WR: External data memory write strobe (active low).13. RD: External data memory read strobe (active low).14. XTAL2 and XTAL1: Oscillator(freq-11.0592 MHz).15. GND: Ground potential.

    16. VCC: Supply voltage.17. EA/VPP: for external memory interfacing (active18. ALE: address latch enable, to use port 0 as address lines ordata lines with external memory interfacing (High-address;low-data).19. PSEN: It is the read strobe to external program memory

    6. PROGRAMMING ORMICROCONTROLLER IN CProgramming of the microcontroller can be done inassemblylanguage or C language. Compiler produce Hex file that isburned into the microcontroller (size of Hex file should besmall because we have limited on-chip ROM).Whileassemblylanguage produces a hex file which is much smaller thanC,programming in assembly is quite tedious and timeconsuming.

    C DATA TYPES FOR 8051

  • 7/31/2019 coursefor12th.docx

    12/25

    1. Unsigned char: Its a 8-bit data type, takes a value 0-255(00-FFH).Most widely used data type.*In declaring variables, we must pay attention to size of

    dataand try to use unsigned char in place of int if possible.Because the 8051 has limited amount of RAM, using int inplace of char data type will cause large Hex file.e.g 8051 C program to toggle all the bits of P1continuously//Toggle P1 forever#include

    Void main (void){for (;;) //repeat forever{P1=0x55; //0x indicate Hex dataP1=0xAA;}

    }2. Signed char:8 bit data type ,uses the MSB to denoteve or+ve. Has a range of -128 to +127.3. Unsigned int:16 bit data type, can take values from 0-65535(0000-FFFFH).4. Signed int:16 bit data type, uses MSB for sign, range is-32,768 to +32,767.5. Sbit: The Sbit keyword is widely used 8051 C data typedesigned to access single bit addressable registers. Itallowaccess to single bits of SFRs.

  • 7/31/2019 coursefor12th.docx

    13/25

    e.g 8051 program to toggle bit D0 of the port P1 (P1.0)50,000 times.#include

    Sbit MYBIT=p1^0; //sbit is declared outside mainVoid main (void){Unsigned int z;for (z=0;z

  • 7/31/2019 coursefor12th.docx

    14/25

    Delay(250);P1=0xAA;Delay(250);

    }}Void Delay (unsigned int itime){Unsigned int I,j;for (i=0;i

  • 7/31/2019 coursefor12th.docx

    15/25

    }*I/O ports are also bit addressable as shown in theprevious

    examples.USING BIT DATA TYPE FOR BIT ADDRESSABLERAMsbit data type is used for bit addressable SFRs only.Sometimes we need to store some data in the bitaddressablesection of RAM space 20-2FH.to do so we need bit datatype.

    Its use is as shown below.e.g get the status of P1.0,save it and send it to P2.7continuously.#include Sbit inbit =P1^0;Sbit outbit=P2^7; //sbit is used to declare SFR bitsBit membit; //bit addressable memory

    Void main (void){While (1){Membit=inbit; //get bit from P1.0Outbit=membit; //send it to P2.7}}ACCESSING CODE ROM SPACE IN 8051 CUsing the code(program) space for predefined data type isthewidely used option in the 8051.To make C compiler usethe

  • 7/31/2019 coursefor12th.docx

    16/25

    code space instead of the RAM space we need to put thekeyword code in front of variable declaration. e.gcode unsigned char mynum[]=012345ABCD;

    LINE FOLLOWER ROBOT

    A line following robot is a self operating robot which follows a path(black line on white floor or vice versa).The task is to sense theline and

  • 7/31/2019 coursefor12th.docx

    17/25

    remain on the desired path. The robot is designed to follow tightcurves.Here are some samples of path that a line follower needs tofollow.

    Width of path can vary from 3cm to 5cm.There can be somelateraldisplacement too.These are very simple paths to follow and in most of thecompetitionsthe task can be a bit tedious.

    BASIC DESIGN AND REQUIREMENTSThe robot is build using ATMEL microcontrolloer(AT89C51),IR

    sensors,LM324 IC,two motors(dc motors with or withoutgears),motor driver(L293D IC),mounted on chassi(toy car oraluminium sheets).Sensors are placed facing downward towardsthepath.

    Basic operation:1.capture the line position with the help of of IR sensors.2.Decide the logic;what to do(move straight,left or right) with the

    codecontained by the microcontroller3.Steer the robot to the track.For this we use two motors togovern themovement of the wheels.

    Block diagram:The above mentioned block diagram shows the basic design ofline

    follower. The sensors and comparator comprises input system,microcontroller is the processing system and motor driver andmotorsform the output system of robot.Now lets see the details of the systems

    INPUT SYSTEM

  • 7/31/2019 coursefor12th.docx

    18/25

    SensorsEach opto coupler(the sensor that we are using) has one emitter(IRLED) and a receiver (photo transistor or photo diode).If white space is present beneath the IR LED then IR rays arereflectedand they are sensed by the receiver, while in case of blacksurface all ofSENSORS

    COMPARATOR

    IC

    LM 324

    MICROCONTROLLOER

    AT89C51

    MOTOR DRIVER

    L293D

    M1

    M2

    the IR rays are absorbed by the surface and nothing is sensed bythereceiver.Photo diode has a property that its electric resistance decreaseswhen IR

    rays fall on it. Hence in case of white surface the electricresistance ofthe receiver is less than the case of black surface.The circuit used for sensors is:R1=300 and R2=10KThe +ve power supply is 5V.Let Vp is the output voltage to comparator.*When there is black line then no IR light is sensed by the

    receiver andits resistance is high. So the output voltage Vp is also high (approx4.68V).*When there is white line then IR rays are sensed by the receiverand its

  • 7/31/2019 coursefor12th.docx

    19/25

    resistance decreases hence output voltage also decreases(approx 2.5V).*The reference voltage is set as the mean of the outputvoltage(Vp) at the

    time of black line and the white line.Vref=(4.68+2.5)/2=3.59V

    Comparator:Comparator is a device which compares two input voltages andgivesoutput as high or low. In a circuit diagram it is shown as a trianglehaving two inputs(+ve andve) and a output.+ve or non inverting input is given reference voltage in this case. -

    ve orinverting input is provided with the output of the sensors.*Incase of white path Vrefis greater than the other input, So, theoutputof comparator is high. While in case of black line Vrefis less thantheother input. So the output of the comparator is low.We use LM324 IC for the comparator:

    There are four comparators in this IC.So it can support upto foursensors.

    Arrangement of sensorsAny number of sensors can be used while making line follower.

    A simple line follower can be made with just two sensors.

    If we use more sensors(say more than 4),the programmingbecomes complex and the hardware requirements are more.

    Using more number of sensors accurately increases the

    accuracy.Different arrangements for the placement of sensors can alsobeused .e.g we can use array of sensors,we can place the sensorsinV shape or we can have sensors placed at the corners of a

  • 7/31/2019 coursefor12th.docx

    20/25

    rhobus(diagonal).Here lets take the simplest example of two sensors placed justoutsidethe line(path is black on white surface).

    Sensor 1 Sensor 2Simple logic behind this arrangement is that the sensors areplaced justoutside the line. As soon as one of them detects black, then wecanconclude that the robot is deviating from the path and we cancorrect itsmove.

    Tips for the input systemPCBs are used for the circuit. Breadboard is not preferable

    becauseit has loose connections (breadboard is just used for the moduletesting).

    Proper orientation of IR LEDs should be done (there distance

    fromthe surface should not be more than 1.5cm).The other two important components used in the line followercircuitare voltage regulator and the potentiometer.

    Voltage regulator:Voltage regulator fixed DC output voltage from a varying DCsource.

    As the microcontroller and other IC require constant DC supply of5V,So we use voltage regulator.They help to maintain a steady voltage level despite variouscurrentdemands and varying input voltages. There are three pins in the

    1 3

    2

  • 7/31/2019 coursefor12th.docx

    21/25

    voltage regulator. Middle one (pin no. 2) is grounded, pin no. 1 isgiven the input(7-12V) and we get the output(5V) from pin no. 3.

    Potentiometer:Potentiometer is the variable resistor which is used to vary theresistance by rotating the shaft. They are available in the range of100 to 470K.Potentiometer is used as the voltage divider in the circuit.

    POTENTIOMETERLead A is connected to V(5V) and lead B is connected to ground.Then we can vary voltage from 0V to 5V and the output is takenfromthe lead W. Potentiometer is used to generate reference voltage

    forLM324 IC.

    PROCESSING SYSTEMProcessing system is the brain of the robot which generatesdesiredoutput corresponding to the inputs. Microcontroller is theprocessingsystem of our line follower robot. Microcontroller are present in

    different forms such as 8051,AVR and PIC. Also a lot ofcompaniesalso produce microcontroller. We are using ATMEL AT89C51, it is8051 microcontroller.

    Hardware details:The basics of 8051 microcontroller are already discussed. Belowisthe connection diagram for 8051 microcontroller for the line

    followerrobot.The connections are as follows:

    Pin no. 9,31 and 40 are connected to Vcc (5V).

    Pin no.20 is connected to ground.

    Pin no 18 and 19 are connected to oscillator.

  • 7/31/2019 coursefor12th.docx

    22/25

    Pin no. 1 and 2 i.e. P1.0 and P1.1 are used for the output fromthe comparator corresponding to the two sensors.

    Pin no 21 to 26. i.e. P2.0 to P2.5 are used to connect the motordriver (Interfacing of motors and the motor driver is dealt in

    detail in a short while).P2.5=-ve of left motorP2.4=-ve of right motorP2.3=Enable for left motorP2.2=+ve of left motorP2.1=Enable for right motorP2.0=+ve of right motor

    Software details:The program code acts as the decision maker embedded in themicrocontroller i.e. it decides what would be the outputcorresponding to each set of input.Programs can be written in assemble or C language. C languageiseasier to use. The program is compiler and simulated with thehelp ofsoftware, KEIL C. KEIL C generates a hex file which is burned

    intomicrocontroller.Here is the code for our line follower having 2 sensors.#include void main(void){P1=0xFF;P2=0x00;

    while(1){if(P1^0==1 &&P1^1==1)P2=0x0F;else if(P1^0==0 &&P1^1==1)P2=0x0B;

  • 7/31/2019 coursefor12th.docx

    23/25

    else if(P1^0==1 &&P1^1==0)P2=0x0E;}}

    OUTPUT SYSTEMThe output system consists of the motors (DC geared or withoutgears) and a motor driver (L293D IC).For the line follower robot we have two DC motors attached withthewheels.Dc motors are most easy to control. A DC motor requires only twosignals for its operation. To change its direction we just need to

    reverse the polarity of the battery.*DC geared motors are advantageous over the DC motors withoutgears because the torque provided by the geared motors is quitehighas compared to the simple ones.

    The use of two motors:By using two motors we can move the robot in any direction. Thissteering mechanism of the robot is called differential drive.

    Lets check how it works.To rotate robot counterclockwise.(SHARP LEFT TURN)Left wheel is reversed and the right wheel is forwarded

    To rotate robot counterclockwise.( LEFT TURN): Left wheel isstopped and the right wheel is forwarded

    To rotate robot clockwise.( RIGHT TURN):left wheel isforwarded and right wheel is stopped.

    To rotate robot clockwise.(SHARP RIGHT TURN):left wheel is

    forwarded and right wheel is reversed.To move straight: both motors forwarded.

    Motor driver:We cannot connect the motor directly to the microcontrollerbecause

  • 7/31/2019 coursefor12th.docx

    24/25

    microcontroller can not provide required current to drive DCmotor.Motor driver is a current enhancing device; it is also used asswitching device.

    Motor driver takes input from the microcontroller and generatestheoutput signal for the motor. IC L293D is used as motor driver.L293D ICIts a 16 pin IC. This IC can drive two motors simultaneously. Description of the IC:

    Pin no. 1 and 9 are ENABLE pins to make a channel active.Pin 1 to P2.3

    Pin 9 to P2.1Pin no 4,5,12 and 13 are connected to ground.

    Pin no. 16 is the logic supply voltage i.e. the voltage we need toprovide to the motor.

    Pin no 8 is the supply voltage.

    Pin no 2,7,10 and 15 are input pins connected to themicrocontroller. In our robot,Pin 2 to P2.2

    Pin 7 to P2.5Pin 15 to P2.0Pin 10 to P2.4.Here we have discussed the line following robots systems. Afterthemodule testing of all the systems is done, the circuit is assembledon aPCB; universal PCB can be used for this purpose. The placement

    ofsensors and the code is path dependent. I.e. The path should betakeninto consideration for the sensors and for writing the algorithm.This study material is just the starting and all of you need toexplore the

  • 7/31/2019 coursefor12th.docx

    25/25

    world of robotics on your own.