You are on page 1of 43

GSM BASED HOME AUTOMATION ABSTRACT Now a day's every system is automated in order to face new challenges in the

present day situation. Automated systems have less manual operations, so that the flexibility, reliabilities are high and accurate. Hence every field prefers automated control systems. Especially in the field of electronics automated systems are doing better performance. Probably the most useful thing to know about the global system for mobile communication is that it is an international standard. If you travel in parts of world, GSM is only type of cellular service available. Instead of analog services, GSM was developed as a digital system using TDMA technology. The goal of the project is to develop a system, which uses Mobile technology that keeps control of the various units of the automobiles, which executes with respect to the signal sent by the mobile. For utilization of appliances the new concept has been thought to manage them remotely by using GSM, which enables the user to remotely control switching of domestic appliances. Just by dialing keypad of remote telephone, from where you are calling you can perform ON / OFF operation of the appliances. The ranges of appliances that can be controlled through tele remote systems are many in numbers. Some of them are as follows and this depends upon the usage priority of the appliances i.e. Industrial appliances, Music System or other electrical / electronic appliances. The project contains GSM module contains SIM which receives the SMS from the user mobile, contains the password in the SMS and it read by the PIC18F452 micro controller then compares with the code password in microcontroller, if password matches the controller switch on or off the appliances connected to the project. The uniqueness of this project is we can have access the appliances all over the world connected to this project

BLOCK DIAGRAM OF GSM BASED HOME AUTOMATION Introduction: This project deals with the implementation of GSM technology on a pic microcontroller so that the home application can be enabled. The following is the block diagram for gsm enabled embedded systems for controlling home appliances.

Power supply DC 12V PIC18F452 Micro controller unit

L293D IC

DC MOTO R

GSM MODU LE

TX

LEDS

RX

SMS RECEIVING AND SENDING

MOBILE (GSM)

System operation flow diagram

MAIN BOARD

12VOLT DC

I C

MICROCONTROLLER

RX GSM MODULE SIM SLOT

TX GSM MODULE LEDS SLOT

DC MOTOR

GSM Technology Guide

Time-Division Multiple Access (TDMA) What is TDMA? TDMA (time division multiple access) is a technology used in digital cellular telephone communication to divide each cellular channel into three time slots in order to increase the amount of data that can be carried. How it Works? TDMA works by time-division multiplexing: sending multiple signals (each of which has its own time slot) simultaneously on a single carrier in the form of a complex signal, and then recovering the separate signals at the receiving end. For TDMA, the carrier is divided into three time slots, each of which serves one subscriber. The information is broken into tiny data packets, which are transmitted in timed bursts in the 30-megahertz range. At the receiving end, the separate information streams are recovered. See also FDMA (frequency division multiple access) and CDMA (code-division multiple access). TDMA was developed in response to the basic wireless network problem: Code Division Multiple Access (CDMA): The term CDMA refers to any of several protocols used in so-called secondgeneration (2G) and third-generation (3G) wireless communications. As the term implies, CDMA is a form of multiplexing, which allows numerous signals to occupy a single transmission channel, optimizing the use of available bandwidth. The technology is used in ultra-high-frequency (UHF) cellular telephone systems in the 800-MHz and 1.9-GHz bands. CDMA employs analog-to-digital conversion (ADC) in combination with spread spectrum technology. Global System for Mobile communication (GSM): What is GSM? The Global System for Mobile communication, usually called GSM, Telecommunications Standards Institute (ETSI) to describe protocols for second generation (2G) digital cellular networks used by mobile phones. The GSM standard was developed as a replacement for first generation (1G) analog cellular

networks, and originally described a digital, circuit switched network optimized for full duplex voice telephony. This was expanded over time to include data communications, first by circuit switched transport, then packet data transport via GPRS (General Packet Radio Services) and EDGE (Enhanced Data rates for GSM Evolution or EGPRS). Further improvements were made when the 3GPP developed third generation (3G) UMTS standards followed by fourth generation (4G)LTE Advanced standards. "GSM" is a trademark owned by the GSM Association. The Generations of Mobile Networks The idea of cell-based mobile radio systems appeared at Bell Laboratories in the United States in the early 1970s. However, mobile cellular systems were not introduced for commercial use until a decade later. During the early 1980s, analog cellular telephone systems experienced very rapid growth in Europe, particularly in Scandinavia and the United Kingdom. Today, cellular systems still represent one of the fastest growing telecommunications systems. During development, numerous problems arose as each country developed its own system, producing equipment limited to operate only within the boundaries of respective countries, thus limiting the markets in which services could be sold. First-generation cellular networks, the primary focus of the communications industry in the early 1980s, were characterized by a few compatible systems that were designed to provide purely local cellular solutions. It became increasingly apparent that there would be an escalating demand for a technology that could facilitate flexible and reliable mobile communications. By the early 1990s, the lack of capacity of these existing networks emerged as a core challenge to keeping up with market demand.

History of GSM: Early European analog cellular networks consisted of a mix of technologies and protocols that varied from country to country, meaning that phones did not necessarily work on different networks. In addition, manufacturers had to produce different equipment to meet various standards across the markets. In 1982, work began to develop a European standard for digital cellular voice telephony when the European Conference of Postal and Telecommunications

Administrations (CEPT) created the Groupe Spcial Mobile committee and provided a permanent group of technical support personnel, based in ParisIn 1995, fax, data and SMS messaging services were launched commercially, the first 1900 MHz GSM network became operational in the United States and GSM subscribers worldwide exceeded 10 million. The GSM Association estimates that technologies defined in the GSM standard serve 80% of the global mobile market, encompassing more than 5 billion people across more than 212 countries and territories, making GSM the most ubiquitous of the many standards for cellular networks. Macau phased out their GSM network in January 2013 (except for roaming services), making it the first region to decommission a GSM network. Architecture of the GSM network: A GSM network is composed of several functional entities, whose functions and interfaces are specified. Figure 1 shows the layout of a generic GSM network. The GSM network can be divided into three broad parts. The Mobile Station is carried by the subscriber. The Base Station Subsystem controls the radio link with the Mobile Station. The Network Subsystem, the main part of which is the Mobile services Switching Center (MSC), performs the switching of calls between the mobile users, and between mobile and fixed network usersThe Base Station Subsystem communicates with the Mobile services Switching Center across the A interface.

Figure 1. General architecture of a GSM network

Mobile Station The mobile station (MS) consists of the mobile equipment (the terminal) and a smart card called the Subscriber Identity Module (SIM). The SIM provides personal mobility, so that the user can have access to subscribed services irrespective of a specific terminal. By inserting the SIM card into another GSM terminal, the user is able to receive calls at that terminal, make calls from that terminal, and receive other subscribed services. The mobile equipment is uniquely identified by the International Mobile Equipment Identity (IMEI). The SIM card contains the International Mobile Subscriber Identity (IMSI) used to identify the subscriber to the system, a secret key for authentication, and other information. The IMEI and the IMSI are independent, thereby allowing personal mobility. The SIM card may be protected against unauthorized use by a password or personal identity number. Base Station Subsystem The Base Station Subsystem is composed of two parts, the Base Transceiver Station (BTS) and the Base Station Controller (BSC). These communicate across the standardized Abis interface, allowing (as in the rest of the system) operation between components made by different suppliers. Network Subsystem The central component of the Network Subsystem is the Mobile services Switching Center (MSC). It acts like a normal switching node of the PSTN or ISDN, and additionally provides all the functionality needed to handle a mobile subscriber, such as registration, authentication, location updating, handovers, and call routing to a roaming subscriber. The MSC provides the connection to the fixed networks (such as the PSTN or ISDN). Signaling between functional entities in the Network Subsystem uses Signaling System Number 7 (SS7), used for trunk signaling in ISDN and widely used in current public networks.

GSM SECURITY: The security features in the GSM network can be divided into three sub parts: subscriber identity authentication, user and signaling data confidentiality, and subscriber identity confidentiality. The security mechanisms include secret keys, algorithms and computed numbers. Some definitions: Authentication any technique that enables the receiver to automatically identify and reject messages that have been altered deliberately or by channel errors Confidentiality only the sender and intended receiver should be able to understand the contents of the transmitted message Cipher text plaintext is encrypted to cipher text with the help of a key and an encryption algorithm Key a string of numbers or characters as input to the encryption algorithm . Subscriber Identity Authentication. The procedure consists of three phases, (1) the network must identify the subscriber, (2) needed security parameters from the home network are asked for and (3) the actual authentication is taking place. A 3-digit Mobile Country Code (MCC). This identifies the country where the GSM system operates. Finland has number 244. A 2-digit Mobile Network Code (MNC). This uniquely identifies each cellular provider. Sonera has number 91. The Mobile Subscriber Identification Code (MSIC).This uniquely identifies each customer of the provider. The length is 10 digits

Channel structure: Depending on the kind of information transmitted (user data and control signaling), we refer to different logical channels which are mapped under physical channels (slots). Digital speech is sent on a logical channel named TCH, which during the transmission can be a allocated to a certain physical channel. In a GSM system no RF channel and no slot is dedicated to a priori to the exclusive use of anything (any RF channel can be used for number of different uses). Logical channels are divided into two categories: i) Traffic Channels (TCHs) ii)Control Channels . Traffic Channels (TCHs) A traffic channel (TCH) is used to carry speech and data traffic. Traffic channels are defined using a 26-frame multiform, or group of 26 TDMA frames. The length of a 26-frame multiform is 120 ms, which is how the length of a burst period is defined (120 ms divided by 26 frames divided by 8 burst periods per frame). Out of the 26 frames, 24 are used for traffic, 1 is used for the Slow Associated Control Channel (SACCH) and 1 is currently unused. TCHs for the uplink and downlink are separated in time by 3 burst periods, so that the mobile station does not have to transmit and receive simultaneously, thus simplifying the electronics TCHs carry either encoded speech or user data in both up and down directions in a point to point communication. There are two types of TCHs that are differentiated by their traffic rates. They are: i. Full Rate TCH ii. Half Rate TCH Full Rate TCH(Also represented as Bm) It carries information at a gross rate of 22.82 Kbps. Half Rate TCH It carries information with half of full rate channels. Control Channel Basic structure of Control channel 1 2 3 4 . . . . . 10 11 .

21

F S x X X X X X X X F S X X X X X X X X F S X X X X X

Actually in the above diagram S will be at slot 1 of next frame, F is frequency correction channel which occurs every 10th burst. The next frame to S contains service operators information. Logical Control Channel (LCC) s are of three types They are of the following types: Broadcast Control Channel(BCCH) Common Control Channel(CCCH) Dedicated Control Channel(DCCH)

Broadcast Control Channel (BCCH) The BCCH is a point-to-multipoint unidirectional control channel from the fixed subsystem to MS that is intended to broadcast a variety of information to MSs, including information necessary for the MS to register in the system. BCCH has 51 bursts. BCCH is dedicated to slot1 and repeats after every 51 bursts. Broadcast Control Channel (BCCH) continually broadcasts, on the downlink, information including base station identity, frequency allocations, and frequencyhopping sequences. The BCCH includes : -- Frequency correction channel (FCCH) which is used to allow an MS to accurately tune to a BS. The FCCH carries information for the frequency correction of MS downlink. It is required for the correct operation of radio system. This is also a point-to multipoint communication. This allows an MS to accurately tune to a BS. -- Synchronization channel (SCH), which is used to provide TDMA frame oriented synchronization data to a MS. When a mobile recovers both FCCH and SCH signals, the synchronization is said to be complete. SCH repeats for every 51 frames.

The Synchronization Channel contains 2 encoded parameters: BTS identification code (BSIC) Reduced TDMA frame number (RFN). Common Control Channel (CCCH) A CCCH is a point-to-multipoint (bi-directional control channel) channel that is primarily intended to carry signaling information necessary for access management functions (e.g., allocation of dedicated control channels). The CCCH includes: -- paging channel (PCH), which is used to search (page) the MS in the downlink direction -- random access channel (RACH) which is used by MS to request of an SDCCH either as a page response from MS or call origination/ registration from the MS. This is uplink channel and operates in point-point mode(MS to BTS).This uses slotted ALOHA protocol.. -- access grant channel(AGCH) which is a downlink channel used to assign a MS to a specific SDCCH or a TCH. AGCH operates in point-to-point mode. A combined paging and access grant channel is designated as PAGCH. Dedicated Control Channel (DCCH) A DCCH is a point to point, directional control channel. Two types of DCCHs used are: Standalone DCCH (SDCCH) is used for system signaling during idle periods and call setup before allocating a TCH, for example MS registration, authentication and location updates through this channel. When a TCH is assigned to MS this channel is releasedAssociated Control Channel (ACCH) is a DCCH whose allocation is linked to the allocation of a CCH Data Transmission: The GSM standard also provides separate facilities for transmitting digital data. This allows a mobile phone to act like any other computer on the Internet, sending and receiving data via the Internet Protocol. Circuit-switched data protocols

A circuit-switched data connection reserves a certain amount of bandwidth between two points for the life of a connection, just as a traditional phone call allocates an audio channel of a certain quality between two phones for the duration of the call. Two circuit-switched data protocols are defined in the GSM standard: Circuit Switched Data (CSD) and High-Speed Circuit-Switched Data (HSCSD). General Packet Radio Service (GPRS) The General Packet Radio Service (GPRS) is a packet-switched data transmission protocol, which was incorporated into the GSM standard in 1997. It is backwards-compatible with systems that use pre-1997 versions of the standard. GPRS does this by sending packets to the local mobile phone mast (BTS) on channels not being used by circuit-switched voice calls or data connections. Short Message Service (SMS) Short Message Service (more commonly known as text messaging) has become the most used data application on mobile phones, with 74% of all mobile phone users worldwide already as active users of SMS, or 2.4 billion people by the end of 2007.

EMBEDDED SYSTEMS We find ourselves to be surrounded by various types of embedded systems. Be it a digital camera or a mobile phone or a washing machine, all of them has some kind of processor functioning inside it. Associated with each processor is the embedded software. If hardware forms the body of an embedded system, embedded processor acts as the brain, and embedded software forms its soul. It is the embedded software which primarily governs the functioning of embedded systems. As time progressed, use of microprocessor-specific assembly-only as the programming language reduced and embedded systems moved onto C as the embedded programming language of choice. C is the most widely used programming language for embedded processors/controllers. Assembly is also used but mainly to implement those portions of the code where very high timing accuracy, code size efficiency, etc. are prime requirements. Initially C was developed by Kernighan and Ritchie to fit into the space of 8K and to write (portable) operating systems. Originally it was implemented on UNIX operating systems. As it was intended for operating systems development, it can manipulate memory addresses. Also, it allowed programmers to write very compact codes. This has given it the reputation as the language of choice for hackers too.

An embedded system is a system that has software embedded into hardware, which makes a system dedicated for an application (s) or specific part of an application or product or part of a larger system. We look around, we will find ourselves to be surrounded by computing systems. Every year millions of computing systems are built destined for desktop computers but surprisingly, billions of computing systems are built every year embedded within larger electronic devices and still goes unnoticed. Any device running on electric power either already has computing system or will soon have computing system embedded in it. Today, embedded systems are found in cell phones, digital cameras, camcorders, portable video games, calculators, and personal digital assistants, microwave ovens, answering machines, home security systems, washing machines, lighting systems, fax machines, copiers, printers, and scanners, cash registers, alarm systems, automated teller machines, transmission control, cruise control, fuel injection, anti-lock brakes, active suspension and many other devices/ gadgets. we find ourselves to be surrounded by various types of embedded systems. Be it a digital camera or a mobile phone or a washing machine, all of them has some kind of processor functioning inside it. Associated with each processor is the embedded software. If hardware forms the body of an embedded system, embedded processor acts as the brain, and embedded software forms its soul. It is the embedded software which primarily governs the functioning of embedded systems. As time progressed, use of microprocessor-specific assembly-only as the programming language reduced and embedded systems moved onto C as the embedded programming language of choice. C is the most widely used programming language for embedded processors/controllers. Assembly is also used but mainly to implement those portions of the code where very high timing accuracy, code size efficiency, etc. are prime requirements. Initially C was developed by Kernighan and Ritchie to fit into the space of 8K and to write (portable) operating systems. Originally it was implemented on UNIX operating systems. As it was intended for operating systems development, it can manipulate memory addresses. Also, it allowed programmers to write very compact codes. This has given it the reputation as the language of choice for hackers too.

SOFTWARE REQUIREMENTS MPLAB X IDE

WHAT IS MPLABX IDE MPLAB Integrated Development Environment (IDE) is a free, integrated toolset for the development of embedded applications employing Microchip's PIC and ds PIC microcontrollers. MPLAB IDE runs as a 32-bit application on MS Windows, is easy to use and includes a host of free software components for fast application development and super-charged debugging. MPLAB IDE also serves as a single, unified graphical user interface for additional Microchip and third party software and hardware development tools. Moving between tools is a snap, and upgrading from the free software simulator to hardware debug and programming tools is done in a flash because MPLAB IDE has the same user interface for all tools. Proteus (design software)

Proteus is software for microprocessor simulation, schematic capture, and printed circuit board (PCB) design. It is developed by Lab center Electronics. The Proteus Professional demonstration is intended for prospective customers who wish to evaluate professional level products. It differs from Proteus Lite in that it does not allow you to save, print or design your own microcontroller based designs (you can however write your own software programs to run on the existing sample design suite for evaluation), but does include all features offered by the professional system including net list based PCB design with auto-placement, auto-routing and graph based simulation. The Proteus Design Suite combines schematic capture, SPICE circuit simulation, and PCB design to make a complete electronics design system. Add to that the ability to simulate popular micro-controllers running your actual firmware, and you have a package that can dramatically reduce your development time when compared with a traditional embedded design process USART COMMUNICATION Communication between two entities is important for the information flow to take place. In general the information transport system can be parallel in which the complete byte of data is sent at a time, with each bit having a separate dedicated line or it can be serial where only one communication line is available which is shared by all the bits sequentially. The pros and cons of these two systems are equivalent and selection between the two depends on the application.

Data can be exchanged using parallel or serial techniques. Setup for parallel data transfer is not cost effective but is a very fast method of communication. This article explains serial communication of AVR microcontroller (ATmega16) with PC. The data is transmitted from the controller using RS232 standard and displayed on the PC using Hyper Terminal. There are two methods for serial data communication (i) Synchronous and (ii) Asynchronous communication. In Synchronous communication method complete block (characters) is sent at a time. It doesnt require any additional bits (start, stop or parity) to be added for the synchronization of frame. The devices are synchronized by clock. And in asynchronous communication data transmission is done byte by byte i.e., one byte at a time. The additional bits are added to complete a frame. In synchronous communication the frame consists of data bits while in asynchronous communication the total number of bits in a frame may be more than the data bits. USART Registers: i. UCSRA: (USART Control and Status Register A)

RXC (USART Receive Complete): RXC flag is set to 1 if unread data exists in receive buffer, and set to 0 if receive buffer is empty. TXC (USART Transmit complete): TXC flag is set to 1 when data is completely transmitted to Transmit shift register and no data is present in the buffer register UDR.

UDRE (USART Data Register Empty): This flag is set to logic 1 when the transmit buffer is empty, indicating it is ready to receive new data. UDRE bit is cleared by writing to the UDR register. ii. UCSRB: (USART Control and Status Register B) RXCIE: RX Complete Interrupt Enable, When 1 -> RX complete interrupt is enabled. When 0 -> RX complete interrupt is disabled. TXCIE: TX Complete Interrupt Enable, When 1 -> TX complete interrupt is enabled When 0-> TX complete interrupt is disabled UDRIE: USART Data Register Empty Interrupt Enable, When 1 -> UDRE flag interrupt is enabled. When 0 -> UDRE flag interrupt is disabled. RXEN: Receiver Enabled, When 1 -> USART Receiver is enabled. When 0 -> USART Receiver is disabled. TXEN: Transmitter Enabled, When 1 -> USART Transmitter is enabled. When 0 -> USART Transmitter is disabled.

iii.

UCSRC: (USART Control and Status Register C)

URSEL: USART Register select. This bit must be set due to sharing of I/O location by UBRRH and UCSRC UMSEL: USART Mode Select, When 1 -> Synchronous Operation When 0 -> Asynchronous Operation UPM[0:1]: USART Parity Mode, Parity mode selection bits. USBS: USART Stop Select Bit, When 0-> 1 Stop BitWhen 1 -> 2 Stop Bits UCSZ[0:1]: The UCSZ[1:0] bits combined with the UCSZ2 bit in UCSRB sets size of data frame i.e., the number of data bits. The table shows the bit combinations with respective character size. HARDWARE REQUIREMENTS Regulated Power Supply: A regulated power supply is an embedded circuit; it converts unregulated AC into a constant DC. With the help of a rectifier it converts AC supply into DC. It's function is to supply a stable voltage (or less often current), to a circuit or device that must be operated within certain power supply limits. The output from the regulated power supply may be alternating or unidirectional, but is nearly always DC (Direct Current)

ARCHITECTURAL OVERVIEW OF PIC 18F452 MICROCONTROLLER High Performance RISC CPU: C compiler optimized architecture/instruction set - Source code compatible with the PIC16 and

PIC17 instruction sets Linear program memory addressing to 32 Kbytes Linear data memory addressing to 1.5 Kbytes Up to 10 MIPs operation: - DC - 40 MHz osc./clock input - 4 MHz - 10 MHz osc./clock input with PLL active 16-bit wide instructions, 8-bit wide data path Priority levels for interrupts 8 x 8 Single Cycle Hardware Multiplier Peripheral Features: High current sink/source 25 mA/25 mA Three external interrupt pins Timer0 module: 8-bit/16-bit timer/counter with 8-bit programmable prescaler Timer1 module: 16-bit timer/counter Timer2 module: 8-bit timer/counter with 8-bit period register (time-base for PWM) Timer3 module: 16-bit timer/counter Secondary oscillator clock option - Timer1/Timer3 Two Capture/Compare/PWM (CCP) modules. CCP pins that can be configured as: - Capture input: capture is 16-bit, max. resolution 6.25 ns (TCY/16) - Compare is 16-bit, max. resolution 100 ns (TCY) - PWM output: PWM resolution is 1- to 10-bit, max. PWM freq. @: 8-bit resolution = 156 kHz 10-bit resolution = 39 kHz Master Synchronous Serial Port (MSSP) module, Two modes of operation: - 3-wire SPI (supports all 4 SPI modes) - I2C Master and Slave mode Peripheral Features (Continued): Addressable USART module:

- Supports RS-485 and RS-232 Parallel Slave Port (PSP) module Analog Features: Compatible 10-bit Analog-to-Digital Converter module (A/D) with: - Fast sampling rate - Conversion available during SLEEP - Linearity 1 LSb Programmable Low Voltage Detection (PLVD) - Supports interrupt on-Low Voltage Detection Programmable Brown-out Reset (BOR) Special Microcontroller Features: 100,000 erase/write cycle Enhanced FLASH Program memory typical 1,000,000 erase/write cycle Data EEPROM memory FLASH/Data EEPROM Retention: > 40 years Self-reprogrammable under software control Power-on Reset (POR), Power-up Timer (PWRT) and Oscillator Start-up Timer (OST) Watchdog Timer (WDT) with its own On-Chip RC Oscillator for reliable operation Programmable code protection Power saving SLEEP mode Selectable oscillator options including: - 4X Phase Lock Loop (of primary oscillator) - Secondary Oscillator (32 kHz) clock input Single supply 5V In-Circuit Serial Programming (ICSP) via two pins In-Circuit Debug (ICD) via two pins CMOS Technology: Low power, high speed FLASH/EEPROM

technology Fully static design Wide operating voltage range (2.0V to 5.5V) Industrial and Extended temperature ranges Low power consumption: - < 1.6 mA typical @ 5V, 4 MHz - 25 A typical @ 3V, 32 kHz - < 0.2 A typical standby current PIN DIAGARAM

DEVICE FEATURES

PIC18F452

BLOCKDIAGRAM

FEATURES OF L293D IC:


600-mA Output Current Capability Per Driver Pulsed Current 1.2-A Per Driver Output Clamp Diodes for Inductive Transient Suppression Wide Supply Voltage Range 4.5 V to 36 V Separate Input-Logic Supply Thermal Shutdown Internal ESD Protection High-Noise-Immunity Inputs Functional Replacement for SGS L293D

DESCRIPTION The L293D is a quadruple high-current half-H driver designed to provide bidirectional drive currents of up to 600-mA at voltages from 4.5 V to 36 V. It is designed to drive inductive loads such as relays, solenoids, dc and bipolar stepping motors, as well as other high-current/high-voltage loads in positive-supply applications. All inputs are TTL-compatible. Each output is a complete totem-pole drive circuit with a Darlington transistor sink and a pseudo-Darlington source. Drivers are enabled in pairs with drivers 1 and 2 enabled by 1,2EN and drivers 3 and 4 enabled by 3,4EN. When an enable input is high, the associated drivers are enabled, and their outputs are active and in phase with their inputs. External high-speed output clamp diodes should be used for inductive transient suppression. When the enable input is low, those drivers are disabled, and their outputs are off and in a high-impedance state. With the proper data inputs,

each pair of drivers form a full-H (or bridge) reversible drive suitable for solenoid or motor applications. A VCC1 terminal, separate from VCC2, is provided for the logic inputs to minimize device power dissipation. The L293D is designed for operation from 0C to 70C. L293D is a dual H-bridge motor driver integrated circuit (IC). Motor drivers act as current amplifiers 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 & 7 and 10 & 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 off and in the high-impedance state.

DESIGN

MICRO-CONTROLLER MODULE An embedded microcontroller is a chip, which has a computer processor with all its support function (clocking and reset), memory (both program storage and RAM), and I/O (including bus interfaces) built into the device. These built in function minimize the need for external circuits and devices to the designed in the final applications. The improvements in micro-controller technology has meant that it is often more costeffective, faster and more efficient to develop an application using a microcontroller rather than discrete logic. Creating applications for micro-controllers is completely different than any other development job in computing and electronics. In most other applications, number of subsystems and interfaces are available but this is not the case for the micro-controller where the following responsibilities have to be taken. Power distribution System clocking Interface design and wiring System Programming Application programming Device programming There are two types of micro-controller commonly in use. Embedded microcontroller is the micro-controller, which has the entire hardware requirement to run the application, provided on the chip. External memory micro-controller is the micro-controller that allows the connection of external memory when the program memory is insufficient for an application or during the work a separate ROM (or even RAM) will make the work easier. GSM MODULE GSM/GPRS module is used to establish communication between a computer and a GSM-GPRS system. Global System for Mobile communication (GSM) is an architecture used for mobile communication in most of the countries. Global Packet Radio Service (GPRS) is an extension of GSM that enables higher

data transmission rate. GSM/GPRS module consists of a GSM/GPRS modem assembled together with power supply circuit and communication interfaces (like RS-232, USB, etc) for computer. The MODEM is the soul of such modules.

Wireless MODEMs Wireless MODEMs are the MODEM devices that generate, transmit or decode data from a cellular network, for establishing communication between the cellular network and the computer. These are manufactured for specific cellular network (GSM/UMTS/CDMA) or specific cellular data standard (GSM/UMTS/GPRS/EDGE/HSDPA) or technology (GPS/SIM). Wireless MODEMs like other MODEM devices use serial communication to interface with and need Hayes compatible AT commands for communication with the computer (any microprocessor or microcontroller system).

GSM/GPRS MODEM is a class of wireless MODEM devices that are designed for communication of a computer with the GSM and GPRS network. It requires a SIM (Subscriber Identity Module) card just like mobile phones to activate communication with the network. Also they have IMEI (International Mobile

Equipment Identity) number similar to mobile phones for their identification. A GSM/GPRS MODEM can perform the following operations:

The MODEM needs AT commands, for interacting with processor or controller, which are communicated through serial communication. These commands are sent by the controller/processor. The MODEM sends back a result after it receives a command. Different AT commands supported by the MODEM can be sent by the processor/controller/computer to interact with the GSM and GPRS cellular network. GSM has many benefits over current cellular systems. The main problem now involves the COMP 128 algorithm problem. This problem will be solved as newer technology gets phased in. The lack of extra encryption on the telecommunications network doesnt pose as a major problem because any data transfer on there will have the same security as the current public switched telephone networks. Despite the current problems more and more cellular companies will switch to GSM based standards. An estimated one billion subscribers are expected by the end of 2003. As GSM slowly moves towards 3GSM, more problems and security issues will be resolved.

GSM COMMANDS: commands are used to control MODEMs. AT is the abbreviation for Attention. These commands come from Hayes commands that were used by the Hayes smart modems. The Hayes commands started with AT to indicate the attention from the MODEM. The dial up and wireless MODEMs (devices that involve machine to machine communication) need AT commands to interact with a computer. These include the Hayes command set as a subset, along with other extended AT commands. AT commands with a GSM/GPRS MODEM or mobile phone can be used to access following information and services: 1. Information and configuration pertaining to mobile device or MODEM and SIM card. 2. SMS services. 3. MMS services. 4. Fax services. 5. Data and Voice link over mobile network.

Explanation of commonly used AT commands: 1) AT - This command is used to check communication between the module and the computer. For example,

AT OK The command returns a result code OK if the computer (serial port) and module are connected properly. If any of module or SIM is not working, it would return a result code ERROR.

2)

+CMGF - This command is used to set the SMS mode. Either text or PDU mode can be selected by assigning 1 or 0 in the command. SYNTAX: AT+CMGF=<mode> 0: for PDU mode 1: for text mode The text mode of SMS is easier to operate but it allows limited features of SMS. The PDU (protocol data unit) allows more access to SMS services but the operator requires bit level knowledge of TPDUs. The headers and body of SMS are accessed in hex format in PDU mode so it allows availing more features. For example, AT+CMGF=1 OK

3)

+CMGW - This command is used to store message in the SIM. SYNTAX: AT+CMGW= Phone number> Message to be stored Ctrl+z As one types AT+CMGW and phone number, > sign appears on next line where one can type the message. Multiple line messages can be typed in this case. This is why the message is terminated by providing a Ctrl+z combination. As Ctrl+z is pressed, the following information response is displayed on the screen. +CMGW: Number on which message has been stored

4)

+CMGS - This command is used to send a SMS message to a phone number. SYNTAX: AT+CMGS= serial number of message to be send.

As the command AT+CMGS and serial number of message are entered, SMS is sent to the particular SIM. For example, AT+CMGS=1 OK 5) ATD - This command is used to dial or call a number. SYNTAX: ATD<Phone number>(Enter) For example, ATD123456789 ATA - This command is used to answer a call. An incoming call is indicated by a message RING which is repeated for every ring of the call. When the call ends NO CARRIER is displayed on the screen. SYNTAX: ATA(Enter) As ATA followed by enter key is pressed, incoming call is answered. For example, RING RING ATA 7) ATH - This command is used to disconnect remote user link with the GSM module. SYNTAX: ATH (Enter)

6)

DC MOTOR MODULE

DC motors consist of one set of coils, called armature winding, inside another set of coils or a set of permanent magnets, called the stator. Applying a voltage to the coils produces a torque in the armature, resulting in motion. Stator The stator is the stationary outside part of a motor. The stator of a permanent magnet dc motor is composed of two or more permanent magnet pole pieces. The magnetic field can alternatively be created by an electromagnet. In this case, a DC coil (field winding) is wound around a magnetic material that forms part of the stator. Rotor The rotor is the inner part which rotates. The rotor is composed of windings (called armature windings) which are connected to the external circuit through a mechanical commutator. Both stator and rotor are made of ferromagnetic materials. The two are separated by air-gap. winding is made up of series or parallel connection of coils. Armature winding - The winding through which the voltage is applied or induced. Field winding - The winding through which a current is passed to produce flux (for the electromagnet) Windings are usually made of copper. SPECIFICATIONS MOTOR VOLTAGE(V) CURRENT LOCKED-ROTOR CURRENT SPEED(RPM) TORQUE ROTATION

Motor 12v 0.03A(no load);0.07A(at max. eff.) >=0.17A 45RPM+-10%(no load) 80mN.m CW/CCW

LEDS (LIGHT EMITTING DIODES) MODULE

A light-emitting diode (LED) is a semiconductor light source .LEDs are used as indicator lamps in many devices and are increasingly used for general lighting. Appearing as practical electronic components in 1962, early LEDs emitted lowintensity red light, but modern versions are available across the visible, ultraviolet, and infrared wavelengths, with very high brightness.

PROGRAM

#include<p18f452.h> #pragma config OSC=XT, WDT=OFF, LVP=OFF void txd(unsigned char ch); unsigned char rxd(); int i,v1=0,v2=0,v3=0,v4=0; char mobno[20],msg[50],x,cmp1[]="ON1",cmp2[]="OF1",cmp3[]="ON2",cmp4[]="OF 2"; void delay1(unsigned int z) { unsigned int i; unsigned char j; for(i=0;i<z;i++) for(j=0;j<=165;j++); } void USART_Init() { SPBRG =0x19; TXSTA=0X24; RCSTA=0x90; }

// 9600 bps at XTA=4MHZ // Transmission part enable // Receiving part enable

void txd(unsigned char ch) { TXREG=ch; // Character send through transmission register while(!PIR1bits.TXIF); // Upto transmitting character delay1(40); } unsigned char rxd() { while(!PIR1bits.RCIF); // Upto receiving character return RCREG; // Return the character to main

} void Tx_String(const rom char *str) { while((*str)!='\0') { txd(*str); str++; } } int Read_SMS() { v1=0;v2=0;v3=0;v4=0; while(rxd()!='+'); { while(rxd()!='C'); { while(rxd()!='M'); { while(rxd()!='T'); { while(rxd()!='I'); { while(rxd()!=':'); { while(rxd()!=','); x=rxd(); Tx_String("AT+CMGR="); txd(x); txd('\r'); while(rxd()!='?'); for(i=0;i<3;i++) { msg[i]=rxd(); } for(i=0;i<3;i++) { if(msg[i]!=cmp1[i]) {

v1=1; } if(msg[i]!=cmp2[i]) { v2=1; } if(msg[i]!=cmp3[i]) { v3=1; } if(msg[i]!=cmp4[i]) { v4=1; } } if(v1==0) { PORTB |= (1<<0); } if(v2==0) { PORTB &= ~(1<<0); } if(v3==0) { PORTB |= (1<<1); } if(v4==0) { PORTB &= ~(1<<1); } return 0; } } } } } } }

int main(void) { TRISB = 0x00; USART_Init(); delay1(10); Tx_String("AT\r"); PORTB = 0x00; while(1) { Read_SMS(); Tx_String("AT+CMGF=1\r"); delay1(100); Tx_String("AT+CMGD=1\r"); delay1(100); Tx_String("AT+CMGD=2\r"); delay1(100); Tx_String("AT+CMGD=3\r"); delay1(100); Tx_String("AT+CMGD=4\r"); delay1(100); Tx_String("AT+CMGD=5\r"); delay1(1000); } }

INTEGRATING ALL THE MODULES: THE integrating all the modules deals with effective data communication between the modules used in the project. The modules have been connected through wires and communicated with help of electrical signals. Initially the gsm module and the microcontroller is powered by the regulated power supply ,then the gsm module contains the SIM , as we inserted in the gsm module the SIM detected the signal and detection is indicated through the led light blinking . The TX and RX pins of the gsm module and microcontroller are connected to transfer the commands to and fro, to be operated and the resultant output signal is fed to the load using the driving integrated circuit ic i.e, dc motor and the led light emitting diodes The GSM module is integrated with the microcontroller and the dc motor and light emitting diodes are also integrated with microcontroller , as we sends the SMS from any GSM mobile to the SIM contains in the GSM module receives the message and reads the password contains in sms and matches up with the password in the microcontroller program through TX and RX pins , if the authentication is granted then the data matches the program execute and the required load can be switched on and off throughout anywhere on the world . The message contains four different passwords to access the appliances that is for switching on and switching off the dc motor and the another two passwords for the switching on and of the light emitting diodes. When the gsm module reads the receivesd message and after completion of execution the message will be deleted from the memory of the SIM finally . this process can be repeated as many times

SCREENSHOTS OF THE PROJECTS

FUTURE ENHANCEMENTS AND BENIFITS: The future implications of the project are very great considering the amount of time and resources it saves. The project we have undertaken can be used as a reference or as a base for realizing a scheme to be implemented in other projects of greater level such as weather forecasting, temperature updates, device synchronization, etc. The project itself can be modified to achieve a complete Home Automation System which will then create a platform for the user to interface between himself and his household.

CONCLUSION

The project we have undertaken has helped us gain a better perspective on various aspects related to our course of study as well as practical knowledge of electronic equipments and communication. We became familiar with software analysis, designing, implementation, testing and maintenance concerned with our project. The extensive capabilities of this system are what make it so interesting. From the convenience of a simple cell phone, a user is able to control and monitor virtually any electrical devices. This makes it possible for users to rest assured that their belongings are secure and that the television and other electrical appliances was not left running when they left the house to just list a few of the many uses of this system. The end product will have a simplistic design making it easy for users to interact with. This will be essential because of the wide range of technical knowledge that homeowners have We have gained practical knowledge of electronic equipments, communications, software analysis and designing. A new concept and implementation of an effective GSM based home security system. Meet the need to automate life to give advantage of the technological advancement. when the number of mobile phone users growing at a high rate, this system makes use of the mobile networks to provide the users with a simple and cheap home automation system. REFERENCES: TEXTUAL REFERENCES 1. Mazidi, Muhammad ali, The 8051 Microcontroller and Embedded Systems,Second Edition, Prentice Hall, 2007 WEB REFERENCES 1. www.embedtronics.com, 2. www.forum.nokia.com,

You might also like