You are on page 1of 18

1.

Introduction

Home security has been a major issue where crime is increasing and everybody wants to take proper measures to prevent intrusion. In addition, there is need to automate home so that the user can take the advantage of technological advancement. This project presents a model that will provide security to their home, office or cabin etc via SMS using GSM technology.

Keeping in view the rapid growth of wireless communication we are inspired to work on this project. The idea behind this project is to meet the upcoming challenges of the modern practical applications of wireless communication and to facilitate our successors with such splendid ideas that should clear their concept about wireless communication and control system.

The applications of SMS/GSM Based security system are quite diverse. There are many real life situations that require control of different devices remotely and to provide security. There will be instances where a wired connection between a remote appliance/device and the control unit might not be feasible due to structural problems. In such cases a wireless connection is a better option.

Basic Idea of our project is to provide GSM Based security even if the owner is away from the restricted areas. For this we adopted wireless mode of transmission using GSM. Beside this there are many methods of wireless communication but we selected GSM in our project because as compared to other techniques, this is an efficient and cheap solution also, we are much familiar with GSM technology and it is easily available.

This project is designed to provide ubiquitous access to the system for the security using extensive GSM technology for communication purposes andmicrocontroller for device control. The highlights of our system are the long range of communication and password security. The security is provided by sending a message to our access number, controlling and acknowledgement is done through SMS code between our access number and the authenticated user.

This system consists of a GSM modem for sending and receiving the SMS, Intel 89S52 microcontroller which is controlling the entire system, LCD for the display purpose , keypad for entering the password and supporting circuitries like rectifier for ac to dc conversion. It can be installed at any desired location e.g., office (to protect important files and document), banks (to protect cash in locker) etc.

In this system, the authorized person will have the entire control and he will decide which people will be allowed in that restricted area. Those person who can have access to that area, will have a password in advance. If any one wants to enter in that restricted area in the absence of authorized person, then that person will enter the password on the keypad. If the password will be correct, then a message containing the details like name, address and designation etc. of that person will be

forwarded to authorized person via GSM Modem. Now the authorized person will send a coded reply to the microcontroller via GSM Modem. Depending upon the response from the authorized person, microcontroller will decide whether to permit or not. If the approval will be positive then the controller will turn on the relay connected to the door and the authenticated user will be in a position to have access to that area else the request will be rejected and the door will not open. The GSM modem provides the communication mechanism between the user and the microcontroller system by means of SMS messages.

The microcontroller is an exiting, challenging, and growing field; it will pervade industry for decades to come. To meet the challenges of this growing technology, we will have to conversant with the programmable aspect of the microcontroller. Programming is a process of problem solving and communicating in a strange language of mnemonics. The projects could be developed significantly faster and much easily using a microcontroller.

The purpose of this project is to implement the various concepts of microcontroller and embedded designing environment. An embedded microcontroller is a chip which has a computer processor with all its support functions (clock & reset), memory (both program and data), and I/O (including bus interface) built into the device. These built in functions minimize the need for external circuits and devices to be designed in the final application.

This Project is a very good example of embedded system as all its operations are controlled by intelligent software inside the microcontroller. Read more about what is embedded system.

The aim of this project is to provide security to the restricted area even if the owner is anywhere in the world. For this purpose user can use any type of Mobile. This way it overcomes the limited range of infrared and radio remote controls.

Short Message Service (SMS) is defined as a text-based service that enables up to 160 characters to be sent from one mobile phone to another. In a similar vein to email, messages are stored and forwarded at an SMS centre, allowing messages to be retrieved later if you are not immediately available to receive them. Unlike voice calls, SMS messages travel over the mobile networks lowspeed control channel.

"Texting", as its also known, is a fast and convenient way of communicating. In fact, SMS has taken on a life of its own, spawning a whole new shorthand language thats rapidly being adopted as the norm.

Technology Used:

As microcontrollers are the core of the todays digital circuit design in industry, this system uses it for the centralized operation and digital processing. The technology used here is embedded technology which is the future of todays modern electronics.

Here we have used a very high speed Microcontroller i.e. 89S52. This runs on 6-clk cycle period instead of 12-clk cycle. This makes the communication rate faster at 115200kbps. Since we are using F-Bus protocol with the mobile, a full duplex communication with the above baud rate is required.

Features:
The following are the prominent features of SMS based security system Can provide security to 8-devices, User-programmable plain text message control, Communicate from any other mobile, Password protected, Can be controlled from anywhere, anytime, In-system programmable i.e. we can modify the code of the Controller at anytime depending upon our requirement without taking out the controller from the board.

What contributions would the project make? If this system is installed in an office cabin where all important files (share paper, tender files or other files) are kept and the owner is in away from the place (e.g., London) attending a meeting and at the same day he is supposed to submit a tender. In this case he can allow any of his trustworthy employees and get the work done. In this way he will be saved from the bearing a heavy loss. This system can be used for home automation too with desired changes in the program and by some additional hardware. If you need to turn pumps, lights etc. on remotely or need to remotely monitor equipment alarms then this project is for you. There are thousands of uses, like turning on remote pumps, lights, monitoring cool room temperatures, open doors etc. 1.2 Objectives

The main objectives behind this project are as follows: To provide security to the restricted area from a remote place. To make the system much more user friendly.

1.43

Development Stages & Process The complete development of this system can be divided into the following stages

1.3.2

Problem definition stage Designing block diagram Implementing circuits and components Developing flowchart for software Writing actual code for Microcontroller Compiling the code Burning the hex file into microcontroller with programmer Testing Running Documentation

Problem definition stage This is the very first stage to develop any project. It actually defines the aim and the concept of the project. The aim of Remote Process Control Using Mobile Phone is to design a top class access control system that can be controlled from anywhere in the world.

1.3.2

Designing block diagram

At this stage we have categorized the whole system into different individual modules. These modules (block diagrams) will be helpful in understanding the concept and working of the integrated system.

1.3.3

Implementing circuits and components

This is the actual implementation of circuit of each block. At this stage we have actually designed each block separately and finally integrated them into the complete working system.

1.3.4

Developing Flowchart for software

To get the logical flow of the software, the development of flowchart is having a prominent role. So that we have analyzed the complete system and organized the flowchart in such a manner that one can understand the complete working of the software.

1.3.5

Writing actual code for Microcontroller

After the development of the algorithm and flowchart we have actually translated them in C language for P89S52 Microcontroller so that it can understand the instructions and run as per our requirement. The instructions are in ANSI C Language.

1.3.6

Compiling the code

The hand written code on paper was then transferred into computer. For that we have used Keil preinstall on PC. The Keil is a Computer Aided Program to simulate the working of Microcontroller in real time without burning the software into actual IC. We simulated and compiled our program for error checking. After removing several compiling errors the program was converted into machine language i.e. Intel hex format.

1.3.7

Burning the hex file into microcontroller with Programmer

In this stage the compiled hex format file was downloaded or burned into Philips P89S51 flash Microcontroller. This was done by using the Philips in-system programming software provided by the manufacturer itself.

1.3.8

Testing

This time we tested our project for actual working, after loading the software into the microcontroller. Any errors found were removed successfully.

1.3.9

Running

This is the last and final stage of development of our project. In this stage a user flowchart was made so that any one can use this system without any difficulty.

1.4

Specifications Power supply : 0-9V,0.5A Input : 230V,50Hz AC supply Output : Four potential free outputs (i.e. relay output)

Operating temp range : 0 to70C Maximum 5 Amp load can be sensed. Display indication : 16*2 alpha numeric LCD Size : 1 foot * foot. Weight : 800 Gms GSM Technology

1.5 1.5.1

Technical Specifications

Microcontroller (89S52) 89S52 Central Processing Unit On-chip Flash Program Memory with In-System Programming In-System Programming(ISP) and In-Application Programming (IAP) capability Boot ROM contains low level Flash programming routines for downloading via the UART 6/12 clocks per machine cycle operation (standard/optional) Speed up to 20 MHz with 6 clock cycles per machine cycle (40 MHz equivalent performance); up to 33 MHz with 12 clocks per machine cycle

RAM expandable externally to 64 kB 4 level priority interrupt 8 interrupt sources Four 8-bit I/O ports Full-duplex enhanced UART(Framing error detection & Automatic address recognition) Power control modes( idle & power down mode) Programmable clock out Asynchronous port reset

1.5.2

Relay 12V sugar cube relay. Relay coil resistance: 60 ohm Relay current resistance: 40mA

1.5.3

MAX 232A Operate from Single +5V Power Supply. Low-Power Receive Mode in Shutdown. Meet All EIA/TIA-232E and V.28 Specifications. Multiple Drivers and Receivers. 3-State Driver and Receiver Outputs.

1.5.5

REGULATOR ICs (7805) . Input voltage: . Output voltage: CHAPTER 2 SYSTEM DESCRIPTION 2.1 Block Diagram 10V 5V

2.2

Microcontroller

Refer Microcontroller Tutorial

2.2.3

Microcontroller (89S52)

ATMEL 89S52 is the heart of the circuit. This device is a Single-Chip 8-Bit Microcontroller manufactured is a derivative of the 80S52 microcontroller family.

The device has four 8-bit I/O ports, three 16-bit timer/event counters, a multi-source, four-prioritylevel, nested interrupt structure, an enhanced UART and on-chip oscillator and timing circuits.

The 89S52 device contains a non-volatile 4kB Flash program memory that is both parallel programmable and serial In-System and In-Application Programmable. In-System Programming (ISP) allows the user to download new code while the microcontroller sits in the application. In-Application Programming (IAP) help the microcontroller to fetch new program code and reprograms itself while in the system. This allows for remote programming over a modem link. The instruction set is 100% compatible with the 80S52 instruction set.

A default serial loader (boot loader) program in ROM allows serial In-System programming of the Flash memory via the UART without the need for a loader in the Flash code. For In-Application Programming, the user program erases and reprograms the Flash memory by use of standard routines contained in ROM. This device executes one machine cycle in 6 clock cycles, hence providing twice the speed of a conventional 80S52.

2.2.4

Pin Diagram

Pin Diagram of 89S52 is as shown below:

Pin Description: VCC - Supply voltage. GND - Ground. Port 0 Port 0 is an 8-bit open-drain bi-directional I/O port. As an output port, each pin can sink eight TTL inputs. Whens 1s are written to port 0 pins, the pins can be used as high impedance inputs. Port 0 may also be configured to be the multiplexed low order address/data bus during accesses to external program and data memory. In this mode P0 has internal pull-ups. Port 0 also receives the code bytes

during Flash programming, and outputs the code bytes during program verification. External pull-ups are required during program verification.

Port 1 Port 1 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 1 output buffers 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 verification.

Port 2 Port 2 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 2 output buffers 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 high-order address bits and some control signals during Flash programming and verification.

Port 3 Port 3 is an 8-bit bi-directional I/O port with internal pull-ups. 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 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 AT89S51 as listed below:

Table 2.1: Functions of AT89S52 served by Port 3 Port Pin P 3.0 P 3.1 P 3.2 Alternate Functions RxD (Serial Input Port) TxD (Serial Output Port)
INT0

(External Interrupt 0)

P 3.3

INT1

(External Interrupt 1)

P 3.4 P 3.5 P 3.6


WR

T0 (Timer 0 External Input) T1 (Timer 1 External Input)

(External Data Memory Write Strobe)

P 3.7

RD

(External Data Memory Read Strobe)

Port 3 also receive 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 pulse is skipped during each access to external Data Memory. If desired, ALE operation can be disabled by setting bit 0 of SFR location 8EH. With the bit set, ALE is active only during a MOVX or MOVC instruction. Otherwise, the pin is weakly pulled high. Setting the ALE-disable bit has no effect if the microcontroller is in external execution mode. PSEN

Program Store Enable is the read strobe to external program memory. When the AT89S52 is executing code from external program memory, PSEN is activated twice each machine cycle, except that two PSEN activations are skipped during each access to external data memory. EA/VPP External Access Enable. EA must be strapped to GND in order to enable the device to fetch code from external program memory locations starting at 0000H up to FFFFH. Note, however, that if lock bit 1 is programmed, EA will be internally latched on reset. EA should be strapped to VCC for internal program executions. This pin also receives the 12-volt programming enable voltage (VPP) during Flash programming, for parts that require 12-volt VPP. XTAL1 Input to the inverting oscillator amplifier and input to the internal clock operating circuit. XTAL2 Output from the inverting oscillator amplifier. 2.3 IC MAX 232A For serial communication, MAX232A is used. This IC is basically a voltage level converter. Since RS232 is not compatible with microcontroller, we need a line driver (voltage converter) to convert the RS232s signal to TTL voltage levels that will be acceptable to the 89S51s TxD and RxD. It receives the data stream and sends it through RS232 cable.

The MAX232 is a dual driver / receiver that include a capacitive voltage generator to supply TIA/EIA232-F voltage levels from a single 5-v supply. Each receiver converts TIA/EIA-232-F inputs to 5-V-

TTL/CMOS levels. These receivers have a typical threshold of 1.3V, a typical hysteresis of 0.5 V and can accept 30V inputs. Each driver converts TTL/CMOS input levels into TIA/EIA-232-F levels. The driver, receiver, and voltage-generator functions are available as cells in the Texas Instruments LinASIC library.

The MAX232 was the first IC which in one package contains the necessary drivers (two) and receivers (also two), to adapt the RS-232 signal voltage levels to TTL logic. It became popular, because it just needs one voltage (+5V) and generates the necessary RS-232 voltage levels (approx. -10V and +10V) internally. This greatly simplified the design of circuitry. The MAX232 has a successor, the MAX232A. It should be noted that the MAX232 (A) is just a driver/receiver. It does not generate the necessary RS-232 sequence of marks and spaces with the right timing, it does not decode the RS-232 signal, it does not provide a serial/parallel conversion. All it does is to convert signal voltage levels. Generating serial data with the right timing and decoding serial data has to be done by additional circuitry.

The original manufacturer offers a large series of similar ICs, with different numbers of receivers and drivers, voltages, built-in or external capacitors, etc. E.g. The

MAX232 and MAX232A need external capacitors for the internal voltage pump, while the MAX233 has these capacitors built-in.

2.3.1

Features Operates from a single 5V power supply with 1.0F c harge pump capacitors. Operates up to 120kbit/s. Two Drivers and two Receivers. 30V input levels. Meets or Exceeds TIA/EIA-232-F and ITU Recommendation V.28

2.4

RS 232

RS232 serial communication uses fixed voltage values and generally allows you to connect to only one device such as controller. These fixed state signals are more easily affected by noise and distance problems than are the differential signals of RS485 serial communication, but with appropriate cabling, you can run a cable 10 feet or more. Our RS 232 interface also includes a protocol capability so that information can be sent to and received from the attached device.

Almost all digital devices which we use require either TTL or CMOS logic levels. Therefore the first step to connecting a device to the RS-232 port is to transform the RS-232 levels back into 0 and 5 Volts. As we have already covered, this is done by RS-232 Level Converters. Two common RS-232 Level Converters are the 1488 RS-232 Driver and the 1489 RS-232 Receiver. Each package contains 4 inverters of the one type, either Drivers or Receivers. The driver requires two supply rails, +7.5 to +15v and -7.5 to -15v. As you could imagine this may pose a problem in many instances where only a single supply of +5V is present. However the advantages of these IC's are they are cheap.

GSM Modem The GSM modem is slightly different from the conventional modem. This utilizes the GSM standard for cellular technology. Here, one end being a wired connection, receives and transmits data. The other end is connected to a RF antenna. The GSM modem acts like a cellular phone and transmits text and voice data. It communicates with the GSM network via the SIM (Subscribers Identity Module) card.

The Global System for Mobile Communications (GSM: originally from Groupe Spcial Mobile) is the most popular standard for mobile phones in the world. GSM service is used by over 2 billion people across more than 212 countries and territories. The ubiquity of the GSM standard makes international roaming very common between mobile phone operators, enabling subscribers to use their phones in many parts of the world. GSM differs significantly from its predecessors in that both signaling and speech channels are Digital call quality, which means that it is considered a second generation (2G) mobile phone system. This fact has also meant that data communication was built into the system from the 3rd Generation Partnership Project (3GPP).

From the point of view of the consumers, the key advantage of GSM systems has been higher digital voice quality and low cost alternatives to making calls such as text messaging. The advantage for network operators has been the ability to deploy equipment from different vendors because the open standard allows easy inter-operability. Like other cellular standards GSM allows network operators to offer roaming services which mean subscribers can use their phones all over the world.As the GSM standard continued to develop, it retained backward compatibility with the original GSM phones; for example, packet data capabilities were added in the Release '97 version of the standard, by means of GPRS. Higher speed data transmission has also been introduced withEDGE in the Release '99 version of the standard.

It is used as a medium for transmitting and receiving SMS. An SMS from the user contains the information of actions to be performed. At controller-side the modem receives the SMS, sends it to the microcontroller through RS232 cable and then the microcontroller executes the required actions.

Subscriber Identity Module (SIM) One of the key features of GSM is the Subscriber Identity Module (SIM), commonly known as a SIM card. The SIM is a detachable smart card containing the user's subscription information and phonebook. This allows the user to retain his or her information after switching handsets. Alternatively, the user can also change operators while retaining the handset simply by changing the SIM. Some operators will block this by allowing the phone to use only a single SIM, or only a SIM issued by them; this practice is known as SIM locking, and is illegal in some countries.

In the United States, Canada, Europe and Australia, many operators lock the mobiles they sell. This is done because the price of the mobile phone is typically subsidized with revenue from subscriptions and operators want to try to avoid subsidizing competitor's mobiles. A subscriber can usually contact the provider to remove the lock for a fee, utilize private services to remove the lock, or make use of ample software and websites available on the Internet to unlock the handset themselves. While most web sites offer the unlocking for a fee, some do it for free. The locking applies to the handset,

identified by its International Mobile Equipment Identity (IMEI) number, not to the account (which is identified by the SIM card). It is always possible to switch to another (non-locked) handset if such other handset is available.

Some providers will unlock the phone for free if the customer has held an account for a certain period. Third party unlocking services exist that are often quicker and lower cost than that of the operator. In most countries removing the lock is legal. Cingular and T-Mobile provide free unlock services to their customers after 3 months of subscription.

In countries like India, Pakistan, Indonesia, Belgium, etc., all phones are sold unlocked. However, in Belgium, it is unlawful for operators there to offer any form of subsidy on the phone's price. GSM Security GSM was designed with a moderate level of security. The system was designed to authenticate the subscriber using shared-secret cryptography. Communications between the subscriber and the base station can be encrypted. The development of UMTS introduces an optional USIM, that uses a longer authentication key to give greater security, as well as mutually authenticating the network and the user - whereas GSM only authenticated the user to the network (and not vice versa). The security model therefore offers confidentiality and authentication, but limited authorization capabilities, and no non-repudiation.

GSM uses several cryptographic algorithms for security. The A5/1 and A5/2 stream ciphers are used for ensuring over-the-air voice privacy. A5/1 was developed first and is used in other countries. A large security advantage of GSM over earlier systems is that the Key, the crypto variable stored on the SIM card that is the key to any GSM ciphering algorithm, is never sent over the air interface. Serious weaknesses have been found in both algorithms, and it is possible to break A5/2 in real-time in a cipher text-only attack. The system supports multiple algorithms so operators may replace that cipher with a stronger one.

2.5.3

Advantages of GSM

1. 2. 3. 4. 5. 6. 7. 8. 9.

GSM uses radio frequency efficiently. It tolerates inter-cell disturbances. Quality of speech is better than in analog phones. It supports Data Transmission. It allows the data to be encrypted i.e. data is secure. It also supports new services such as ISDN. It provider services such as national roaming and international roaming. Telephony. Distinction between user and device identification.

10. Asynchronous and synchronous data services. 11. Access to packet data network (X.25). 12. Telematic services (SMS, fax, videotext, etc.). 13. Many value added features (call forwarding, caller ID, voice mailbox). 14. E-mail and Internet connections. AT Commands The AT commands are used to control the operation of the modem. They are called AT commands because the characters AT must precede each command to get the ATtention of the modem.

AT commands can be issued only when the modem is in command mode or online command mode. The modem is in command mode whenever it is not connected to another modem. The modem is in data mode whenever it is connected to another modem and ready to exchange data. Online command mode is a temporary state in which one can issue commands to the modem while connected to another modem.

Table 2.2: SMS Commands


Command AT+CREG AT+CSQ Description Network Registration Signal Quality

AT+CMGR AT+CMGS AT+CMGD AT+CMGL AT+CSCA

Read message Send message Delete message List message Service center address

You might also like