Anda di halaman 1dari 21

R.C.P.I.T. R.C.P.I.T.

Department of Electronics & Telecommunication

1. Introduction
In the present project the robot is controlled by a mobile phone which 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 tone. The robot perceives this with the help of a DTMF tone

phone stacked in the robot . The processing of the received

tone is done by Atmega 16 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 sent to the microcontroller. The microcontroller is preprogrammed to take a decision for any given input . The microcontroller outputs its decision to motor drivers to drive the motors in order to have forward or backward motion or a turn. Any mobile which makes a call to the mobile phone stacked in the robot will act as remote. So, this is a simple robotic project which even does not require the construction of receiver innovated application of cell phone and robust and transmitter kits, but has an

control.

Dual-tone

multi-frequency

(DTMF) signalling is used for telephone signaling over the line in the voicefrequency band to the call switching centre. The version of DTMF used for telephone tone dialling is known by the trademarked term Touch-Tone. DTMF assigns a specific frequency (consisting of two separate tones) to each key so that it can easily be identified by a microprocessor. The signal generated by a DTMF encoder is a direct algebraic summation, in real time, of the amplitudes of two sine (cosine) waves of different frequencies, i.e. pressing '5' will send a tone made by adding 1336 Hz and 770 Hz to the other end of the line.

In DTMF system the tones and assignments are as follows:

frequencies 697Hz 770Hz 852Hz 941Hz

1209Hz 1 4 7 *

1336Hz 2 5 8 0

1477Hz 3 6 9 #

1633Hz A B C D

Cell Phone Operated Land Rover

Page 1 of 21

R.C.P.I.T. R.C.P.I.T.

Department of Electronics & Telecommunication

2. THEORY
2.1 Block Diagram & Its Description

Figure 1, Block diagram

As shown in above figure there are two cell phones used. One is transmitter and other one is receiver. MT 8870 is used as DTMF decoder which decodes the DTMF code received from receiver. The output is given to the microcontroller ATMEGA 16. The processing of the received tone is done by ATMEGA 16 microcontroller with the help of DTMF decoder, MT8870 .The microcontroller outputs its decision to motor drivers to drive the motors in order to have forward or backward motion or a turn. The specified program is written in the microcontroller. The order is given to the L293D by microcontroller. According to input L293D drives the motors.

Cell Phone Operated Land Rover

Page 2 of 21

R.C.P.I.T. R.C.P.I.T.

Department of Electronics & Telecommunication

2.2 Circuit Diagram

Figure 2, Circuit Diagram

Figure shows the circuit diagram of the microcontroller- based robot. The important components of this robot are DTMF decoder, Microcontroller and motor driver. An MT8870 series DTMF decoder is used here. All types of the mt8870 series use digital counting techniques to detect and decode all the sixteen DTMF tone pairs in to a four bit code output. The built -in dial tone rejection circuit eliminated the need for prefiltering. When the input signal given at pin2 (IN-) single ended input configuration is recognized to be effective, the correct four bit decode signal of the DTMF tone is transferred to Q1 (pin11) through Q4(pin14) outputs. The ATMEGA 16 is a low power, 8 bit, cmos microcontroller based on the AVR enhanced RISC architecture. It provides the following feature: 16kb of in system programmable flash memory with read write capabilities, 512bytes of EEPROM, 1KB SRAM, 32 general purpose input/output lines. 32 general purpose working registers. All the 32 registers are directly connected to the arithmetic logic unit, allowing two independent registers to be accessed in one signal instruction executed in one clock cycle. The resulting architecture is more code efficient. Outputs from port pins PD0 through PD3 and PD7 of the microcontroller are fed to inputs IN1 through IN4 and enable pins (EN1 and EN2) of motor driver L293d respectively, to drive geared motors. Switch S1 is used for manual reset.

Cell Phone Operated Land Rover

Page 3 of 21

R.C.P.I.T. R.C.P.I.T.

Department of Electronics & Telecommunication

The notations are : ic1 MT 8870 ic2 ATMEGA 16 ic3 L 293D ic4 - CD7004 R1,R2 - 100k resistances R3 330 K resistances R4-R8 10 K resistances c1- 0.47 micro farad capacitor c2, c3, c5, c6 - 22p farad capacitor c4 - 0.1micro farad capacitor xtal1 - 3.57 MHz crystal xtal2 12 MHz crystal s1 - push to on switch M1,M2 - 6v 50rpm motor Battery- 6v

2.3 MT 8870 DTMF Decoder

Figure 3, Pin Diagram of MT 8870

Cell Phone Operated Land Rover

Page 4 of 21

R.C.P.I.T. R.C.P.I.T.

Department of Electronics & Telecommunication

The MT8870 is a complete DTMF receiver integrating both the band split filter and digital decoder functions. The filter section uses switched capacitor techniques for high and low group filters; the decoder uses digital counting techniques to detect and decode all 16 DTMF tone- pairs into a 4-bit code. External component count is minimized by on chip provision of a differential input amplifier, clock oscillator and latched threestate bus interface. Pin Description as follows

Pin No. 1 2 3 4 5

Name IN+ INGS Vref INH

Description Non-Inverting Op-Amp (Input) Inverting Op-Amp (Input) Gain Select. Gives access to output of front end differential amplifier for connection of feedback resistor Reference Voltage (Output). Nominally VDD/2 is used to bias inputs at mid-rail Inhibit (Input). Logic high inhibits the detection of tones representing characters A, B, C and D. This pin input is internally pulled down Power Down (Input). Active high. Powers down the device and inhibits the oscillator. This pin input is internally pulled down Clock (Input) Clock (Output) Ground (Input). . 0 V typical Three State Output Enable (Input). Logic high enables the outputs Q1-Q4. This pin is pulled up internally Three State Data (Output). When enabled by TOE, provide the code corresponding to the last valid tone-pair received .When TOE is logic low, the data outputs are high impedance Delayed Steering (Output). Presents a logic high when a received tone-pair has been registered and the output latch updated; returns to logic low when the voltage on St/GT falls below VTSt Early Steering (Output). Presents a logic high once the digital algorithm has detected a valid tone pair. Any momentary loss of signal condition will cause ESt to return to a logic low Steering Input/Guard time (Output) Bidirectional Positive power supply (Input)

6 7 8 9 10 11-14

PWDN OSC1 OSC2 V SS TOE Q1-Q4

15

StD

16

ESt

17 18

St/GT V DD

Cell Phone Operated Land Rover

Page 5 of 21

R.C.P.I.T. R.C.P.I.T.

Department of Electronics & Telecommunication

Features :

Complete DTMF Receiver Low power consumption Internal gain setting amplifier Adjustable guard time Central office quality Power-down mode Inhibit mode

Applications :

Receiver system for British Telecom (BT) or CEPT Spec (MT8870D-1) Paging systems Repeater systems/mobile radio Credit card systems Remote control Personal computers Telephone answering machine

2.4 L293D (16 pins I.C.)

Figure 4, Pin Diagram of L293D

Cell Phone Operated Land Rover

Page 6 of 21

R.C.P.I.T. R.C.P.I.T.

Department of Electronics & Telecommunication

The L293D is quadruple high-current half-H drivers. The L293D is designed to provide bidirectional drive currents of up to 600-mA at voltages from 4.5 V to 36 V. Both devices are designed to drive inductive loads such as relays, solenoids, dc and bipolar stepping motors, as well as other high-current/high-voltage loads in positive-supply applications. All inputs are TTL compatible. Each output is a complete totem-pole drive circuit, with a Darlington transistor sink and a pseudo-Darlington source. Drivers are enabled in pairs, with drivers 1 and 2 enabled by 1,2EN and drivers 3 and 4 enabled by 3, 4 EN. When an enable input is high, the associated drivers are enabled and their outputs are active and in phase with their inputs. When the enable input is low, those drivers are disabled and their outputs are off and in the high-impedance state. With the proper data inputs, each pair of drivers forms a full-H (or bridge) reversible drive suitable for solenoid or motor applications. On the L293, external high-speed output clamp diodes should be used for inductive transient suppression. A VCC1 terminal, separate from VCC2, is provided for the logic inputs to minimize device power dissipation. The L293D is characterized for operation from 0C to 70C.

Features :

Wide Supply-Voltage Range: 4.5 V to 36 V Separate Input-Logic Supply Internal ESD Protection Thermal Shutdown High-Noise-Immunity Inputs Functional Replacements for SGS L293D Output Current 1 A Per Channel (600 mA for L293D) Peak Output Current 2 A Per Channel (1.2 A for L293D) Output Clamp Diodes for Inductive Transient Suppression (L293D)

Cell Phone Operated Land Rover

Page 7 of 21

R.C.P.I.T. R.C.P.I.T.

Department of Electronics & Telecommunication

2.5 ATMEGA 16 AVR Micro Controller

Figure 5, Pin Diagram of ATMEGA 16 AVR

The AVR core combines a rich instruction set with 32 general purpose working registers. All the 32 registers are directly connected to the Arithmetic Logic Unit (ALU), allowing two independent registers to be accessed in one single instruction executed in one clock cycle. The resulting architecture is more code efficient while achieving throughputs up to ten times faster than conventional CISC microcontrollers.
Cell Phone Operated Land Rover Page 8 of 21

R.C.P.I.T. R.C.P.I.T.

Department of Electronics & Telecommunication

The ATmega16 provides the following features: 16K bytes of In-System Programmable Flash Program memory with Read-While-Write capabilities, 512 bytes EEPROM, 1K byte SRAM, 32 general purpose I/O lines, 32 general purpose working registers, a JTAG interface for Boundary scan, On-chip Debugging support and programming, three flexible Timer/Counters with compare modes, Internal and External Interrupts, a serial programmable USART, a byte oriented Two-wire Serial Interface, an 8-channel, 10-bit ADC with optional differential input stage with programmable gain (TQFP package only), a programmable Watchdog Timer with Internal Oscillator, an SPI serial port, and six software selectable power saving modes. The Idle mode stops the CPU while allowing the USART, Two-wire interface, A/D Converter, SRAM, Timer/Counters, SPI port, and interrupt system to continue functioning. The Power-down mode saves the register contents but freezes the Oscillator, disabling all other chip functions until the next External Interrupt or Hardware Reset. In Power-save mode, the Asynchronous Timer continues to run, allowing the user to maintain a timer base while the rest of the device is sleeping. The ADC Noise Reduction mode stops the CPU and all I/O modules except Asynchronous Timer and ADC, to minimize switching noise during ADC conversions. In Standby mode, the crystal/resonator Oscillator is running while the rest of the device is sleeping. This allows very fast start-up combined with low-power consumption. In Extended Standby mode, both the main Oscillator and the Asynchronous Timer continue to run. The device is manufactured using Atmels high density non volatile memory technology. The On chip ISP Flash allows the program memory to be reprogrammed insystem through an SPI serial interface, by a conventional non volatile memory programmer, or by an On-chip Boot program running on the AVR core. The boot program an use any interface to download the application program in the Application Flash memory. Software in the Boot Flash section will continue to run while the application Flash section is updated, providing true Read-While-Write operation. By Atmel ATmega16 is a powerful microcontroller that provides a highly-flexible and costeffective so combining an 8 bit RISC CPU with In-System Self-Programmable Flash on a monolithic chip, solution to many embedded control applications. The ATmega16 AVR is supported with a full suite of program and system development tools including: C compilers, macro assemblers, program

debugger/simulators, in-circuit emulators, and evaluation kits.

Cell Phone Operated Land Rover

Page 9 of 21

R.C.P.I.T. R.C.P.I.T.

Department of Electronics & Telecommunication

Pin Descriptions :

VCC Digital supply voltage.

GND Ground.

Port A (PA7..PA0) Port A serves as the analog inputs to the A/D Converter. Port A also serves as an 8-bit bi-directional I/O port, if the A/D Converter is not used. Port pins can provide internal pull-up resistors (selected for each bit). The Port A output buffers have symmetrical drive characteristics with both high sink and source capability. When pins PA0 to PA7 are used as inputs and are externally pulled low, they will source current if the internal pull-up resistors are activated. The Port A pins are tri-stated when a reset condition becomes active, even if the clock is not running

Port B (PB7..PB0) Port B is an 8-bit bi-directional I/O port with internal pull-up resistors (selected for each bit). The Port B output buffers have symmetrical drive characteristics with both high sink and source capability. As inputs, Port B pins that are externally pulled low will source current if the pull-up resistors are activated. The Port B pins are tri-stated when a reset condition becomes active, even if the clock is not running.

Port C (PC7..PC0) Port C is an 8-bit bi-directional I/O port with internal pull-up resistors (selected for each bit). The Port C output buffers have symmetrical drive characteristics with both high sink and source capability. As inputs, Port C pins that are externally pulled low will source current if the pull-up resistors are activated. The Port C pins are tri-stated when a reset condition becomes active, even if the clock is not running. If the JTAG interface is enabled, the pull-up resistors on pins PC5(TDI), PC3(TMS) and PC2(TCK) will be activated even if a reset occurs.

Port D (PD7..PD0) Port D is an 8-bit bi-directional I/O port with internal pull-up resistors (selected for each bit). The Port D output buffers have symmetrical drive characteristics with both high sink and source capability. As inputs, Port D pins that are externally pulled

Cell Phone Operated Land Rover

Page 10 of 21

R.C.P.I.T. R.C.P.I.T.

Department of Electronics & Telecommunication

low will source current if the pull-up resistors are activated. The Port D pins are tri-stated when a reset condition becomes active, even if the clock is not running.

RESET Reset Input. A low level on this pin for longer than the minimum pulse length will generate a reset, even if the clock is not running. Shorter pulses are not guaranteed to generate a reset.

XTAL1 Input to the inverting Oscillator amplifier and input to the internal clock operating circuit.

XTAL2 Output from the inverting Oscillator amplifier.

AVCC AVCC is the supply voltage pin for Port A and the A/D Converter. It should be externally connected to VCC, even if the ADC is not used. If the ADC is used, it should be connected to VCC through a low-pass filter.

AREF AREF is the analog reference pin for the A/D Converter

Features :

High-performance, Low-power AVR 8-bit Microcontroller Advanced RISC Architecture 131 Powerful Instructions Most Single-clock Cycle Execution 32 x 8 General Purpose Working Registers Fully Static Operation Up to 16 MIPS Throughput at 16 MHz On-chip 2-cycle Multiplier High Endurance Non-volatile Memory segments 16K Bytes of In-System Self-programmable Flash program memory 512 Bytes EEPROM 1K Byte Internal SRAM Write/Erase Cycles: 10,000 Flash/100,000 EEPROM Data retention: 20 years at 85C/100 years at 25C Optional Boot Code Section with Independent Lock Bits
Cell Phone Operated Land Rover Page 11 of 21

R.C.P.I.T. R.C.P.I.T.

Department of Electronics & Telecommunication

In-System Programming by On-chip Boot Program True Read-While-Write Operation Programming Lock for Software Security JTAG (IEEE std. 1149.1 Compliant) Interface Boundary-scan Capabilities According to the JTAG Standard Extensive On-chip Debug Support Programming of Flash, EEPROM, Fuses, and Lock Bits through the JTAG Interface Peripheral Features Two 8-bit Timer/Counters with Separate Prescalers and Compare Modes One 16-bit Timer/Counter with Separate Prescaler, Compare Mode, and Capture Mode Real Time Counter with Separate Oscillator Four PWM Channels 8-channel, 10-bit ADC Byte-oriented Two-wire Serial Interface On-chip Analog Comparator Special Microcontroller Features Power-on Reset and Programmable Brown-out Detection Internal Calibrated RC Oscillator External and Internal Interrupt Sources Six Sleep Modes: Idle, ADC Noise Reduction, Power-save, Power-down, Standby and Extended Standby I/O and Packages 32 Programmable I/O Lines 40-pin PDIP, 44-lead TQFP, and 44-pad QFN/MLF Operating Voltages 2.7 - 5.5V for ATmega16L 4.5 - 5.5V for ATmega16 Speed Grades 0 - 8 MHz for ATmega16L 0 - 16 MHz for ATmega16 Power Consumption @ 1 MHz, 3V, and 25 C for ATmega16L Idle Mode: 0.35 mA Power-down Mode: < 1 A
Cell Phone Operated Land Rover Page 12 of 21

R.C.P.I.T. R.C.P.I.T.

Department of Electronics & Telecommunication

3. Mechanical Construction
For construction of any robot, the important mechanical constraint is the number of motors we are going to using. One can have either two wheel drive or a four wheel drive. Four wheel drive even though is complex than two wheel drive will provide more torque and good control. Two wheel drive is very easy to construct. Top and bottom views of a

land rover, four wheeldriven,is shown in the figure fIg 5. The chassis used in that model i s a sheet made up of parax and is of size 9 x 20 cm. Motors are fixed to the bottom of this sheet and circuit is placed above this sheet and it is affixed firmly. A cell phone is also placed over the sheet as shown in the figure.

Figure 6, Top View of Land Rover

Cell Phone Operated Land Rover

Page 13 of 21

R.C.P.I.T. R.C.P.I.T.

Department of Electronics & Telecommunication

Figure 7, Bottom View Of Land Rover

Figure 8, front view of the chassis and a land rover.

Cell Phone Operated Land Rover

Page 14 of 21

R.C.P.I.T. R.C.P.I.T.

Department of Electronics & Telecommunication

Figure 9, Top view Of Land Rover

The circuit, which is used in the project, is shown below. A schematic of the circuit is als o shown, to have a clear idea.

Figure 10, A schematic of the circuit

Cell Phone Operated Land Rover

Page 15 of 21

R.C.P.I.T. R.C.P.I.T.

Department of Electronics & Telecommunication

4. Working
The user in order to control the robot should make a call to the cell phone attached In the robot, from any phone, which can send DTMF tunes on pressing the numeric buttons. The cell phone in the robot will be kept in auto answer mode. So, after a ring the cell phone accepts the call. Now the user may press any button on his mobile. The DTMF tones thus produced are received by the cell phone in the robot. These tones are fed to the circuit by head set of the cell phone. MT 8870 decodes the received tone and sends equivalent binary number to the micro controller. According to the program in the microcontroller, the robot starts moving.

As shown in the circuit, the input to the circuit from the robots cell phone is given through headset at the 2nd& 3rd pins of MT 8870. The decoded digital data will be given out by the HT9170 at 11, 12, 13 &14 pins. These digits are negated using 4 not gates of a 7404 HEX INVERTER. This inverted input will be given to the port A of micro controller at 37, 38, 39 and 40 pins which are PA3, PA2, PA1 and PA0 respectively. The micro controller is programmed to give output at port D, to control the motor driver.

As explained previously, the motor driver L293D can drive a DC motor with an enable and two control inputs. So, inputs at 1A (2), 2A (7) and enable at 1,2EN (1 ) can drive a DC motor connected at 1Y (3) and 2Y (6). The PD0 (14), PD1 (15) and PD7 (21) pins of port D of microcontroller are connected to 1A, 2A and 1,2EN pins respectively.So, with 1,2EN pin enabled and if 1A, 2A pins are provided with 1, 0 as input respectively, the motor rotates in a direction and 0, 1 input makes the motor to run in vice versa. And the input 1, 1 causes electrical brake. The microcontroller is programmed in such a way that when the user presses (for ex.) 2 button, both the drivers will be activated to make their motors to make a forward motion.

Cell Phone Operated Land Rover

Page 16 of 21

R.C.P.I.T. R.C.P.I.T.

Department of Electronics & Telecommunication

A detailed table is given below, delineating every step in data transfer when a digit is pressed.

No. pressed by user 2

O/p of MT8870 DTMF decoder

I/p to the microcontroller

o/p from microcontroller microcontroller

Action Performed

0x02 00000010

0xFD 11111101 0xFB 11111011

0x09 00001001 0x05 00000101

Forward motion

0x04 00000100

Left turn Right motor forwarded Left motor back warded

0x06 00000110

0xF9 11111001

0x0A 00001010

Right turn Right motor back warded Left motor forwarded

0x08 00001000

0xF7 11110111 0xFA 11111010

0x06 00000110 0x00 00000000

Backward motion

0x05 00000101

Brake

Cell Phone Operated Land Rover

Page 17 of 21

R.C.P.I.T. R.C.P.I.T.

Department of Electronics & Telecommunication

5. Software Description
With efficient software, even if there are limited controls, we can have a new control with combination of two or more available controls. The cross compiler used i n this project supports C programming.

The C code of the project is given below. The C program code is cross compiled in to hex code and burned into the micro controller using the parallel port ISP. The source program is well commanded and easy to understand. First include the resistor name definded specifically for ATMEGA 16 and also declare the variable. Set port A as the input and port D as the output. The program will run forever by using While loop. Under While loop, read port A and test the received input using Switch statement. The corresponding data will out at port D after testing of the received data.

C Program code

#include <mega16.h> Void main(void) { Unsigned int k,h; DDRA=0x00; DDRD=0Xff; While (1) { k=~PINA; h=k & 0x0F; switch (h) { Case 0x02: //if I/P is 0x02 { PORTED = 0x89 ;// O/P is Forward Break; }

Cell Phone Operated Land Rover

Page 18 of 21

R.C.P.I.T. R.C.P.I.T.

Department of Electronics & Telecommunication

Case 0x08 : // if I/P is 0x08 { PORTD =0x86 ; //O/P 0x86 is Backward Break; } Case 0x04: { PORTD =0x85; // Left turn Break; } Case 0x06: { PORTD = 0x8A; // Right turn Break; } Case 0x05: { PORTD =0x00; // Stop Break; } } } }

Cell Phone Operated Land Rover

Page 19 of 21

R.C.P.I.T. R.C.P.I.T.

Department of Electronics & Telecommunication

6. Application Development

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 controls can be configured for other purposes, by some modifications in the software code of microcontroller.

Lets now upgrade our land rover to a sumo robot, which has to fight or defend itself in a given arena. The basic movement of forward, backward, turn right and turn left can be assigned to 2, 8, 4 and 6. For 5 we can have a break. Now we should add some weapon to make the robot capable of attacking.

Lets take some long wooden ruler and a dc motor. A hole is made at the centre of wooden ruler and is pivoted tightly to the axle of motor, such that the axle will be come perpendicular to the surface of rulerWith this arrangement the ruler will rotate along a vertical axis passing through its center, so that it can attack any robot coming with in this area.

An additional motor driver should be employed to drive this motor. And now we s hould engage two more keys (*, #) to control the rotation of this ruler. For this we need to program the microcontroller to drive the motors in one direction if * is pressed once and st op The rotation if the same * is pressed again; if # is pressed the motor should drive in other direction and should be stopped if pressed again. In this fashion one can innovativ e the land rover in any way the application demands.

We can add some Ball holding mechanism to make a ball picking and dropping robot.

We add some ball pushing mechanism, then the land rover will become a soccer robot. Like this we can go on improving the land rover for different applications.

Cell Phone Operated Land Rover

Page 20 of 21

R.C.P.I.T. R.C.P.I.T.

Department of Electronics & Telecommunication

7. References
[1] R. Raghavendra Prasad, K. Susram Rahul,Cellphone Operated Land Rover, Electronics For You, Vol. 40, July 2008, 62-66

[2]

James Cameron, Mobile Controlled Robot, Electronics Today, Vol. 64, March 2009, 43-47

Cell Phone Operated Land Rover

Page 21 of 21

Anda mungkin juga menyukai