make a robot that responds to commands from your mobile phone _ spider

Upload: usama-javed

Post on 02-Jun-2018

228 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/10/2019 Make a Robot That Responds to Commands From Your Mobile Phone _ Spider

    1/12

    11/22/2014 Make a Robot that responds to commands from your mobile phone | Spider

    http://spidernitt.wordpress.com/2012/12/10/make-a-bot-that-responds-to-commands-from-your-mobile-phone/

    SpiderThe R&D Club of NIT Trichy

    HOME

    SPIDER NITT

    HOW TO

    AB OU T

    Make a Robot that responds tocommands from your

    mobile phoneDecember 10, 2012 by spidertm

    DTMF Controlled Robot

    Introduction

    This project is similar to the functioning of an

    ordinary remote control system which consists

    of, a transmitter and a receiver. Therefore two

    mobile phones are required for effective Follow

    http://void%280%29/http://spidernitt.wordpress.com/author/spidertm/http://spidernitt.wordpress.com/2012/12/10/make-a-bot-that-responds-to-commands-from-your-mobile-phone/http://spidernitt.wordpress.com/about/http://spidernitt.wordpress.com/how-to/http://spidernitt.wordpress.com/portfolio/http://spidernitt.wordpress.com/
  • 8/10/2019 Make a Robot That Responds to Commands From Your Mobile Phone _ Spider

    2/12

    11/22/2014 Make a Robot that responds to commands from your mobile phone | Spider

    http://spidernitt.wordpress.com/2012/12/10/make-a-bot-that-responds-to-commands-from-your-mobile-phone/ 2

    transmission and reception by DTMF .The robot

    is controlled by the mobile phone held by the

    user, which communicates with the mobile

    phone attached to the robot. In the course of a

    phone call, if any button is pressed, a tone

    corresponding to the button pressed is heard at

    the receiver end, which is called Dual Tone

    Multiple frequency (DTMF) tone. The robot

    receives these tones via the receiver mobile

    phone which is on board. The received tone is

    processed by the microcontroller with the help

    of DTMF decoder IC CM8870DE . This IC

    communicates with the motor driver IC l293d

    through the microcontroller interface which

    drives the motor in forward, reverse, right and

    left directions according to the users key press.

    The microcontroller featuring in this project will

    be the AVR microcontroller,ATmega8.

    Why build a DTMF ROBOT?

    Conventionally, robots controlled by wireless

    communication employ radio frequency(RF),

    which have the drawbacks of limited workingrange, limited frequency range and the limited

    control. Use of a mobile phone for robotic

    control can overcome these limitations. It

    provides the advantage of robust control,

    working range as large as the coverage area of

    the service provider, no interference with other

    controllers and up to twelve controllers.

    Although the appearance and the capabilities of

    Follow Spider

    Get every new post delivered

    to your Inbox.

    Enter your email address

    Sign me upBuild a website with WordPress.com

  • 8/10/2019 Make a Robot That Responds to Commands From Your Mobile Phone _ Spider

    3/12

    11/22/2014 Make a Robot that responds to commands from your mobile phone | Spider

    http://spidernitt.wordpress.com/2012/12/10/make-a-bot-that-responds-to-commands-from-your-mobile-phone/ 3

    robots vary vastly, all robots share the feature of

    a mechanical, movable structure under some

    form of control. The control of the robot

    involves three distinct phases: perception,

    processing and action. Generally, the preceptors

    are sensors mounted on the robot , processing is

    done by the on-board microcontroller or

    processor, and the action is performed using

    motors or with some other actuators.

    Project Overview

    Here the robot is controlled by the mobile

    phone that makes the call to the mobile phone

    attached to the robot.During the course of the

    call, if any button is pressed, control

    corresponding to the button pressed is heard atthe other end of the call. This unique tone is

    received by the mobile on the robot, and is

    decoded with the help of the CM8870 IC.

    The received tone is then processed by the

    Atmega8 microcontroller into its equivalent

    binary digit, according to which it is pre-

    programmed to take a decision for any given

    input and outputs its decision to the motor

    driver, in order to drive the motors forward,

    backward or for rotatory motion.

    The mobile that makes a call to the mobile

    phone kept in the robot acts as a remote. So this

    simple robotic project does not require the

    construction of receiver and transmitter units.

    This project can be sub divieded into 3 parts

    1.The input (DTMF decoder IC-CM8870)

    2. Controller (ATMega8 microcontroller)

    3.Output (The motor driver IC and motors)

    Now lets us look into each aspect in detail.

  • 8/10/2019 Make a Robot That Responds to Commands From Your Mobile Phone _ Spider

    4/12

    11/22/2014 Make a Robot that responds to commands from your mobile phone | Spider

    http://spidernitt.wordpress.com/2012/12/10/make-a-bot-that-responds-to-commands-from-your-mobile-phone/ 4

    1.Input: (DTMF

    decoder circuit)

    When you press the

    buttons on the

    keypad, a connection

    is made that generates two tones at the same

    time. A Row tone and a Column tone. These

    two tones help in identifying the that key you

    pressed to any equipment you are controlling. If

    the keypad is on your phone, the telephone

    companys Central Office equipment knows

    what numbers you are dialing by these tones,

    and will switch your call accordingly. If you are

    using a DTMF keypad to remotely control

    equipment, the tones can identify what unit youwant to control, as well as which unique function

    you want it to perform.

    When you press the digit 1 on the keypad, you

    generate the tones 1209 Hz and 697 Hz.

    Pressing the digit 2 will generate the tones 1336

    Hz and 697 Hz.

    Sure, the tone 697 is the same for both digits,

    but it take two tones to make a digit and the

    decoding equipment knows the difference

    between the 1209 Hz that would complete the

    digit 1, and a 1336 Hz that completes a digit 2.

    Thus each key in the keypad gives different 4 bit

    binary number in the output(pin no

    14,13,12,11).This binary no is processed by the

    microcontroller to give specific output to the

    http://spidernitt.wordpress.com/2012/12/10/make-a-bot-that-responds-to-commands-from-your-mobile-phone/dtmf_table/#main
  • 8/10/2019 Make a Robot That Responds to Commands From Your Mobile Phone _ Spider

    5/12

    11/22/2014 Make a Robot that responds to commands from your mobile phone | Spider

    http://spidernitt.wordpress.com/2012/12/10/make-a-bot-that-responds-to-commands-from-your-mobile-phone/ 5

    motor.

    Motor Driver:-L293D

    L293D is a dual H-bridge motor driver

    integrated circuit (IC). The current from the

    microcontroller is only of the order of 1A which

    is not sufficient to drive the motors. Therefore

    motor drivers are used which act as currentamplifiers since they take a low-current control

    signal and provide a higher-current signal which

    is used to drive the motors.

    L293D contains twoinbuilt H-bridge driver

    circuits. In its common

    mode of operation, two DC motors can be driven

    simultaneously, both in forward and reverse

    direction. The motor operations of two motors

    can be controlled by input logic at pins 2 & 7 and

    10 & 15. Input logic 00 or 11 will stop the

    corresponding motor. Logic 01 and 10 will rotate

  • 8/10/2019 Make a Robot That Responds to Commands From Your Mobile Phone _ Spider

    6/12

    11/22/2014 Make a Robot that responds to commands from your mobile phone | Spider

    http://spidernitt.wordpress.com/2012/12/10/make-a-bot-that-responds-to-commands-from-your-mobile-phone/ 6

    it in clockwise and anticlockwise directions,

    respectively.

    Enable pins 1 and 9 (corresponding to the two

    motors) must be high for motors to start

    operating. When an enable input is high, the

    associated driver gets enabled. As a result, the

    outputs become active and work in phase with

    their inputs. Similarly, when the enable input is

    low, that driver is disabled, and their outputs are

    off and in the high-impedance state.

    Control with MCUs

    The AtMega8 microcontroller used in this

    project has 8Kb of flash memory with 20 general

    purpose input/output pins. These input/outputpins can be used to receive input from the DTMF

    Decoder as well as to send output signals to

    control the motors. However the MCUs PORT

    outputs are not powerful enough to drive DC

    motors directly, we need some kind of drivers to

    facilitate this. A very easy and safe is to use

    popular L293D ICs. It is a 16 PIN chip. The pin

    configuration is as follows.This chip is designed

    to control 2 DC motors. There are 2 Input and 2

    Output pins for each of the motors. The

    connections are as follows:

    http://spidernitt.wordpress.com/2012/12/10/make-a-bot-that-responds-to-commands-from-your-mobile-phone/dtmf_ckt/#main
  • 8/10/2019 Make a Robot That Responds to Commands From Your Mobile Phone _ Spider

    7/12

    11/22/2014 Make a Robot that responds to commands from your mobile phone | Spider

    http://spidernitt.wordpress.com/2012/12/10/make-a-bot-that-responds-to-commands-from-your-mobile-phone/ 7

    The behavior of motor for various input

    conditions are as follows

    If we want to rotate the motor clockwise, we

    make the left upper switch and right lower

    switch closed (which corresponds to A low and B

    high above) and if it has to rotate in

    anticlockwise direction, we close the right upper

    switch and the left lower switch which

    corresponds to A high and B low. Also for the

    forward motion of the vehicle we make both

    motors rotate in clockwise sense (say) and for

    backward motion, both motors should rotate

    anticlockwise. For right turn, right motor should

    stop and left motor should rotate in clockwise

    direction and for sharp right turn right motorrotates in clockwise direction and left motor in

    the anticlockwise direction. A similar technique

    is followed for left turn and sharp left turn which

    you can easily guess.So you saw you just need to

    set appropriate levels at two PINs of the

    microcontroller to control the motor. Since this

    chip controls two DC motors there are two more

    output pins (output3 and output4) and two

    more input pins(input3 and input4). The

    INPUT3 and INPUT4 controls second motor in

    the same way as listed above for input A and B.

    There are also two ENABLE pins they must be

    high (+5v) for operation, if they are pulled low

    (GND) motors will stop.

    Code:

    /*

    http://spidernitt.wordpress.com/2012/12/10/make-a-bot-that-responds-to-commands-from-your-mobile-phone/full_ckt/#main
  • 8/10/2019 Make a Robot That Responds to Commands From Your Mobile Phone _ Spider

    8/12

    11/22/2014 Make a Robot that responds to commands from your mobile phone | Spider

    http://spidernitt.wordpress.com/2012/12/10/make-a-bot-that-responds-to-commands-from-your-mobile-phone/ 8

    DTMF Controlled Robot

    PORTD pin 0,1,2,3 goes to motor driver l293d

    PORTB pin 0,1,2,3 is connected to output of

    CM8870 DTMF decoder IC

    */

    #include

    #include

    int main(void)

    {

    DDRD=0xff;

    DDRB=000;

    while(1)

    {

    switch(PINB&0b00001111)

    {

    case 0b0010://Key 2

    {

    PORTD=0x0A ; //1010 both motor front

    continue;

    }

    case 0b0100://Key 4

  • 8/10/2019 Make a Robot That Responds to Commands From Your Mobile Phone _ Spider

    9/12

    11/22/2014 Make a Robot that responds to commands from your mobile phone | Spider

    http://spidernitt.wordpress.com/2012/12/10/make-a-bot-that-responds-to-commands-from-your-mobile-phone/ 9

    {

    PORTD=002; //0010 right motor front

    continue;

    }

    case 0b0101://Key 5

    {

    PORTD=0x0F;//1111 SUDDEN STOP

    continue;

    }

    case 0b0110://Key 6

    {

    PORTD=008; //1000 left motor front

    continue;

    }

    case 0b1000://Key 8

    {

    PORTD=005;

    continue;

    }

    default:

    continue;

  • 8/10/2019 Make a Robot That Responds to Commands From Your Mobile Phone _ Spider

    10/12

    11/22/2014 Make a Robot that responds to commands from your mobile phone | Spider

    http://spidernitt.wordpress.com/2012/12/10/make-a-bot-that-responds-to-commands-from-your-mobile-phone/ 10

    MAKE YOUR OWN

    ACCELEROMETER

    CONTROLLED

    MOTOR VEHICLE

    THE LEGACY BEHIND A

    HELLO ~ KVR

    }

    }//end of switch

    return 0;

    }

    //

    //

    //

    //

    This entry was posted in Uncategorized. Bookmark

    thepermalink.

    Leave a Reply

    WHATS LA TE ST. .

    Enter your comment here...

    http://spidernitt.wordpress.com/2012/12/10/make-a-bot-that-responds-to-commands-from-your-mobile-phone/http://spidernitt.wordpress.com/category/uncategorized/
  • 8/10/2019 Make a Robot That Responds to Commands From Your Mobile Phone _ Spider

    11/12

    11/22/2014 Make a Robot that responds to commands from your mobile phone | Spider

    http://spidernitt.wordpress.com/2012/12/10/make-a-bot-that-responds-to-commands-from-your-mobile-phone/ 1

    Search

    TWEETS:

    Error: Twitter did not respond. Please wait a few

    minutes and refresh this page.

    Augmented Reality Are we creating one or are we

    already in one! ~ KVRAugust 1, 2014

    The Legacy behind a HELLO ~ KVRAugust 1, 2014

    Make a Robot that responds to commands from your

    mobile phoneDecember 10, 2012

    Make your own accelerometer controlled

    motor vehicleOctober 7, 2012

    Spider NITTOctober 6, 2012

  • 8/10/2019 Make a Robot That Responds to Commands From Your Mobile Phone _ Spider

    12/12

    11/22/2014 Make a Robot that responds to commands from your mobile phone | Spider

    Blog at WordPress.com. | The Ascetica Theme.