MobilePhone Controlled Robot Complete Document

download MobilePhone Controlled Robot Complete Document

of 10

Transcript of MobilePhone Controlled Robot Complete Document

  • 7/21/2019 MobilePhone Controlled Robot Complete Document

    1/10

    Mobile Phone

    Operated Land Rover

    Raghavendra,Rahul

    www.raghu.co.nr

    [email protected]

  • 7/21/2019 MobilePhone Controlled Robot Complete Document

    2/10

    obotics is an interesting fieldwhereevery engineer can showcasehis creative and technical

    skills.Pleasingaspectofrobotics isthatarobotcanbemade indigenouslybyanyone. Inthis

    competitiveworldthereisneedforeveryenthusiastic,fromamateurtoprofessional,tomakea

    simplerobothavinginnovatedapplicationsandwithrobustcontrol.

    Mobilephones

    today

    became

    an

    essential

    entity

    for

    one

    and

    all

    and

    so,

    for

    any

    mobile

    based

    application

    there isgreat reception. In this scenariomakingamobilephoneoperated land rover isagood idea.

    Conventionallywireless controlled robotsutilize RF circuits,whichhad limitations like limited range,

    limited frequency ranges and controls. But a mobile phone controlled robot can hold up these

    limitations. Ithasarobustcontrol,unlimitedrange (coverageareaoftheserviceprovider),no fearof

    interferingwithothercontrollersandwecanhaveasmuchas12controls.

    Although the appearance and capabilities of robots vary vastly, all robots share the features of a

    mechanical,movablestructureundersomeformofcontrol.Thiscontrolofrobotinvolvesthreedistinct

    phases perception, processing and action. In common the preceptors are sensors mounted on the

    robot,processing

    is

    done

    by

    on

    board

    microcontroller

    or

    processor

    and

    task

    (action)

    is

    performed

    using

    motorsorwithsomeotheractuators.

    ProjectOverview

    Inthepresentprojecttherobotiscontrolledbyamobilephonewhichmakesacalltothemobilephone

    attachedtotherobot.Inthecourseofacallifanybuttonispressedatonecorrespondingtothebutton

    pressed isheardat theotherendof thecall.This tone iscalledDTMF tone.The robotperceives this

    DTMFtonewiththehelpofaphonestackedintherobot.Theprocessingofthereceivedtoneisdoneby

    Atmega32microcontrollerwith thehelpofDTMFdecoder,HT9170.Thedecoderdecodes theDTMF

    tone in to its equivalent binary digit and this binary number is sent to the microcontroller. The

    microcontrolleris

    preprogrammed

    to

    take

    adecision

    for

    any

    given

    input.

    The

    microcontroller

    outputs

    its

    decisiontomotordriverstodrivethemotors inordertohaveforwardorbackwardmotionoraturn.

    Anymobilewhichmakesacalltothemobilephonestackedintherobotwillactasremote.So,thisisa

    simpleroboticprojectwhichevendoesnotrequiretheconstructionofreceiverandtransmitterkits,but

    hasaninnovatedapplicationofcellphoneandrobustcontrol.

    Dualtonemultifrequency (DTMF)signaling isused for telephone signalingover the line in thevoice

    frequencyband to the call switching center.TheversionofDTMFused for telephone tonedialing is

    known by the trademarked term TouchTone. DTMF assigns a specific frequency (consisting of two

    separatetones)toeachkeysothatitcaneasilybeidentifiedbyamicroprocessor.Thesignalgenerated

    byaDTMF

    encoder

    is

    adirect

    algebraic

    summation,

    in

    real

    time,

    of

    the

    amplitudes

    of

    two

    sine

    (cosine)

    wavesofdifferentfrequencies,i.e.pressing'5'willsendatonemadebyadding1336Hzand770Hzto

    theotherendoftheline.

  • 7/21/2019 MobilePhone Controlled Robot Complete Document

    3/10

    InDTMFsystemthetonesandassignmentsareasfollows:

    frequencies 1209Hz 1336Hz 1477Hz 1633Hz

    697Hz 1 2 3 A

    770Hz 4 5 6 B

    852Hz 7 8 9 C

    941Hz * 0 # D

    CircuitDescription

    Figure1showstheblockdiagramofthemobileoperatedlandrover.Theimportantcomponentsofthis

    projectareDTMFdecoder,Microcontrolleranddriver.

    TheHT9170seriesareDualToneMultiFrequencyreceivers(DTMFdecoders).All

    typesoftheHT9170seriesusedigitalcountingtechniquestodetectanddecode

    allthe16DTMFtonepairsintoa4bitcodeoutput.Abuiltindialtonerejection

    circuit is provided to eliminate the need for prefiltering. When input signals

    givenatVP(1)andVN(2)pinsarerecognizedtobeeffective,DV(15)becomes

    high,andthecorrect4bitcodeofthetone(DTMF)istransferredtotheoutput

    pins,D0(11)D3(14).Figure2showstheICspinassignment.Figure3showsthe

    DTMFdataoutputtableofHT9170series.

    Themicrocontrolleroutput isnot sufficient todrive theDCmotors, ahighvoltage andhigh current

    drivers are required. The L293D is a quadruple high current half H driver designed to provide

    Figure

    1

    ,

    Block

    diagram

    Headset

    HT9170

    DTMF

    decoder

    MICROCONTROLLER

    ATmega32L

    2

    9

    3

    D

    Left

    motor

    Right

    motor

    Robot

    MotordriverMobileusedas

    Remote

    Figure

    2,

    Pin

    Assignment

  • 7/21/2019 MobilePhone Controlled Robot Complete Document

    4/10

    bidirectionaldrivecurrentsofupto600mAatvoltagesfrom4.5Vto36V.Itwillbecomeeasiertodrive

    dcmotorswithsuchdrivers.Refertothe logicaldiagramandthe functionaltableofthedrivershown

    below.Drivers are enabled in pairs with drivers 1 and 2 enabled by 1,2EN and drivers 3 and 4 are

    enabledby3,4EN.Whenanenable input ishigh,theassociateddriversareenabled,theiroutputsare

    active and in phase with their inputs. External highspeed output clamp diodes should be used for

    inductivetransientsuppression.

    Figure

    3

    DTMF

    Data

    Output

    Table

    Figure5 FunctionalTableofL293D

    Figure4LogicaldiagramofL293D

  • 7/21/2019 MobilePhone Controlled Robot Complete Document

    5/10

    MicrocontrollerusedinthisprojectisATmega32.ItisalowpowerCMOS8bitAVRmicrocontrollerwith

    32K bytes in system programmable Flash. It has EEPROM of 1024 bytes, 8 channel 10 bit ADC, 32

    programmableI/Olines,Speedgradesof016MHzitisbasedontheAVRenhancedRISCarchitecture.

    Thecompilerused forproject is ICCAVRcompiler.This isacrosscompilerand itstrialversioncanbe

    downloadedfromtheImagecraftcompilerwebsite.Compilationandburningofthecodewillbeeasier

    foramateurswiththissoftware.ThecircuitforprogrammingthemicrocontrollerandtheISPcablefor

    parallelportisshownbelow.

    SoftwareDescription

    Withefficientsoftware,eveniftherearelimitedcontrols,wecanhaveanewcontrolwithcombination

    oftwoormoreavailablecontrols.ThecrosscompilerusedinthisprojectsupportsCprogramming.The

    Ccodeoftheprojectisgivenbelow.TheCprogramcodeiscrosscompiledintohexcodeandburnedin

    tothemicrocontrollerusingtheparallelportISP.

    Working

    Theuserinordertocontroltherobotshouldmakeacalltothecellphoneattachedintherobot,from

    anyphone,whichcansendDTMFtunesonpressingthenumericbuttons.Thecellphone intherobot

    willbekept inautoanswermode.So,aftera ring thecellphoneaccepts thecall.Now theusermay

    pressanybuttononhismobile.TheDTMFtonesthusproducedarereceivedbythecellphone in the

    robot.Thesetonesarefedtothecircuitbyheadsetofthecellphone.HT9170decodesthereceived

    tone and sends equivalent binary number to themicro controller.According to the program in the

    microcontroller,therobotstartsmoving.

    Figure6CircuitformicrocontrollerprogrammingFigure

    7

    ISP

    cable

    for

    parallel

    port

  • 7/21/2019 MobilePhone Controlled Robot Complete Document

    6/10

    Asshowninthecircuit,theinputtothecircuitfromtherobotscellphoneisgiventhroughheadsetat

    the2nd&3rdpinsofHT9170.ThedecodeddigitaldatawillbegivenoutbytheHT9170at11,12,13&14

    pins.Thesedigitsarenegatedusing4notgatesofa7404HEX INVERTER.This inverted inputwillbe

    given to theportAofmicro controller at 37,38,39 and40pinswhich are PA3, PA2, PA1 andPA0

    respectively.ThemicrocontrollerisprogrammedtogiveoutputatportD,tocontrolthemotordriver.

    Asexplainedpreviously,themotordriverL293DcandriveaDCmotorwithanenableandtwocontrol

    inputs.So,inputsat1A(2),2A(7)andenableat1,2EN(1)candriveaDCmotorconnectedat1Y(3)and

    2Y(6).ThePD0 (14),PD1(15)andPD7(21)pinsofportDofmicrocontrollerareconnectedto1A,2A

    and1,2ENpinsrespectively.So,with1,2ENpinenabledandif1A,2Apinsareprovidedwith1,0asinput

    respectively,themotorrotates inadirectionand0,1 inputmakesthemotortorun inviceversa.And

    the input1,1causeselectricalbrake.Themicrocontrollerisprogrammed insuchawaythatwhenthe

    userpresses (for ex.) 2button, both thedriverswillbe activated tomake theirmotors tomake a

    forwardmotion.Adetailedtable isgivenbelow,delineatingeverystep indatatransferwhenadigit is

    pressed.

    No.pressed

    by

    user

    O/pofHT9170

    DTMF

    decoder

    I/ptothe

    microcontroller

    o/pfrom

    microcontroller

    ActionPerformed

    2 0x02

    00000010

    0xFD

    11111101

    0x09

    00001001

    Forwardmotion

    4 0x04

    00000100

    0XFB

    11111011

    0x05

    00000101

    Leftturn

    Rightmotorforwarded

    Leftmotorbackwarded

    6 0x06

    00000110

    0XF9

    11111001

    0x0A

    00001010

    Rightturn

    Rightmotorbackwarded

    Leftmotorforwarded

    8

    0x08

    000010000XF7

    111101110x06

    00000110Backward

    motion

    5 0x05

    00000101

    0XFA

    11111010

    0x00

    00000000

    Brake

    Figure

    8

    Detailed

    data

    of

    every

    step

    Applicationdevelopment

    The generic purpose land rover delineated in this project can be further improved to have specific

    purposes. For a land rover we need to have 4 controls, to make it roam around. The remaining 8

    controlscan

    be

    configured

    for

    other

    purposes,

    by

    some

    modifications

    in

    the

    software

    code

    of

    microcontroller.

    Letsnowupgradeourlandrovertoasumorobot,whichhastofightordefenditselfinagivenarena.

    Thebasicmovementofforward,backward,turnrightandturnleftcanbeassignedto2,8,4and6.For5

    wecanhaveabreak.Nowweshouldaddsomeweapontomaketherobotcapableofattacking.Lets

    take some longwooden ruler and adcmotor.Ahole ismade at the centerofwooden ruler and is

  • 7/21/2019 MobilePhone Controlled Robot Complete Document

    7/10

    pivotedtightlytotheaxleofmotor,suchthattheaxlewillbecomeperpendiculartothesurfaceofruler.

    Withthisarrangementtherulerwillrotatealongaverticalaxispassingthroughitscenter,sothatitcan

    attackanyrobotcomingwithinthisarea.Anadditionalmotordrivershouldbeemployedtodrivethis

    motor.Andnowweshouldengagetwomorekeys(*,#)tocontroltherotationofthisruler.Forthiswe

    needtoprogramthemicrocontrollertodrivethemotorsinonedirectionif* ispressedonceandstop

    therotationifthesame*ispressedagain;if#ispressedthemotorshoulddriveinotherdirectionand

    shouldbe

    stopped

    if

    pressed

    again.

    Inthisfashiononecaninnovativethelandroverinanywaytheapplicationdemands.Wecanaddsome

    ball holding mechanism to make a ball picking and dropping robot. If we add some ball pushing

    mechanism,thenthelandroverwillbecomeasoccerrobot.Likethiswecangoonimprovingtheland

    roverfordifferentapplications.

    MechanicalConstruction

    For constructionof any robot, the importantmechanical constraint is thenumberofmotorswe are

    goingtousing.Onecanhaveeithertwowheeldriveorafourwheeldrive.Fourwheeldriveeventhough

    iscomplex

    than

    two

    wheel

    drive

    will

    provide

    more

    torque

    and

    good

    control.

    Two

    wheel

    drive

    is

    very

    easytoconstruct.

    Topandbottomviewsofalandrover,fourwheeldriven,isshowninthefigurefIg10.Thechassisused

    inthatmodelisasheetmadeupofparaxandisofsize9x20cm.Motorsarefixedtothebottomofthis

    sheetandcircuit isplacedabovethissheetand it isaffixedfirmly.Acellphone isalsoplacedoverthe

    sheetasshowninthefigure.

    Inthefourwheeldrivesystemthetwomotorsinasidearecontrolledparallel.SoasingleL293Ddriver

    Figure

    10

    top

    view

    of

    the

    rover

    Figure

    9 bottom view

  • 7/21/2019 MobilePhone Controlled Robot Complete Document

    8/10

    IC candrive the rover.But in twowheeldrive thepairofmotorsona side is replacedwitha single

    motor.Some supportingwheels like castorwheelsareused to support the robot in twowheeldrive

    mechanism.A twowheeldriven land rover isdisplayed in the figure10,11.For this robotbeadsare

    affixedwithglue,willactassupportwheels.

    Figure

    12.

    front

    view

    of

    the

    chassis

    and

    a

    land

    rover.

    Thecircuit,whichisusedintheproject,isshownbelow. Aschematicofthecircuitisalsoshown,to

    haveaclearidea.

    I/pfromheadsetto

    decoderHT9170,DTMFdecoder

    IC7404hexinverter

    Atmega32,microcontroller

    L293D,motordriver

    Inputtomotorfromdriver.

    Figure

    11.

    land

    rover

    with

    a

    2

    wheel

    drive

  • 7/21/2019 MobilePhone Controlled Robot Complete Document

    9/10

    Figure

    13.

    The

    entire

    schematic

    of

    the

    circuit

    i/pfromheadset

  • 7/21/2019 MobilePhone Controlled Robot Complete Document

    10/10

    CProgramcode

    #i ncl ude#i ncl udevoi d del ay( unsi gned i nt i ){unsi gned i nt j ;whi l e( i - - )f or ( j =0; j