arduino dtmf controlled robot

12
DTMF CONTROLLED ROBOT This is the robot whose actions can be controlled by a mobile phone from all over the world using the DTMF signaling. Use of mobile phones for robotic controls provides working range as large as the coverage area of the service provider and no interference with other controllers. Block diagram DTMF Controlled Robot

Upload: uvsofts-technologies

Post on 15-Jul-2015

1.000 views

Category:

Engineering


5 download

TRANSCRIPT

Page 1: Arduino dtmf controlled robot

DTMF CONTROLLED ROBOT

This is the robot whose actions can be controlled by a mobile phone

from all over the world using the DTMF signaling.

Use of mobile phones for robotic controls provides working range as

large as the coverage area of the service provider and no interference

with other controllers.

Block diagram

DTMF Controlled Robot

Page 2: Arduino dtmf controlled robot

PROJECT OVERVIEW

In this project, the robot is controlled by a mobile phone that makes a

call to the mobile phone attached to the robot. In the course of a call, if

any button is pressed, a tone corresponding to the button pressed is

heard at the other end of the call. This tone is called DTMF (dual-tone-

multiple-frequency).The robot perceives this DTMF tone with the help

of the phone stacked in the robot. The received tone is processed by the

microcontroller residing on the Arduino UNO board with the help of

DTMF decoder IC (MT8870). The decoder decodes the DTMF tone

into its equivalent binary digit and this binary number is sent to the

microcontroller. The microcontroller is programmed to take a decision

for any given input and outputs its decision to motor drivers in order to

drive the motors in forward direction or backward direction or turn. The

mobile phone that makes a call to mobile phone stacked in the robot act

as a remote.

DTMF

DTMF (Dual tone multi frequency) as the name suggests uses a

combination of two sine wave tones to represent a key dialed on a

pushbutton or DTMF keypad.

These tones are called row and column frequencies as they correspond

to the layout of a telephone keypad.

Page 3: Arduino dtmf controlled robot

DTMF keypad layout

A DTMF keypad (generator or

encoder) generates a sinusoidal

tone which is mixture of the row

and column frequencies. The row

and column frequencies

corresponding to a DTMF keypad have been indicated in the above

figure.

DTMF tones are able to represent one of the 16 different states or

symbols on the keypad.

Hardware components required and their purpose:

1. Arduino UNO board

2. Transmitter and receiver mobile phones

3. DTMF decoder IC (MT8870)

4. DC motor

5. Motor driver IC (L293D)

6. Wheels

7. Power adopter

Arduino UNO board: This is the brain of this robot in which the

program is loaded to do the required functioning and is interfaced

with decoder IC and the motor driver to make the system work as

required.

Page 4: Arduino dtmf controlled robot

Transmitter and receiver mobile phones: Here the transmitting

phone is working as a remote and the receiving phone is attached

to the robot which receives the DTMF signals which are then fed to

decoder IC after converting them to electrical form through audio

jack.

DTMF decoder IC (MT8870)

The decoder decodes the DTMF tone into its equivalent binary

digit and this binary number is sent to the microcontroller.

DTMF decoder IC (MT8870)

On pressing any key say key 1,

a combination of frequencies

1209 and 697 Hz will be

generated by keypad which is

fed to IC through sound

converter which in turn

produce the output 0001 (Q1,

Q2, Q3, Q4). Following

table shows output of

remaining keys.

MT8870 output

Page 5: Arduino dtmf controlled robot

DC Motor: This motor is controlled with DC voltages and can

move in forward and backward direction according to the polarity

of the voltage applied.

Motor driver IC (L293D): Microcontrollers can’t supply the

current required by DC motor to run. So, to fulfill this requirement

these motor driver ICs are used.

DC motors with Driver IC

Power adopter: This is used to give appropriate dc power supply

to microcontroller, driver IC sensors and the other passive

components of the robot.

Wheels: In it three wheels are employed, two at rear end and one at

front end. Rear wheels are attached with the motors and also

control the steering of robot. Front wheel is the loose steered wheel

which moves in the direction of the pressure applied to it.

Page 6: Arduino dtmf controlled robot

Overview:

Top view of robot

Description

The robot is controlled by a mobile phone that makes call to the

mobile phone attached to the robot and in the course of the call, if any

button is pressed the corresponding DTMF freq. will be heard at the

other end.

DTMF assigns a specific frequency (consisting of two separate tones)

to each key that it can easily be identified by the electronic circuit.

The signal generated by the DTMF encoder is the direct algebraic

submission, in real time of the amplitudes of two sine(cosine) waves

of different frequencies, for example: pressing key5 will send a tone

made by adding 1336hz and 770hz to the other end of the mobile.

Page 7: Arduino dtmf controlled robot

The received tone is processed by the atmega8 microcontroller with

the help of DTMF decoder (MT8870). The decoder decodes the

DTMF tone in to its equivalent binary digit and this binary number is

send to the microcontroller.

The microcontroller is preprogrammed to take a decision for any

given input and outputs its decision to motor drivers in order to drive

the motors for forward or backward motion or a turn.

Program:

/*DTMF pins Q1-4 are attached with pins 9-12

left motor attached to pin 5,6 and

right motor attached to pin 7,8 and

*/

int q1=9;

int q2=10;

int q3=11;

int q4=12;

void setup() {

//Initialize serial and wait for port to open:

Serial.begin(9600);

pinMode(q1, INPUT);

pinMode(q2, INPUT);

pinMode(q3, INPUT);

pinMode(q4, INPUT);

pinMode(5, OUTPUT);

pinMode(6, OUTPUT);

Page 8: Arduino dtmf controlled robot

pinMode(7, OUTPUT);

pinMode(8, OUTPUT);

}

void loop()

{

int v1,v2,v3,v4,value;

v1 = digitalRead(q1);

v2 = digitalRead(q2);

v3 = digitalRead(q3);

v4 = digitalRead(q4);

value=((v4<<3)|(v3<<2)|(v2<<1)|(v1));

switch(value)

{

case 0X02:

{

digitalWrite(6, LOW);

digitalWrite(8, LOW);

digitalWrite(5, HIGH);

digitalWrite(7, HIGH); //switch on both

break;

}

case 6: //RIGHT turn

{

digitalWrite(5, HIGH);

digitalWrite(7, LOW);

digitalWrite(6, LOW);

digitalWrite(8, LOW); //switch on only LEFT motor move to RIGHT

break;

}

Page 9: Arduino dtmf controlled robot

case 4: //LEFT turn

{

digitalWrite(5, LOW);

digitalWrite(7, HIGH);

digitalWrite(6, LOW);

digitalWrite(8, LOW);

//switch on only RIGHT motor move to LEFT

break;

}

case 8:

{

digitalWrite(5, LOW);

digitalWrite(7, LOW);

digitalWrite(6, HIGH);

digitalWrite(8, HIGH); //both REVERSE

break;

}

default:

{

digitalWrite(5, LOW);

digitalWrite(7, LOW);

digitalWrite(6, LOW);

digitalWrite(8, LOW);

break;

}

}

}

Page 10: Arduino dtmf controlled robot

Programming Digital I/O pins of Arduino UNO board:

Each pin is controlled by three commands associated with it which are

designated as:

pinMode()

digitalWrite()

digitalRead()

pinMode()

This configures the specified pin to behave either as an input or an output.

Syntax

pinMode(pin, mode)

Parameters

pin: the number of the pin whose mode you wish to set

mode: INPUT, OUTPUT.

Returns

None

Example

int ledPin = 13; // LED connected to digital pin 13

void setup()

{

pinMode(ledPin, OUTPUT); // sets the digital pin as output

}

void loop()

{

digitalWrite(ledPin, HIGH); // sets the LED on

delay(1000); // waits for a second

digitalWrite(ledPin, LOW); // sets the LED off

delay(1000); // waits for a second

}

Page 11: Arduino dtmf controlled robot

digitalWrite()

Write a HIGH or a LOW value to a digital pin.

If the pin has been configured as an OUTPUT with pinMode(), its voltage

will be set to the corresponding value: 5V (or 3.3V on 3.3V boards) for

HIGH, 0V (ground) for LOW.

Syntax

digitalWrite(pin, value)

Parameters

pin: the pin number

value: HIGH or LOW

Returns

None

Example

Sets pin 13 to HIGH, makes a one-second-long delay, and sets the pin back to LOW.

int ledPin = 13; // LED connected to digital pin 13

void setup()

{

pinMode(ledPin, OUTPUT); // sets the digital pin as output

}

void loop()

{

digitalWrite(ledPin, HIGH); // sets the LED on

delay(1000); // waits for a second

digitalWrite(ledPin, LOW); // sets the LED off

delay(1000); // waits for a second

}

Page 12: Arduino dtmf controlled robot

digitalRead()

Reads the value from a specified digital pin, either HIGH or LOW.

Syntax

digitalRead(pin)

Parameters

pin: the number of the digital pin you want to read (int)

Returns

HIGH or LOW

Example

int ledPin = 13; // LED connected to digital pin 13

int inPin = 7; // pushbutton connected to digital pin 7

int val = 0; // variable to store the read value

void setup()

{

pinMode(ledPin, OUTPUT); // sets the digital pin 13 as output

pinMode(inPin, INPUT); // sets the digital pin 7 as input

}

void loop()

{

val = digitalRead(inPin); // read the input pin

digitalWrite(ledPin, val); // sets the LED to the button's value

}