33
MINOR PROJECT REPORT ON CELL PHONE BASED AUTHORISATION SYSTEM SUBMITTED BY BIJAY LIMBU (ELX-8104) SABIN HUMAGAIN (ELX-8124) SUDIP MAHARJAN (ELX-8130) UNDER THE SUPERVISION OF ER. NIRANJAN KHAKUREL SUBMITTED TO DEPARTMENT OF ELECTRICAL AND ELECTRONICS 1

Controlling Devices Using Mobile Phone

Embed Size (px)

DESCRIPTION

device controlling using mobile phone

Citation preview

Page 1: Controlling Devices Using Mobile Phone

MINOR PROJECT REPORTON

CELL PHONE BASED AUTHORISATION SYSTEM

SUBMITTED BY

BIJAY LIMBU (ELX-8104)SABIN HUMAGAIN (ELX-8124)SUDIP MAHARJAN (ELX-8130)

UNDER THE SUPERVISION OF ER. NIRANJAN KHAKUREL

SUBMITTED TO DEPARTMENT OF ELECTRICAL AND ELECTRONICSNEPAL COLLEGE OF INFORMATION TECHNOLOGY

BALKUMARI, LALITPURNEPAL

POKHARA UNIVERSITY

JANUARY 2012

1

Page 2: Controlling Devices Using Mobile Phone

Abstract

Technology in the contest of communication system has developed in a steady manner. With the use of these technologies, human beings want better facilities so that they can have efficient and effective outputs in life.

We here have introduced a project named “Cell Phone Based Authorization System” through which user can lock or unlock the system with proper password. Users can easily interacts the system either by PSTN or any other mobile network. The DTMF tones received by the mobile phone is decoded to its equivalent 0’s and 1’s code by DTMF receiver IC. Outputs are then processed by microcontroller and desired results are obtained through relay driver and relay circuits. Visual indication is also displayed in LCD panel.

For that we have to use different methodology to complete our project. Mainly we use three sections for completing the project. First section is input section that consists Cell phone and also 3.5mm audio connector for encoding data to the system. Second section is processing section that consists of DTMF decoder and microcontroller. DTMF decoder decodes the input data and provides equivalent hexadecimal code which is stored and processed in microcontroller unit. Third section consists of driving circuit and call back network.

This type of project is developed by different researchers in different era of time. Various researches have been done on this project. Further researches are going on this topic.

The main goal of our project is to attain higher security through the help of commercially used cell phone as well as to access the system through remote areas.

KeywordsMicrocontroller, DTMF receiver, cell phone, MAX232

2

Page 3: Controlling Devices Using Mobile Phone

Acknowledgement

We would like to thank and heartfelt gratitude to our team supervisor Er. Niranjan Khakurel, whose encouragements, suggestions and comments made this research possible to shape in this form. We would also like to thank Electrical and Electronics program officer Er. Shivahari Acharya for his valuable advices. I have to remember my senior brothers and sisters for providing us uncountable suggestions and feedbacks during the project development.

We would like to thank Department of Electrical and Electronics for providing us with necessary help and support along with equipments, labs for testing and supervisor who helped us to accomplish the project.

We would also want to thank our teacher “Mr. Dilendra Bhatta” who encouraged us to accomplish the project and to be actively participate in the programme. We could not miss our teachers and our good wiles for their kind support.

We would very grateful to our colleagues Manoj Gautam, Rajesh Pandey, Sudan Krishna Balami, Sunil Gautam, Jenson Maharjan and all our classmates for their co-operation during our project period.

We would please to authors, publishers and organizations whose publications have helped us in completing the project.

3

Page 4: Controlling Devices Using Mobile Phone

iiiList of tables

Table 1 Cost estimation of the project 3

4

Page 5: Controlling Devices Using Mobile Phone

ivList of figures

Fig. 1 Block diagram of cell phone based authorization system 1

Fig. 2 Block diagram of cell phone based authorization system 4

Fig. 3 Pin configuration of P89V51RD2 microcontroller 6

Fig. 4 Internal architecture of P89V51RD2 microcontroller 6

Fig. 5 Pin configuration of MT8870 with external circuit elements 7

Fig. 6 Internal architecture of MT8870 decoder 8

Fig. 7 Pin configuration of MAX 232 with external circuit elements 8

Fig. 8 Pin configuration of PC 817 opto-isolator 9

Fig. 9 16 *1 LCD 10

Fig. 10 Relay 10

v

5

Page 6: Controlling Devices Using Mobile Phone

ACRYNOMOUS

CMOS Complementary Metal Oxide Semiconductor

DTMF Dual Tone Multiple Frequency

GPS Global Positioning System

GSM Global Servicer for Mobile

I/O Input / Output

LCD Liquid Crystal Display

N/W Network

PCA Programmable Counter Array

PSTN Public Switched Telephone Networks

SPI Serial Peripheral Interface

SW Switch

TTL Transistor Transistor Logic

TX/RX Transceiver

XTAL Crystal

vi

6

Page 7: Controlling Devices Using Mobile Phone

7

Page 8: Controlling Devices Using Mobile Phone

Table of Contents

Abstract iKeywords iiAcknowledgement iiiList of tables ivList of figures vAcrynomous vi

Chapter 1 INTRODUCTION 11.1 Project introduction 11.2 Objectives 21.3 Project at a glance 21.4 Feasibility study 2

1.4.1 Operational feasibility 21.4.2 Economic feasibility 3

Chapter 2 PROJECT OVERVIEW AND ANALYSIS 42.1 Block diagram 42.2 Hardware description 5

2.2.1 Microcontroller 52.2.1.1 P89V51RD2 5

2.2.2 DTMF receiver (MT8870) 72.2.3 MAX232 82.2.4 Opto-isolater (PC817) 92.2.5 LCD 92.2.6 Relay and relay driver 102.2.7 Circuit elements 10

2.3 Software 11Chapter 3 LITERATURE REVIEW 12Chapter 4 METHODOLOGY 14

4.1 Input section 144.2 Processing section 144.3 Output section 144.4 Flow chart 15

Chapter 5 EPILOGUE 175.1 Problem faced 175.2 Limitations 175.3 Recommendations 175.4 Conclusion 18

REFERENCESAPPENDIX

8

Page 9: Controlling Devices Using Mobile Phone

CHAPTER 1

INTRODUCTION

1.1 Project Introduction

In the present contest, cell phone is widely used, so concerning with this matter we here introduced a cell phone based authorization system. Now a day cell phone became a basic need for everyone, then how could we get the maximum benefits from cell phone in our daily life is the main motto of the project. With use of this system user can easily access the system by simply calling the number used in the system (if the user is remote from the system). To ensure the practicality and reliability of the system, user can directly communicate with system without calling, if user is within the system area.

To access the system, user must dial a proper password (4-digit). Therefore, in the case of password verified or matched, the user can easily access the devices connected to the system even from the remote places. However as concerned with above circumstances the system can be accessed by any cell phone because the system is not designed for specific one. However, regarding about these facilities the system can be hack and misuse by unauthorized person too. To overcome these difficulties here we introduced the higher security system. In this system, if twice or more than twice wrong password is encoded to system then siren is turn on in the system and at the same time instant the system automatically call back to the authorized owner.

Fig. 1: Block Diagram of Cell Phone Based Authorization System

9

Microcontroller(P89V51RD2)

DTMF Decoder

Driving Circuit

Display Unit

TX/RX

System Access Indicator

Siren and Call Back n/w

Page 10: Controlling Devices Using Mobile Phone

1.2 Objectives

The primary goal of this project is to use the cell phone in different part of our daily life such as authentication with higher security (digital key), as a multifunction remote control, as a bidirectional message/control exchanger and so on.• Realization of wireless tele-communication• Implementation of DTMF decoder for the data conversion• Interfacing microcontroller(P89V51RD2) with different i/o and interrupt routine• Realization of data conversion i.e.RS-232 to TTL logic by using MAX-232 • Implementation of serial data burning• Realization of different opto-isolators(PC817) and latches• Implementation of switching circuits and relay driver circuits

1.3 Project at a glance

With the utilization of the basic circuitry components like DTMF receiver, microcontroller, LCD, opto-isolator, transistors, etc we here designed a project entitled “cell phone based authorization system”. Initially message ‘welcome’ is displayed on LCD screen. Whenever the user dials to the number used in the system message ‘READY’ is generated due to ring detection, act as interrupt signal to microcontroller. With proper locking code press matched condition message ‘success’ displayed along with activation of door lock relay showing visual indication. If locking code press no matched message ‘wrong pw’ with warning buzzer is activated and the system call the authorized person to notify the miss use of system. User can easily access the system from the remote areas also if there is mobile network available. Also if user is near to system, he/she doesn’t need to call the system. He/she can access directly for cell with connecting audio jack due to this the reliable of system seem more effective.

1.4 Feasibility study

1.4.1 Operational Feasibility

This system is designed to get the maximum benefit of the commercially used cell phone. With the cell phone, user can easily access the system simply by calling along with appropriate access code. In addition, if the user is within the system, system can be accessed simply by connecting the connector to cell phone and enter the appropriate access code.

1

Page 11: Controlling Devices Using Mobile Phone

1.4.2 Economic Feasibility

It gives the details about the project economic. Total cost required for the development of project is tabulated below:

S.N. Components Required Cost(NRs)1. Dot PCB Board 1502. Resistors 2003. Capacitors 1004. Opto-isolator (PC817) 2005. Microcontroller (P89V51RD2) 3506. DTMF Receiver (MT8870) 1007. MAX232 908. LCD (16 X 1) 4009. Transistors 16010. Relays 5011. XTAL 8012. Reset SW 2013. Cell Phone 100014. Miscellaneous 100015. Total 3900

Table 1: Cost estimation of the project

1

Page 12: Controlling Devices Using Mobile Phone

CHAPTER 2

PROJECT OVERVIEW AND ANALYSIS

2.1 Block Diagram

Fig. 2 Block Diagram of Cell Phone Based Authorization System

DTMF Receiver

Microcontroller(P89V51RD2)

Cell Phone

Transistor Latch

LCDHandshaking

n/w

Transistor n/w

Data Flow Indicator

Call Back Switching n/w

Direct i/p via Cell Phone

Tone Detecting Circuit and Indicator

MAX232

PC

Siren

System

Driving Circuit

Handshaking signal n/w

3.5mm audio connector

1

Page 13: Controlling Devices Using Mobile Phone

2.2 Hardware Description

2.2.1 Microcontroller

A microcontroller has a CPU (a microprocessor) in addition to affixed amount of RAM, ROM, I/O ports and a timer all on the single chip. In other words, the processor, RAM, ROM, I/O ports and timer all are embedded together on one chip.

2.2.1.1 P89V51RD2

The P89V51RD2 is a 80C51 microcontroller with 64kB Flash and 1024 bytes of data RAM. A key feature of the P89V51RD2 is its X2 mode option. The design engineer can choose to run the application with the conventional 80C51 clock rate (12 clocks per machine cycle) or select the X2 mode (6 clocks per machine cycle) to achieve twice the throughput at the same clock frequency. Another way to benefit from this feature is to keep the same performance by reducing the clock frequency by half, thus dramatically reducing the EMI.

The Flash program memory supports both parallel programming and in serial In-System Programming (ISP). Parallel programming mode offers gang programming at high speed, reducing programming costs and time to market. ISP allows a device to be reprogrammed in the product under software control. The capability to field/update the application firmware makes a wide range of applications possible. The P89V51RD2 is also In-Application Programmable (IAP), allowing the Flash program memory to be reconfigured even while the application is running.

Features

80C51 Central Processing Unit

5 V Operating voltage from 0 MHz to 40 MHz

64kB of on-chip Flash user code memory with ISP (In-System Programming) and IAP (In-Application Programming)

Supports 12-clock (default) or 6-clock mode selection via software or ISP

SPI and enhanced UART

PCA with PWM and Capture/Compare functions

Four 8-bit I/O ports with three high-current Port 1 pins (16mA each)

Three 16-bit timers/counters

Eight interrupt sources with four priority levels

Second DPTR register

Low EMI mode (ALE inhibit)

TTL- and CMOS-compatible logic levels

Low power modes Power-down mode with external interrupt wake-up Idle mode

1

Page 14: Controlling Devices Using Mobile Phone

DIP40 package

Fig. 3 Pin Configuration of P89V51RD2

Fig. 4 Internal Architecture of P89V51RD2 microcontroller

1

Page 15: Controlling Devices Using Mobile Phone

2.2.2 DTMF Receiver (MT8870)

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 three-state bus interface.

Features

• Complete DTMF Receiver• Low power consumption• Internal gain setting amplifier• Adjustable guard time• Central office quality• Power-down mode• Inhibit mode• Backward compatible with MT8870C/MT8870C-1

Fig. 5 Pin Configuration of MT8870 with external circuit elements

1

Page 16: Controlling Devices Using Mobile Phone

Fig. 6 Internal Architecture of MT8870 decoder

2.2.3 MAX232

It is a logic converter circuit including a capacitive voltage generator to supply EIA 232 voltage levels from a single 5-V supply. Each receiver converts EIA-232 inputs to 5-V TTL/CMOS levels. Receivers have a typical threshold of 1.3 V and a typical hysteresis of 0.5 V, and can accept ±30-V inputs. Each driver converts TTL/CMOS input levels into EIA-232 levels.

Fig. 7 Pin Configuration of MAX232 with external circuit elements

1

Page 17: Controlling Devices Using Mobile Phone

2.2.4 Opto-isolator (PC817)

Opto-isolator is used to provide isolation between the two different circuits. It consists of a gallium-arsenide infrared- emitting diode optically coupled monolithic silicon phototransistor detector. The light emitted by the opto-isolator triggers the base of the NPN phototransistor. The amount of the infrared emitted corresponds to the voltage at the output of the opto-isolator. This device is available in a 4-terminal DIP package.

Fig. 8 Pin Configuration of PC817 Opto-isolator

Applications:

General purpose switching circuit Interfacing and coupling systems of different potentials and impedances Regulation feedback circuits Monitor and detection circuits Solid state relay

2.2.5 LCD

Display elements to display 16-bit data. Has two registers namely:

o Data Registero Command Register

Data Register is used for displaying 8-bit data. Different commands associated for display are1

o 0x01 : To clear the display screeno 0x80 : Forces cursor to beginning of 1st line.o 0x06 : Increment cursor (Shift cursor to right).

1

Page 18: Controlling Devices Using Mobile Phone

Fig. 9 16*1 LCD

2.2.6 Relay and Relay driver

Relay is an electromechanical switch used to isolate the controlling and controlled equipments. The relay cannot be interfaced with IC for satisfactorily drive. Therefore, relay drive circuits are required.The transistor realizes the driver circuit. The base of the transistor is biased by the microcontroller output, which enable the ground voltage from collector to be switched to the emitter when switched on. For the protection of the relay, a freewheeling diode is used in parallel with the relay coil terminal connecting N-type of diode to the positive voltage supply.

Fig. 10 Relay

2.2.7 Circuit Elements

The basic circuit components used in our project development are listed below:

Resistors Capacitors Transistors Diodes Connecting wires Connectors etc.

1

Page 19: Controlling Devices Using Mobile Phone

2.3 Software

In the preceding chapter, the circuit operation and the hardware details are described above. In the current part, the software portion required for the project development process is highlighted. The different software portions used in the project are listed below:

i. SDCCii. Proteus (ISIS)iii. Notepad++iv. Flash Magicv. C/C++

The source code for the project is written in notepad++ in simple C language. The error detection is quite easier in notepad++ and the code is saved in ‘.c’ format. As the ‘.c’ format file is not recognized, it is converted into ‘.hex’ format using SDCC compiler.Necessary simulation is carried out in proteus during testing, debugging process.

1

Page 20: Controlling Devices Using Mobile Phone

CHAPTER 3

LITERATURE REVIEW

In past applicable systems, numerous no. of problems related to economic feasibility and operational feasibility are found due to which all the past applicable systems cannot meet the challenges that are important to run the system. Along with these demerits, the expensive technology that does not led the implementation of a successful system.

Many researchers can researches on the similar type of our project. Researchers implemented their own concepts and ideas on their project. Different difficulties are faced while searching about the project. During the mid of 1990’s, researches on this topic has been started. To get high security in the home, people started researched on this topic. The Cell phone is commonly used technology. So, to use Cell phone in the security system it is more reliable and have high secure. So researched on this topic has been started. In may 2006 Mr. Arturo Palau (EE) and his team research on the topic, Cell Phone Based Remote Home Control System. They found, the cell phone-based interface at home (control unit) would relay the commands to a microcontroller that would perform the required function/action, and return a function completion code that would be sent to the source of the original command (user’s cell phone).

Ivar Jorstad and Tore Jonvik also research on a the topic, Strong authentication with mobile phone as security token. They found the various ways the mobile phone can be used as an authentication token towards service providers on the Internet. It starts with discussing the need for a strong authentication scheme, and the motivation for using the mobile phone to improve on several aspects of the current authentication processes. Several different authentication solutions using the mobile phone as authentication token are described, where the solutions vary in complexity, strength and user-friendliness.

Peng Kunyu, Zheng Jiande, Yang Jing also done a research on the topic, An identity authentication system based on mobile phone token. According to them a new token authentication scheme, which can closely integrate with the traditional authentication system to form a seamless interface and directly use the corresponding authorization and the access control service, and realize a prototype system finally. In their model of authentication, they transform the challenge-response token authentication to password authentication, which solves the secure problem of the password authentication. Developed a mobile phone token software based on the lightweight crypt package from Bouncy Castle and the J2ME platform, which solves scheme's feasible problem; design a bluetooth communication model between the mobile phone token and the PC; complete the development of mobile phone token authentication prototype system finally.

Ivar Jorstd and Do Van Thanh researched on, The Mobile Phone as Authentication Token. From their researched they found, several ways to employ the mobile phone as an authentication token, with the purpose of addressing shortcomings of existing authentication solutions on the Internet today. Their project shows that there are many different possibilities, and that the authentication process can take one single path back and forth, or exploits several channels (multi-channel authentication) to complete the authentication. The project also informally illustrates the security properties of the system.

2

Page 21: Controlling Devices Using Mobile Phone

Due to the above researches, we easily say that there are various studies are going on this topic. It is the new topic for researched. In the contents of Nepal, researches on this topic are very newly. Very few researches have been done on this topic in Nepal. So, it is newly researched topic for us (Nepalese) and globally rising researched topic.

2

Page 22: Controlling Devices Using Mobile Phone

CHAPTER 4

METHODOLOGY

Our project can be operated within three sections:

Input Section Processing Section Output Section

3.1 Input section

Input section consists of cell phone as a transceiver along with external circuitry components. The system user from remote area dials to the system cell phone. With first ring interrupt routine is invoked which initialize the system to take the data to the system and after synchronizing with system automatically starts to receive the encoded bits. If the user is within the system, the user needs not to dial to the system cell phone. The user can easily access the system simply connecting the connector and enter 4-digit code.

3.2 Processing Section

Processing section consists of DTMF receiver, transistor latches and microcontroller unit. The codes pressed having DTMF frequencies are decoded by DTMF receiver into equivalent 4-bit code. These codes are fed to microcontroller ports through transistor latches and are stored in the memory. The stored code is compared with the system default code. After completing the comparison process if the entered 4-digit code is matched, the message “SYSTEM ACCESS” is displayed through the display unit. Along with the message, microcontroller sends signal to the relay driver for accessing the system. If the entered code is not matched then message “RE-ENTER” is displayed and counter value is increased. When counter value equals to or greater than two, “WRONG PW” is displayed and siren is activated to inform that the unauthorized user uses the system. At the same time the system cell phone automatically calls back to the authorized user of the system.

3.3 Output Section

The output section consists of output devices to show the system access or system halted. Depending upon the signals provided by the processing section, the output devices are driven by relay and relay driver unit.

2

Page 23: Controlling Devices Using Mobile Phone

3.4 Flow Chart

2

Start

Initialize the system

Read the data

If interrupt received

Store and compare the data

If password matched

Increase the counter value

NO

YES

YES NO

B

System access

C

A

C

Turn on the siren and call back authorized userA YES NO C

Page 24: Controlling Devices Using Mobile Phone

2

Turn on the siren and call back authorized user

If counter

<=2

B

A

C

YES NO

Page 25: Controlling Devices Using Mobile Phone

CHAPTER 5

EPILOGUE

5.1 Problems Faced

We encountered many problems during the development of our project. The main obstacles we faced during the project period are mentioned below:

i. Long time data guard time of DTMF decoder ii. Receiving and transmitting through cell phone is not possible at the same instant of timeiii. Slow response of driving circuitsiv. Noise due to external interferencev. Low output current of DTMF and microcontroller for driving circuits

5.2 Limitations

The project we designed has certain limitations. Some of the limitations are listed below:

i. To access system from tele areas need to have a mobile n/w for communicationii. Only a limited number (below 13) of devices can be controllediii. Continuous requirement of power for the system

5.3 Recommendations

The future enhancements that can be carried out are:

i. Addition of GPS system, navigation and system accessii. Addition of GSM modem, system can be accessed via textiii. Addition of RF receiver, system can be accessed by any kind of RF based controllers

2

Page 26: Controlling Devices Using Mobile Phone

5.4 Conclusion

Cell phone became a basic need for everyone, then how we could get the maximum benefits from cell phone in our daily life is the main motto of the project. With use of this system user can easily access the system by simply calling the number used in the system (if the user is remote from the system).

The main goal of our project is to get a high security system through the commercially used cell phone. For that, we have used many methods and techniques for the implementation of our project. We have used mobile network for communicating purpose with the system. we look our project mainly into three sections, they are input, processing and output.

In input section, cell phone is used that act as an interface between user and the system. Input from input section is fed to processing section. In this section, input codes are decoded, stored, compared and final result after processing is provided to output section. Depending on the output results of processing section, output devices are activated or siren is activated along with auto call back to authorized user.

Due the higher security and its economic feasibility, the project can be used in every fields where high security is desired. The research about the topic is going on. With the addition of different system (GPS, GSM modem, RF receiver) the project can be further modified in future.

2