Sunteți pe pagina 1din 13

CELLPHONE OPERATED LAND ROVER

Tanvir Manhotra, Amit Kulkarni, Rushab Karani 22 October 2012

controls. Although the appearance and capabilities of robots vary vastly, all robots share the features In this project the robot is controlled by a mobile of a mechanical, movable structure under some phone that makes a call to the mobile phone attached form of control. The control of robot involves three to the robot. In the course of a call ,if any button is distinct phases: perception, processing and action. pressed a tone corresponding to the button pressed Generally, the preceptors are sensors mounted on is heard at the other end of the call .this tone is the robot, processing is done by the on board called dual tone multiple frequency(DTMF). The microcontroller or processor, and the task (action) robot perceives this DTMF tone with the help of is performed using motors or with some other the phone stacked in the robot. The received tone actuators. is processed by the microcontroller with the help of DTMF decoder HT9170. The decoder decodes the DTMF tone into its equivalent binary digit and this binary number is sent to the microcontroller . The microcontroller is pre-programmed to take a decision for any given input ,and outputs its decision 3 About Microcontroller to motor for forward or backward or turn. The mobile that makes a call to the mobile phone that is 1. Microcontroller stacked in the robot acts as a remote. So this simple A microcontroller is a small computer on a robotic project does not require the construction of single integrated circuit consisting of a relatively transmitter and receiver units. simple CPU combined with support functions such as a crystal oscillator, timers, watchdog timer, serial and analog I/O etc. Program memory in the form of NOR ash or OTP ROM is also often included on chip, as well as a typically small amount of RAM. Microcontrollers are 2 Introduction designed for small or dedicated applications. Conventionally, wireless controlled robots use RF circuits, which have the drawbacks of limited working range, limited frequency range and 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 1

Abstract

2. Uses of Microcontrollers Microcontrollers are used in automatically controlled products and devices. By reducing the size and cost compared to a design that uses a separate microprocessor, memory, and input/output devices, microcontrollers make it economical to digitally control even more devices

and processes. Mixed signal microcontrollers are common, integrating analog components needed to control non-digital electronic systems. 3. P89V51RD2 We are using P89V51RD2 microcontroller. A particularly useful feature of the P89V51RD2 core is the inclusion of a boolean processing engine which allows bit-level boolean logic operations to be carried out directly and eciently on internal registers and RAM. Another valued feature is that it has four separate register sets, which can be used to greatly reduce interrupt latency compared to the more common method of storing interrupt context on a stack. P89V51RD2 based microcontrollers typically include UARTs, timers, 128 bytes of internal data RAM (16 bytes of which are bit-addressable), 32 bits of I/O, 64 KB of internal program memory, and The AT89C51 core ran at 12 clock cycles per machine cycle, with most instructions executing in one or two machine cycles. With a 12 MHz clock frequency, the P89V51RD2 could thus execute 1 million one-cycle instructions per second or 500,000 two-cycle instructions per second. 4. Features of P89V51RD2 (a) It provides many functions in a single package (b) 8-bit ALU, Accumulator and Registers (c) 8-bit data bus - It can access 8 bits of data in one operation (d) 16-bit address bus - It can access 216 memory locations - 64 kiB (65536 locations) each of RAM and ROM (e) On-chip RAM - 128 bytes (data memory) (f) On-chip ROM - 4 KB (program memory) (g) 32 bi-directional input/output port (h) UART (serial port) (i) Two 16-bit Counter/timers 2

(j) Two-level interrupt priority (k) Low Power Idle and Power saving mode

Minimum microcontroller based system

1. Reset circuit: Reset is an active High input When RESET is set to High, P89V51RD2 goes back to the power on state.The P89V51RD2 is reset by holding the RST high for at least two machine cycles and then returning it low.

Power-On Reset: Initially charging of capacitor makes RST High i.e. Due to transient conditions, the capacitor will act as a short circuit for a time period equal to the charging time of the capacitor. This charging time should be greater than the time taken by two machine cycles. When capacitor charges fully, it blocks DC.

As a result, Logic LOW is present at the resistor. Manual reset: When the switch is closed momentarily, RST will go High. This is because as the capacitor discharges,the transient conditions make the capacitor equivalent to a short circuit. As a result, the entire 5V or Logic HIGH appears across the resistor. This HIGH state, however, should be present at the RST input for atleast two clock cycles of the microcontroller After a reset, the program counter is loaded with 0000H. However, the content of on-chip RAM is not aected. The following table determines the default values various SFRs will posses upon entering the reset state.

can be achieved in two ways:

Register Program Counter Accumulator PSW B Register Stack Pointer DPTR All Ports IP IX Timer Registers SCON SBUF

Content 0000 H 00 H 00 H 00 H 07 H 0000 H FF H XXX00000 B 0XX00000 B 00 H 00 H 00 H

The crystal is connected to pins 18 and 19 with stabilizing capacitors. 12 MHz (11.059MHz) crystal is often used and the capacitance ranges from 20pF to 40pF.The oscillator can also be a TTL clock source connected with a NOT gate as shown.

(a) Working of P89V51RD2: A cycle is, in reality, 12 pulses of the crystal. That is to say, if an instruction takes one machine cycle to execute, it will take 12 pulses of the crystal to execute. Since we know the crystal is pulsing 11,059,000 times per second and that one machine cycle is 12 092 pulses, we can calculate how many instruction cycles the P89V51RD2 can execute per second: 11,059,000 / 12 = 921,583 (b) Selection of Crystal: 11.0592 MHz crystals are often used because it can be divided to give you exact clock rates for most of the common baud rates for the UART,which is compatible with IBM PCs. Despite the oddball value, these crystals are readily available and commonly used.

2. Oscillator circuit: The P89V51RD2 uses the crystal for precisely that: to synchronize its operation. Eectively, the P89V51RD2 operates using what are called machine cycles. A single machine cycle is the minimum amount of time in which a single P89V51RD2 instruction can be executed. although many instructions take multiple cycles.P89V51RD2 has an on-chip oscillator. It needs an external crystal thats decides the operating frequency of the P89V51RD2.This 3

3. Power supply circuit: In the rectier circuit, we have used bridge rectier using diodes along with IC LM7805.The IC 7805 requires the input voltage between 9V to 18V, hence if we are using

mains 230V AC as input source then it must be stepped down using step down transformer. when an ac supply is give as source input,then it gets rectied in the following manner: (a) During the positive half cycle diodes D1 and D3 are forward biased while diodes D2 and D4 are reverse biased.so we get positive half cycle at the output of bridge rectier. (b) During negative half cycle diodes D1 and D3 are reverse biased and hence they do not conduct.While diodes D2 and D4 are forward biased giving us again the positive half cycle output at the output of the bridge rectier. If we use directly DC voltage source then the bridge rectier is bypassed directly and the input is given to the IC LM7805. The IC LM7805 is a positive voltage regulator ic with internal thermal shutdown.This IC provides constant dc supply of 5V at its output pin.Hence we get a constant DC supply voltage as Vcc to Microcontroller IC.

data memory. In this mode P0 has internal pull-ups because on port 0 I/O lines data and address bus are multiplexed. Port 0 receives the code bytes during Flash programming, and outputs the code bytes during program verication and hence External pull-ups are required during program verication.

(b) Port1: Port 1 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 1 output buers can sink/source four TTL inputs. When 1s are written to Port 1 pins they are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 1 pins that are externally being pulled low will source current (IIL) because of the internal pull-ups. Port 1 also receives the low-order address bytes during Flash programming and verication.

4. Ports of AT89C51: (a) Port0: Port 0 is an 8-bit open-drain bi-directional I/O port. As an output port, each pin can sink eight TTL inputs. When 1s are written to port 0 pins, the pins can be used as high impedance inputs. Port 0 may also be congured to be the multiplexed low order address/data bus during accesses to external program and 4

(c) Port2: Port 2 is an 8-bit bi-directional I/O port with internal pull-ups. The Port

2 output buers can sink/source four 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. As inputs Port 2 pins that are externally being pulled low will source current (IIL) because of the internal pull-ups. 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 addresses (MOVX @ DPTR). In this application, it uses strong internal pull-ups when emitting 1s. During accesses to external data memory that uses 8-bit addresses (MOVX @ RI), Port 2 emits the contents of the P2 Special Function Register. Port 2 also receives the highorder address bits and some control signals during Flash programming and verication.

Port Pin P3.0 P3.1 P3.2 P3.3 P3.4 P3.5 P3.6 P3.7

Function RxD TxD INT0 INT1 T0 T1 WR RD

This port does not have external pull ups as the data present at this port as mentioned above are important for timer interrupt and serial communication and so we do not want to change it easily. Port 3 also receives some control signals for Flash programming and verication.

5. Pull-up resistances: The output current from the microcontroller is 18 mA. If load connected is like dc motor or stepper motor which require a large amount of current then the this excess current can be drawn using power supply and external pull ups.In the absence of this external pull ups the excess amount of current which is required will be drawn from microcontroller ic and this will damage the microcontroller. 6. Circuit diagram of serial block:

(d) Port3: Port 3 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 3 output buers can sink/source four TTL inputs. When 1s are written to Port 3 pins they are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 3 pins that are externally being pulled low will source current (IIL) because of the pull-ups. Port 3 also serves the functions of various special features of the P89V51RD2 as listed below:

and check whether we are getting 5V at the output of it.Check connectivity of tracks. 3. Power on reset checking: Reset pin should go low for atleast two cycles so that mc gets initialize properly i.e. All the SFRs gets initialize to 00. Program counter initialize to 0000h. Stack pointer initialize to 07h. All the interrupt gets disable. To ensure that the peripherals connected to the microcontroller contain no bugs, the output of the ALE pin is checked. A square wave will be obtained at the ALE pin. 4. Component Testing Of Minimum Kit: The following steps are taken to ensure that the minimum system kit is working properly and is suited for the desired application: (a) To Ensure that all ports are properly connected: A program is loaded onto the microcontroller to give a square wave output of any suitable frequency at all the ports. The working of the ports is then checked by connecting an LED one by one to all the ports. Blinking of the LED throughout the operation governs the correct working of all the ports.If any error is reported, then the following steps are to be taken. i. Check the supply and ground are given properly or not. ii. Check connectivity of tracks. iii. Check the anode and cathode connection. Ideally anode is connected with Vcc and cathode with the ground. iv. Check the IC P89V51RD2 on IC tester. v. Check the led and pull up resistor. vi. Check the software. (b) Eight LEDS and 4X4 Matrix Keyboard: 6

7. Circuit diagram of minimum system:

Troubleshooting in minimum circuit

1. Track Testing: The rst step in checking if any system is working or not is to check the continuity of the tracks etched and the soldered parts. The Vcc and Gnd are checked for any shorting. If any such discrepancy exists, then it should be removed. The steps given below imply how to troubleshoot the rest of the circuit. 2. Power supply checking: First step is to check the supply voltage by DMM with the input voltage range from 9V to 18V.Check bridge rectier by checking 165 internal diodes of bridge.Then check input of 7805 regulator which is coming from DC supply,

Eight LEDs and Matrix Keyboard program is loaded on to the microcontroller. Here 8 LEDs are connected to Microcontroller along with matrix keyboard. As key-0 is pressed all LEDs remain o to show that Key-0 is pressed. Similarly, for key-15, all LEDs glow to show that data is 00001111 i.e., key-15. In this manner all keys are checked and detected. Through the key board if you are not able to detect any key then follow the steps given below for trouble shooting of the circuit: i. Check the supply and ground are given properly or not. ii. Check the connections of rows and columns. iii. Check the switches. iv. Check the IC P89V51RD2. v. Check the other devices which are connected with the key board. vi. Check connectivity of tracks. vii. Check the software.

data through transmitter and receiver then follow the steps given below for the trouble shooting of this circuit. i. Check the supply and ground are given properly or not. ii. Check if connections are made between the RX and TX pins and microcontroller iii. Check the transmitter and receiver connections. iv. Check the other devices which are connected with it.

LCD Interfacing

Liquid crystal display (LCD) has material which combines the properties of both liquid and crystals. They have a temperature range within which the molecules are almost as mobile as they would be in a liquid, but are grouped together in an order form similar to a crystal. This display contains two internal byte-wide regis(c) LCD: ters, one for command and second for characters The LCD program is loaded onto the to be displayed. There are three control signals microcontroller and the LCD is interfaced called R/W, DI/RS and En. The table given bewith the controller. Upon power on, the low will tell you what the use of these three signals is. LCD will start to glow which determines that it is receiving power from the controller. Correct presentation of the text on the LCD determines its correctly working. If you wont get desired display on LCD then follow the steps given below for troubleshooting of the circuit. i. Check the supply and ground are given properly or not. ii. Check the LCD and its pin connection. iii. Check the other devices which are conBy making RS/DI signal 0 you can send dierent nected with it. commands to display. These commands are used to iv. Check the IC P89V51RD2. initialize the LCD, to select display pattern, to shift v. Check the software. cursor or screen etc. The dierent commands and their functions are as given in the datasheet. (d) Serial communication: If you are not able to transmit or receive the 7

In order to avoid improper transfer of data to the LCD, the respective data bits should be present at the data bus for a specic amount of time. One way is to check the BUSY bit found on data line D7. This is not the best method because LCDs can get stuck, and program will then stay forever in a loop checking the BUSY bit. The other way is to introduce a delay in the program. The delay has to be long enough for the LCD to nish the operation in process. Instructions for writing to and reading from an LCD memory are shown in the previous table. At the beginning we mentioned that we needed 11 I/O lines to communicate with an LCD. However, we can communicate with an LCD through a 4-bit data bus. Thus we can reduce the total number of communication lines to seven. The wiring for connection via a 4-bit data bus is shown in the diagram below. In this example we use an LCD display with 2x16 characters. 1. Features (a) 16 Characters x 2 Lines. (b) 5x7 Dot Matrix Character + Cursor. (c) HD44780 Equivalent troller/driver Built-In. LCD Con-

2. Pin Description[connection of all 16 pins of LCD]

Pins D0-D7 RS R/W E LED+ LEDVcc Gnd

Descrpition Data Lines Register Select Read or Write Enable Display Logic Supply to LCD Gnd to LCD Source Voltage ground

3. Checking and initializing.

(a) adjust contrast using pot (b) connections of each pin with controller (c) checking enabling signal

(d) 4-bit or 8-bit MPU Interface.

Circuit Details

1. COMPONENTS USED: A. The HT9170: The HT9170 series are Dual Tone Multi Frequency (DTMF) receiversintegrated with digital decoder and bandsplit lter functions. The HT9170Band HT9170D types supply powerdown mode and inhibit mode operations.All types of theHT9170 series use digital counting techniques to detect anddecode all the 16 DTMF tone pairs into a 4-bit code output. Highly accurate 12 switched capacitor lters are employed to divide tone (DTMF) signals into lowand high group signals. A built-in dial tone rejection circuit is provided toeliminate the need for pre-ltering.

Item Interfacing Circuit[Only LCD and uC]

FEATURES: (i). Operating voltage: 2.5V 5.5V (ii). Minimal external components (iii). No external lter is required (iv). Low standby current (on power down mode)5. Excellent performance (v). Tristate data output for C interface (vi). 3.58MHz crystal or ceramic resonator (vii). 1633Hz can be inhibited by the INH pin (viii). HT9170B: 18-pin DIP packageHT9170D: 18-pin SOP package (ix).Complete DTMF Receiver (x).Low power consumption (xi).Internal gain setting amplier (xii).Adjustable guard time (xiii).Central oce quality (xiv).Power-down mode (xv).Inhibit mode

FUNCTIONAL DESCRIPTION: The HT9170 series tone decoders consist of three band pass lters and twodigital decode circuits to convert a tone (DTMF) signal into digital codeoutput. FILTER SECTION: The pre-lter is a band rejection lter which reduces the dialing tone from350Hz to 400Hz. The low group lter lters low group frequency signal outputwhereas the high group lter lters high group frequency signal output. Eachlter output is followed by a zero-crossing detector with hysteresis. Wheneach signal amplitude at the output exceeds the specied level, it istransferred to full swing logic signal. When input signals are recognized to beeective, DV becomes high, and the correct tone code (DTMF) digit istransferred. DECODER SECTION: Following the lter section is a decoder employing digital counting techniquesto determine the frequencies of the incoming tones and to verify that theycorrespond to standard DTMF frequencies. A complex averaging algorithmprotects against tone simulation by extraneous signals such as voice whileproviding tolerance to small frequency deviations and variations. Thisaveraging algorithm has been developed to ensure an optimum combinationof immunity to talk-o and tolerance to the presence of interferingfrequencies (third tones) and noise. When the detector recognizes thepresence of two valid tones (this is referred to as the signal condition insome industry specications) the Early Steering (EST) output will go to anactive state. Any subsequent loss of signal condition will cause EST toassume an inactive state. STEERING CIRCUIT:The steering control circuit is used for measuring the eective signal 9

durationand for protecting against drop out of valid signals. It employs the analogdelay by external RC time-constant controlled by EST. The timing is shown inFigure. The EST pin is normally low and draws the RT/GT pin to keep lowthrough discharge of external RC. When a valid tone input is detected, ESTgoes high to charge RT/GT through RC. When the voltage of RT/GT changesfrom 0 to VTRT (2.35V for 5V supply) the input signal is eective, and thecorrect code will be created by the code detector. After D0 D3 arecompletely latched, DV output becomes high. When the voltage of RT/GT fallsdown from VDD to VTRT (i.e.., when there is no input tone), DV outputbecomes low, and D0 D3 keeps data until a next valid tone input isproduced. By selecting adequate external RC value, the minimum acceptableinput tone duration (tACC) and the minimum acceptable inter-tone rejection(tIR) can be set.

B. DC motor: A DC motor consists of an stator, an armature, a rotor and a commutator with brushes. Opposite polarity between the two magnetic elds inside the motor cause it to turn. DC motors are the simplest type of motor and are used in household appliances, such as electric razors, and in electric windows in cars. A DC motor is equipped with magnets, either permanent magnets or electromagnetic windings, that produce a magnetic eld. When current passes through the armature, also known as the coil or wire, placed between the north and south poles of the magnet, the eld generated by the armature interacts with the eld from the magnet and applies torque. In a DC motor, the magnet forms the stator, the armature is placed on the rotor and a commutator switches the current ow from one coil to the other. The commutator connects the stationary power source to the armature through the use of brushes or conductive rods. Furthermore, DC motors operate at a xed speed for a xed voltage and there is no slip. 10

B. l293D: L293D is a dual H-bridge motor driver integrated circuit (IC). Motor drivers act as current ampliers since they take a low-current control signal and provide a higher-current signal. This higher current signal is used to drive the motors.L293D contains two inbuilt 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 and 7 and 10 and 15. Input logic 00 or 11 will stop the corresponding motor. Logic 01 and 10 will rotate 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 o and in the high-impedance state. Characteristics:

direction as per table 4. Similarly, motors M1 and M2 move for left turn, right turn, backward turn and stop condition

A. DTMF decoder:

E: Miscellaneous components i.Crytsl:3.59MHz ii.Resistors iii.Capacitors iv.Chassis and wheels 2. WORKING: Working overview: In order to control the robot, need to make a call to the cell phone attached to the robot (through head phone) from any phone, which sends DTMF tunes on pressing the numeric buttons. The cell phone in the robot is kept in auto answer mode. (if the mobile does not have the auto answering facility, receive the call by OK on the rover connected mobile and then made it in hands free mode.) So after a ring, the cell phone accepts the call.Now we may press any button on your mobile to perform actions as listed in table 4.The DTMF tones thus produced are received by the cell phone in the robot. These tones are fed to the circuit by the headset of the cell phone. The HT9170B decodes the received tone and sends the equivalent binary number to the microcontroller. According to the program in the microcontroller, the robot starts moving.When we press key 2 (binary equivalent 00000010) on our mobile phone, the microcontroller outputs 10001001 binary equivalent. Port pins PD0, PD3 and PD7 are high. The high output at PD7 of microcontroller drives the motor driver (L293D). Port pins PD0 and PD3 drive motors M1 and M2 in forward 11

As shown in gure it is made up form readily available MT8870 chip that is widely used for DTMF based application. It receives DTMF tones and generates 4-bit digital output corresponding to received DTMF signal of digits 0 9 and other signals. It receives input form cell phone to its pin no 2. It amplies it through internal op-amp amplier. If it receives valid DTMF tone, it will produce pulse output on StD (pin no 15). This is indicated by green LED connected as shown. The 4-bit digital output is latched on pins 11 - 14 and that is given to micro controller. The StD output is also given to interrupt pin of micro controller through transistor that will generate negative pulse every time when DTMF signal is received. This negative pulse will generate an interrupt. All the movements of robotic arm are controlled by cell phone digit switches 1 to 8. The 4 bit digital output corresponding to these switches form MT8870 are as given here

C. DC motor driver:

B. Microcontroller:

As shown in gure L293D is quadruple H-Bridge driver chip that is widely used for DC motor and stepper motor driver applications. It receives inputs from micro controller as shown on its input pins 2,7,10 and 15 and rotates two DC motors in either direction as per given table

As shown in gure a 40 pin, 8-bit micro controller 89C51 is used for controlling purpose. It receives 4-bit digital output from DTMF decoder on its port P1 pins P1.0 - P1.3. And interrupt signal is given to P3.3 (external interrupt 1) pin. It drives two DC motors through port P2 pins P2.0 - P2.3. A 12 MHz crystal with two 33pf capacitors is connected to crystal pins (18 and 19) to provide basic clock signal to micro controller. One push button switch (RST) in parallel with 100nF capacitor forms power on reset circuit to reset the micro controller. it will control the motion of land rover depending upon the code it receives from DTMF decoder as given in table 12

So to move the land rover forward or backward - left or right one has to send following data on port

Keil-an overview

Pen Ram International. 3. Muhammad Ali Mazidi,Janice Gillespie Mazidi, Rolin D. Mckinlay,The 8051 Microcontroller And Embedded Systems, Pearson Education. 4. www.efymag.com 5. www.datasheetcatalog.com 6. www.engineersgarage.com

A. Embedded language: Embedded software is in almost every electronic device design today. There is software software hidden in our watches, microwave, music system etc. Even the military uses embedded software to guide missiles and detect enemy activity. Communication satellites, space probes and modern medicine could be nearly impossible without it. Embedded softwares are developed using a dierent version of C called embedded C to suit programmer B. keil compiler: When the keil u-vision is used, the project development cycle is roughly the same as it is for any other software development 331 project: i. create source le in C or assembly ii. build application with the project manager iii. simulation of the project manager iv. correct errors in source les v. test the linked applications

Conclusion

A cellphone operated land rover was constructed and its working was observed. The project brought into light various technologies such as DTMF decoder, MIcrocontroller,etc. The land rover can be used as military robot as well as for various spying operations. This land rover can further improved to serve specic purposes. It requires four controls to roam around. The remaining eight controls can be congured to serve other purposes, with some modications in the source program of microcontroller.

10

References

1. Dogan Ibrahim,Microcontroller Projects in C,Newnes Publication. 2. Kenneth.J.Ayala,The 89C51 Microcontroller Architecture Programming and Applications, 13

S-ar putea să vă placă și