Final Rover Report

download Final Rover Report

of 48

Transcript of Final Rover Report

  • 8/8/2019 Final Rover Report

    1/48

    ROVER 2010

    PREFACE The main objective of this project is to design an obstacledetection and collision avoidance robot with help of IR sensorsembedded around the body of robotic vehicle. This design can beused in fully automated vehicles like cars, moving materials inindustries and similar other commercial applications. Starting withan overview of the system the document would coverimplementation details like components used, circuits andalgorithms, problems faced during designing of the obstacledetection and collision avoidance robot. It has also beendescribed that how the microcontroller program has beenembedded in the microcontroller with the help of a burner device.

    Some suggestions on improving the design and its commercialapplication have also been discussed in the later part of thedocument.

    The Reference and Resources page has a list of relevant books,websites, electronic shops and commonly used parts & theirprices.

    1

  • 8/8/2019 Final Rover Report

    2/48

    ROVER 2010

    ABSTRACT

    The robot uses three IR sensors to sense any obstacle in its path. The data coming from those sensors are fed into voltagecomparators where the sensor data is compared with a fixedreference voltage. After the comparison of sensor data and theVref, the voltage comparator gives output as OV for presence ofany obstacle and 5 V for absence of obstacle. This output ofcomparator circuit is fed into the microcontroller in which decisionmaking program is stored .The microcontroller process uses theoutput of comparator circuit according to the program stored in it

    and gives output at another port. The output of microcontroller isfed into the motor driver circuit which amplifies the low outputcurrent coming from microcontroller so that its output becomescapable to drive the DC motors fitted in the robotic vehicle base.

    2

  • 8/8/2019 Final Rover Report

    3/48

    ROVER 2010

    Block diagram of Rover

    3

  • 8/8/2019 Final Rover Report

    4/48

    ROVER 2010

    Circuit diagram of Rover

    The output of voltage comparator circuit is fed as input in themicrocontroller at port 0.The output of microcontroller is taken atport 1 and port 2 and fed into motor driver L293D. Following pinsare taken as input in the microcontroller:

    Pin 0 .0 - Left sensor

    4

  • 8/8/2019 Final Rover Report

    5/48

    ROVER 2010

    Pin 0 .1 - Front sensor

    Pin 0.2 - Right sensor

    Following pins are taken as output from the microcontroller

    For motor 1 Pin1.0 . Pin 1.1

    For motor 2 Pin2.0

    Pin 2.1Eight 10k pull up resistors are connected to the microcontrollerat port P0. Rest of the ports have inbuilt pullup resistors, so thereis no need to connect pull-up resistors to port1 , port2 and port3.

    COMPONENTS USED

    IR Transmitter and Reciever

    Microcontroller (AT89S52)

    Motor Driver(L293D)

    Timer (LM555)

    DC Motor

    Voltage Regulator(LM7805)

    Variable Resistance

    IR Transmitter

    5

  • 8/8/2019 Final Rover Report

    6/48

    ROVER 2010

    The IR Transmitter block is used to generate IR signal. It usestimer IC555 in astable multivibrator mode to generate squarewave which have continuous pulses of 50% duty cycle offrequency 38 KHz.

    6

  • 8/8/2019 Final Rover Report

    7/48

    ROVER 2010

    Circuit diagram IR transmitter

    IR receiver Tsop (1738)

    Description

    7

  • 8/8/2019 Final Rover Report

    8/48

    ROVER 2010

    IR sensor (TSOP 1738) which gives normally 5v at itsoutput but. after receiving infrared light , output of sensor is 0v.

    The TSOP17.. series are miniaturized receivers for infraredremote control systems.

    The demodulated output signal can directly be decoded by amicroprocessor.

    Features

    8

  • 8/8/2019 Final Rover Report

    9/48

    ROVER 2010

    Improved shielding against electrical field disturbance

    Output active low Low power consumption High immunity against light

    Continuous data transmission possible (up to 2400 bps) Suitable burst length 10 cycles/burst

    Circuit diagram IR receiver

    9

  • 8/8/2019 Final Rover Report

    10/48

    ROVER 2010

    IR sensor Module

    MICROCONTROLLER(AT89S52)

    The AT89S52 is a low-power, high-performance CMOS 8-bitmicrocomputer with 8 Kbytes of Flash programmable and

    10

  • 8/8/2019 Final Rover Report

    11/48

    ROVER 2010

    erasable read only memory (PEROM). The device is manufacturedusing Atmels high density nonvolatile memory technology and iscompatible with the industry standard 80C51 instruction set andpin out.

    The on-chip Flash allows the program memory to bereprogrammed in system or by a conventional nonvolatilememory programmer. By combining a versatile 8-bit CPU withFlash on a monolithic chip the Atmel AT89S52 is a powerfulmicrocomputer which provides a highly flexible and cost effectivesolution to many embedded control applications.

    AT89S52

    Pin Configurations:

    11

  • 8/8/2019 Final Rover Report

    12/48

    ROVER 2010

    Pin DescriptionVccSupply voltageGNDGround

    Port 0

    Port 0 is an 8-bit bidirectional IO port. As an output port eachpin can sink eight TTL inputs. When 1s are written to port 0pins, the pins can be used as inputs.

    Port 0 can also be configured to be the multiplexed low-orderaddress data bits during accesses to external program anddata memory.

    12

  • 8/8/2019 Final Rover Report

    13/48

    ROVER 2010

    Port 0 also receives the code bytes during Flashprogramming and outputs the code bytes during programverification. External pull-ups are required during programverification.

    Port 1

    Port 1 can be used as input or output, In contrast to port 0, this port doesnot need any pull-up resistors since it already has pull-up resistors internally. Upon

    reset, port 1 is configured as an input port.To make port 1 an input port, itmust be programmed as such by writing 1to all its bits

    Port 2

    Port 2 is an 8-bit bidirectional I/O port with internal pull-ups.

    The Port 2 output buffers can sink/source for TTL inputs. When 1s are

    written to Port 2 pins, they are pulled high by the internal pull-ups and can

    be used as inputs.

    Port 2 emits the high-order address byte during fetches from external

    program memory and during accesses to external data memory that uses 16-

    bit address.

    Port 2 also receives the high-order address bits and somecontrol signals during Flash programming and verification.

    Port 3

    Port 3 is an 8-bit bidirectional I/O port with internal pull-ups.

    The Port 3 output buffers can sink/source for TTL inputs.When 1s are written to Port 3 pins, they are pulled high bythe internal pull-ups and can be used as inputs.

    Port 3 also receives some control signals for Flash

    programming and programming verification.

    13

  • 8/8/2019 Final Rover Report

    14/48

    ROVER 2010

    RST

    Reset input. A high on this pin for two machine cycles while theoscillator is running resets the device.

    ALE/PROGAddress Latch Enable is an output pulse for latching the low byteof the address during access to external memory. This pin is alsothe program pulse input (PROG) during Flash programming.In normal operation ALE is emitted at a constant rate of 1/6 theoscillator frequency and may be used for external timing orclocking purposes.

    XTAL1Input to the inverting oscillator amplifier and input to the internalclock operating circuit.

    XTAL2Output from the inverting oscillator amplifier

    XTAL1 and XTAL2 are the input and output, respectively, of aninverting amplifier that can be configured for use as an on-chip

    oscillator, as shown in Figure below. Either a quartz crystal orceramic resonator may be used. To drive the device from anexternal clock source, XTAL2 should be left unconnected whileXTAL1 is driven, as shown in Figure below.

    14

  • 8/8/2019 Final Rover Report

    15/48

    ROVER 2010

    15

  • 8/8/2019 Final Rover Report

    16/48

    ROVER 2010

    MOTOR DRIVER(L293D)

    The Device is a monolithic integrated high voltage, high current

    driver designed to accept standard TTL logic levels and driveinductive loads (such as relays solenoids, DC and steppingmotors) and switching power transistors.

    The L293D can drive current of up to 600mA with voltage range of4.5 to 36 volts. It is suitable to drive small DC-Geared motors,

    bipolar stepper motor etc.

    Specifications. Supply Voltage Range 4.5V to 36V. 600-mA Output current capability per driver. Separate input- logic supply

    16

  • 8/8/2019 Final Rover Report

    17/48

    ROVER 2010

    Thermal Shutdown

    High-Noise-immunity inputs

    PIN CONFIGURATION

    Pinout of L293D

    Circuit implementation

    L293DL293D motor driver needs two voltage levels 12V at pin no.8 5V at pin no. 1 ,9 and 16.

    The main function of driver is to amplify the 15mA current,

    17

  • 8/8/2019 Final Rover Report

    18/48

    ROVER 2010

    coming from the microcontroller which is incapable to drive 50mArating motor it can give output current upto 600mA.

    L293d as Driver Circuit

    The driver circuit basically consists two H-bridges for diving smallDC motors. In a H-bridge circuit there are four transistors of whichonly two are in ON state which are located diagonally. The twopairs of transistors gives the bidirectional rotation of motor.

    18

  • 8/8/2019 Final Rover Report

    19/48

    ROVER 2010

    OTHERS

    TIMER(LM555)

    General Description

    The LM555 is a highly stable device for generating accurate timedelays or oscillation. Additional terminals are provided fortriggering or resetting if desired. In the time delay mode ofoperation, the time is precisely controlled by one external resistorand capacitor. For astable operation as an oscillator, the freerunning frequency and duty cycle are accurately controlled withtwo external resistors and one capacitor.

    LM555

    19

  • 8/8/2019 Final Rover Report

    20/48

  • 8/8/2019 Final Rover Report

    21/48

    ROVER 2010

    Dc Motor(45rpm)

    Here a bidirectional DC motor is used so that the motors canmove in both forward and backward directions ,dodging anyobstacle that comes in its path.

    VOLTAGE REGULATOR

    (LM7805) The LM78M05, a three-terminal positive voltage regulatoremploys built-in current limiting, thermal shutdown, andprotection mechanism which makes them virtually immune to

    damage from output overloads. With adequate heat sinking, theycan deliver in excess of O.5A output current.

    Features

    Output current in excess of 0.5A

    No external components

    Internal thermal overload protection

    Output voltages of 5V

    21

  • 8/8/2019 Final Rover Report

    22/48

    ROVER 2010

    CIRCUIT IMPLEMENTATIONvoltage Regulator is needed as because we have different voltagelevel requirement in different components e.g motor requires 12vsupply but circuits like microcontroller board and voltagecomparator require only 5 V supply.

    LM7805

    22

  • 8/8/2019 Final Rover Report

    23/48

    ROVER 2010

    VARIABLE RESISTANCE

    Variable resistors consist of a resistance track with connections atboth ends and a wiper which moves along the track as you turnthe spindle. The track may be made from carbon, ceramic andmetal mixture or a coil of wire (for low resistances). The track isusually rotary but straight track versions, usually called sliders,

    are also available. Variable resistors are often calledpotentiometers in books and catalogs. They are specified by theirmaximum resistance, linear or logarithmic track, and theirphysical size. The standard spindle diameter is 6mm.

    Mechanical designIt is made up of light weight material , steel which provides easymovement of the robotic vehicle. It has folowing provisions in it: Slot for DC motors.

    Rear support wheel. Slot to clamp sensors. 12V battery holder.

    23

  • 8/8/2019 Final Rover Report

    24/48

    ROVER 2010

    ALGORITHM

    While (1)

    {

    Read sensor input

    if left_obstacle

    {

    Stop

    Move back

    Move right

    }

    elseif right_obstacle

    {

    Stop

    Move back

    Move left

    }

    elseif front_obstacle

    {

    Stop

    Move back

    24

  • 8/8/2019 Final Rover Report

    25/48

    ROVER 2010

    Move left

    }

    elseif left && front obstacle

    {

    Stop

    Move back

    Move right

    }

    elseif right && front obstacle

    {

    Stop

    Move back

    Move left

    }

    elseif left && right obstacle

    {

    Stop

    Move back

    Move left

    }

    elseif left && front && right obstacle

    {

    25

  • 8/8/2019 Final Rover Report

    26/48

    ROVER 2010

    Stop

    Move back

    Move left

    }

    else

    Move forward

    }

    }

    26

  • 8/8/2019 Final Rover Report

    27/48

    ROVER 2010

    SCREEN SHOTS OF KEIL PROGRAMING

    Program written for the microcontroller chip is compiled usingthe well known compiler keil uvision 4 which provides extensivelibrary for various microcontrollers and then converts the programinto hex file which is used to burn the flash of the microcontroller.It also provides various utilities for debugging and simulation.

    27

  • 8/8/2019 Final Rover Report

    28/48

    ROVER 2010

    28

  • 8/8/2019 Final Rover Report

    29/48

    ROVER 2010

    29

  • 8/8/2019 Final Rover Report

    30/48

    ROVER 2010

    SCREEN SHOTS OF LOADING PROGRAM

    30

  • 8/8/2019 Final Rover Report

    31/48

    ROVER 2010

    31

  • 8/8/2019 Final Rover Report

    32/48

    ROVER 2010

    32

  • 8/8/2019 Final Rover Report

    33/48

  • 8/8/2019 Final Rover Report

    34/48

    ROVER 2010

    34

  • 8/8/2019 Final Rover Report

    35/48

    ROVER 2010

    35

  • 8/8/2019 Final Rover Report

    36/48

    ROVER 2010

    36

  • 8/8/2019 Final Rover Report

    37/48

    ROVER 2010

    PROBLEMS FACED

    FAULTY MlCROCONTROLLER BOARD

    37

  • 8/8/2019 Final Rover Report

    38/48

    ROVER 2010

    The first microcontroller we used had its write enablefailed. Perhaps it was damaged during transportation.Then we used other microcontroller but after burning themicrocontroller using the first code it seemed that no

    program was written at all in the flash memory. Later onwe found that the microcontroller had some inherentproblem and we had to replace it.

    Keil programming

    The microcontroller board was not giving output as it seemed thatno program was stored in microcontroller although we had burnt

    the program. After detailed analysis of the program we found thatwe had not defined certain pins and then we made necessarymodifications in our program. Moreover we had to burn the flashmemory several times because the initial program did not takeinto account several scenarios which became evident only aftertest run. Finally after several iterations through the program wefinally created a robust code.

    MOTOR DRIVER CIRCUIT

    Initially we decided to use ULN2003 as motor driver circuit as it isa darling on pair connection which also amplifies current but wewere unable to drive the motor with the help of this IC. Then wedecided to use L293D which as it has itself built-in two H bridgecircuits. This time we were successful to drive both the motors.

    EXCESSIVE HEATING OF LM7805

    we observed that when power supply was given continuously formore than 6 to 7 mins. LM7805 got heated upto undesirable levelenough to burn human skin. To overcome this excessive heat weincorporated almnini heat sink with both the LM7805 ICs.

    FUTURE SCOPE

    38

  • 8/8/2019 Final Rover Report

    39/48

    ROVER 2010

    Some of the improvements that can be made are the following:

    The rover can be made to follow a specific pattern with slightchange in the program. Such improvement could be used inindustries where robots have to only traverse a specific path.

    The rover can be instructed dynamically over the wireless tofollow a particular path depending upon the information sentto the base station. Such systems can be used as intelligenttransport systems without the need of a driver.

    The rover can also be used as vaccum cleaner with slightchange in hardware and programming.

    The rover can also be used as lawn mover after makingnecessary changes.

    It can also be used as firefighting robot after incorporation ofthermal sensors and fire fighting mechanism and change incode.

    It can also be used as mine detector after addition of minedetecting module and necessary change in programming.

    Increment in number of sensors to enhance the obstacledetection capability

    It can also be used as a spy robot.

    DATA SHEETS

    39

  • 8/8/2019 Final Rover Report

    40/48

    ROVER 2010

    40

  • 8/8/2019 Final Rover Report

    41/48

    ROVER 2010

    41

  • 8/8/2019 Final Rover Report

    42/48

    ROVER 2010

    42

  • 8/8/2019 Final Rover Report

    43/48

    ROVER 2010

    43

  • 8/8/2019 Final Rover Report

    44/48

    ROVER 2010

    44

  • 8/8/2019 Final Rover Report

    45/48

  • 8/8/2019 Final Rover Report

    46/48

    ROVER 2010

    46

  • 8/8/2019 Final Rover Report

    47/48

    ROVER 2010

    47

  • 8/8/2019 Final Rover Report

    48/48

    ROVER 2010

    REFERENCE AND RESOURCES

    The 8051 Microcontroller and Embedded Systems Using

    Assembly and C Second Edition byMuhammad Ali Mazidi

    Basic electronics by Millman Halkyies

    understanding electronic components by fillopovic d miomir

    Wikipedia/microcontroller

    www.engineeringprojects.org

    http://indianengineer.blog.co.in

    www.8051projects.com

    Basic Tutorial for Keil software Written bywww.microdigitalEd.com

    http://www.engineeringprojects.org/http://indianengineer.blog.co.in/http://www.8051projects.com/http://www.engineeringprojects.org/http://indianengineer.blog.co.in/http://www.8051projects.com/