C H A P T E R 1 INTRODUCTION The mentioned project is based on the worlds most powerful intel controller 8051. Most of the services provided in todays world are voice interactive, you call up your bank and computerised voice will speak to you, and guide you to enter a particular number from your phone to get the desired service. So this project is give the basic idea that how we can remotely control the industrial applications with use of mobile phone. You can switch on/off devices using your mobile phone or land line phone eight numbers loads can be connected to the eight relay provided. Here in this project we are going to connect 3 relay with controller. And with this relay we can connect any type of load. Suppose you own a company and are three or more partners and are always travelling. You have an office located some where. And have a main server you donot want that somebody other then your partner should handle this server due to security reason. At the same time you donot want to keep your server all the time on so ther this device comes to your help only requirement for this device is a parallel telephone connection. and of course power supplay.you can switch on your server remotely from any where in the world. Whenyou dial the number where this device is connected with the server, after some time the phone will automatically pic up. Then you have to enter the password. When you enter the password. If your password is correct then device will further respond otherwise it will not give any further response. Now if your password is correct and you will enter any number from the remote mobile it will decode that number and give different hax output for every number and according to that the particular relay will work and corresponding divice connected with that relay will turn on for particular time which is already define in program then that device will automatically turn off. As we disconnect the mobile the circuit will disabled and wait for the next call. 1
CHAPTER 2 BLOCK DIAGRAM THIS DEVICE HAS THE FOLLOWING BLOCKS 1. Dtmf decoder ic mt 8870 2. Microcontroller circuit the central processor 89c51 3. Not gate 74LS04 4. Mobile interfacing 2
2.1 DTMF DECODER MT8870: This circuit detects the dial tone from a telephone line and decodes the keypad pressed on the remote telephone. The dial tone we heard when we pick up the phone set is call Dual Tone Multi-Frequency, DTMF in short. The name was given because the tone that we heard over the phone is actually make up of two distinct frequency tone, hence the name dual tone. The DTMF tone is a form of one way communication between the dialer and the telephone exchange. A complete communication consist of the tone generator and the tone decoder. In this article, we are use the IC MT8870DE, the main component to decode the input dial tone to 5 digital output. These digital bits can be interface to a computer or microcontroller for further application (eg. remote control, phone line transfer operation, etc...). As technology matures, pulse/dial tone method was inverted for telephony communication. It uses electronics and computer to assist in the phone line connection. Basically on the caller side, it is a dial tone generator. When a key is being pressed on the matrix keypad, it generate a unique tone consisting of two audible tone frequency. For example, if the key '1' is being press on the phone, the tone you hear is actually consist of a 697hz & 1209hz sine signal. Pressing key '9' will generate the tone form by 852hz & 1477hz. The frequency use in the dial tone system is of audible range suitable for transmission over the telephone cable. On the telephone exchange side, it has a decoder circuit to decode the tone to digital code. For example, the tone of 941hz + 1336hz will be decoded as binary '1010' as the output. The dtmf decoder produce the frequency as per the following table: 3
1209 Hz 1336 Hz 1477 Hz 1633 Hz 697 Hz 1 2 4 A 770 Hz 4 5 6 B 852 Hz 7 8 9 C 941 Hz * 0 # D Table 2.1.1 frequency produced by different no Now after detecting the particular frequency it will convert it in to hex. Detection of dial tones is reflected on the bit TOE, while the output Q4, Q3, Q2, Q1 indicate the dial tone that is being detected on the telephony system. A complete table of the decoded digital output for individual dial tone is as per the following table. Key Tone Output Logic Q4 Q3 Q2 Q1 1 0 0 0 1 2 0 0 1 0 3 0 0 1 1 4 0 1 0 0 5 0 1 0 1 6 0 1 1 0 7 0 1 1 1 8 1 0 0 0 9 1 0 0 1 0 1 0 1 0 * 1 0 1 1 # 1 1 0 0 A 1 1 0 1 B 1 1 1 0 C 1 1 1 1 D 0 0 0 0 Table 2.1.2 output provided by different no Now output of dtmf decoder will given to the microcontroller. 4
CHAPTER 3 CIRCUIT DIAGRAM 5
3.1 CIRCUIT DESCRIPTION : As shown in circuit diagram the mobile phone will connected to dtmf decoder via 0.1u capacitor and 100k resistor with the use of handsfree. In the basic configuration the pin no 1 and 4 are shorted.we give input at pin no 2.the pin no 2 and 3 are shorted.pin no 5,6 and 9 are connected to gnd. Connect vcc to pin no 18.connect ristor of 330k between 16 and 17 no pin.pin no 17 is connected to VCC via 0.1uf capacitor. Crystal of 3.57mhz is connected between pin no 16 and 17.and both pins are connected to gnd via 22pf capacitor. We get output at pin no 11,12,13 and 14. Connect led with all this output pins. Connect led at pin no 15 also bcoz it will becom high when no is dialled. As per the circuit diagram do the basic connection of microcontroller. Then connect the output of the dtmf to the pin no p1.1,p1.2 and p1.3. connect output of pin no 15 of dtmf decoder to the pin no p3.2 of controller. Also connect output to the leds. Leds are connected to gnd via 1k resistor. We get output at pin no p2.1,p2.2 and p2.3. connect the output to the led(same for all 3 output). Connect emitter to gnd and collector to 5volt. We have to give separate supply for both 8870 and at89c51. Connect all supply through 1k resistor. 6
3.2 OPERATION : The input is given to the pin no 2 of the dtmf decoder which is the non inverting input of the op-amp. The inverting and gain adjusting pins are shorted. Then it will converted in to hex code by ADC converter. That output we get at pin no 11,12,13 and 14. The leds are connected to it so we can see the output of dtmf decoder. There is pin no 15 which will going to be high every time when we press no. It is connected to the pin no 13 of the controller which is the pin of external interrupt 1. When no is pressed on the remote mobile this pin will goes high so interrupt will occur and the input is scanned and check which no is pressed according to that it will give output at port no 2. This pins are connected to microcontroller so input is given to the controller First of all it will check for the password if password is wrong then it will go out of the program. And if password is right then it will procedure further. If we press 1 the pin no p2.0 will goes high. If we press 2 the pin no p2.1 will goes high. If we press 4 the pin no p2.2 will goes high. We can see the output at port 2 bcoz we connected the leds with it. 7
2.2 MICROCONROLER AT89C51; Features Compatible with MCS-51 Products 4K Bytes of In-System Reprogrammable Flash Memory Endurance: 1,000 Write/Erase Cycles Fully Static Operation: 0 Hz to 24 MHz Three-level Program Memory Lock 128 x 8-bit Internal RAM 32 Programmable I/O Lines Two 16-bit Timer/Counters Six Interrupt Sources Programmable Serial Channel Low-power Idle and Power-down Modes 8
Description: The AT89C51 is a low-power, high-performance CMOS 8-bit microcomputer with 4Kbytes of Flash programmable and erasable read only memory (PEROM). The device is manufactured using Atmel s high-density nonvolatile memory technology and is compatible with the industry-standard MCS-51 instruction set and pin out. The on-chip Flash allows the program memory to be reprogrammed in-system or by a conventional nonvolatile memory programmer. By combining a versatile 8-bit CPU with Flash on a monolithic chip, the Atmel AT89C51 is a powerful microcomputer which provides a highly-flexible and cost-effective solution to many embedded control applications. In this project we mainly use the interrupt so now we see about interrupt. Port 3 is an 8-bit bi-directional I/O port with internal pullups. The Port 3 output buffers can sink/source four TTL inputs. When 1s are written to Port 3 pins they are pulled high by The internal pullups and can be used as inputs. As inputs, Port 3 pins that are externally being pulled low will source current (IIL) because of the pullups. Port 3 also serves the functions of various special features of the AT89C51 as listed below: Port 3 also receives some control signals for Flash programming and verification. RST Reset input. A high on this pin for two machine cycles while the oscillator is running resets the device. ALE/PROG Address Latch Enable output pulse for latching the low byte of the address during accesses to external memory. This pin is also the program pulse input (PROG) during Flash programming. In normal operation ALE is emitted at a constant rate of 1/6 the oscillator frequency, and may be used for external timing or clocking purposes. Note, however, that one ALE Port Pin Alternate Functions P3.0 RXD (serial input port) P3.1 TXD (serial output port) P3.2 INT0 (external interrupt 0)(used in project) P3.3 INT1 (external interrupt 1) P3.4 T0 (timer 0 external input) P3.5 T1 (timer 1 external input) P3.6 WR (external data memory write strobe) P3.7 RD (external data memory read strobe) 9
Interrupt enable sfr: bit description symbol B7 enable all interrupts B6 reserved B5 reserved B4 enable serial port interrupt B3 enable timer 1 interrupt B2 enable external interrupt 1 B1 enable timer 0 interrupt B0 enable external interrupt 0 EA(used bit) ES ET1 EX1 ET0(used bit) EX0 And we use port 1 as input port to take input from the dtmf decoder. We use port 2 as output port to give the output to the realy driver circuit. 2.3 NOT GATE 74LS04: 10
7404 is a NOT gate IC. It consists of six inverters which perform logical invert action. The output of an inverter is the complement of its input logic state, i.e., when input is high its output is low and vice versa. It is very easy to use we have to just give vcc to pin no 14 and gnd to pin no 7. It has 6 input pins. So we can maximum invert 7 inputs. At the output we get tnverted output. 2.4 MOBILE INTERFACING: For this purpose we use the handsfree of that particular mobile phone. Cut one of the earburd.there will be two wires, from that one(green) is ring and other(black) is ground. Connect green to the input of dtmf decoder and ground other one. 11
2.5 ALGORITHM : Wait for the phone If call arrived the remote phone the system will answer automatically in 5 second. After that system will check the password. If correct then procedure farther and if wrong then system will not respond. After that if we press 1 corresponding led will glow. If we disconnect the phone the whole system will disable. 12
CODE IN ASSEMBLY LANGUAGE org 0000h mov r1,#00h int:mov p1,#0ffh mov p2,#00h mov ie,#84h h1:sjmp h1 sjmp int org 0013h inc r1 cjne r1,#01h,lol sjmp pw lol: mov a,p1 mov b,a anl a,#01h cjne a,#00h,l2 setb P2.0 call delay clr P2.0 sjmp e l2: clr a mov a,b anl a,#02h cjne a,#00h,l3 setb P2.1 call delay clr p2.1 sjmp e l3:clr a 13
mov a,b anl a,#04h cjne a,#00h,e setb P2.2 call delay clr P2.2 sjmp e clr a delay: MOV R0, #51h AGN:MOV TMOD, #01H MOV TH0, #00H MOV TL0, #00H SETB TR0 IRR:JNB TF0, IRR CLR TF0 DJNZ R0, AGN RET pw: mov a,p1 mov b,a anl a,#01h cjne a,#00h,over reti e: reti over: end 14