Upload
shravani-sravs
View
223
Download
0
Embed Size (px)
Citation preview
7/27/2019 Gsm Based Home Automation Working File Finished
1/43
GSM BASED HOME AUTOMATION
ABSTRACT
Now a day's every system is automated in order to face newchallenges 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 remotetelephone, 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 thePIC18F452 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
7/27/2019 Gsm Based Home Automation Working File Finished
2/43
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 homeappliances.
TX
RX
PIC18F452Micro
controller
unitGSMMODU
LE
Power
supply DC
12V
MOBILE
(GSM)
LEDS
L293D IC DCMOTO
R
SMS RECEIVING ANDSENDING
7/27/2019 Gsm Based Home Automation Working File Finished
3/43
GSMMODULE
System operation flow diagram
MAIN BOARD
MICROCONTROLLER
GSM MODULESIM
SLOT
TX
LEDS SLOT
DCMOTOR
I
C
RX
12VOLT
DC
7/27/2019 Gsm Based Home Automation Working File Finished
4/43
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 second-
generation (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
http://en.wikipedia.org/wiki/European_Telecommunications_Standards_Institutehttp://en.wikipedia.org/wiki/2Ghttp://en.wikipedia.org/wiki/Cellular_networkhttp://en.wikipedia.org/wiki/Mobile_phonehttp://en.wikipedia.org/wiki/1Ghttp://en.wikipedia.org/wiki/European_Telecommunications_Standards_Institutehttp://en.wikipedia.org/wiki/2Ghttp://en.wikipedia.org/wiki/Cellular_networkhttp://en.wikipedia.org/wiki/Mobile_phonehttp://en.wikipedia.org/wiki/1G7/27/2019 Gsm Based Home Automation Working File Finished
5/43
networks, and originally described a digital, circuit switched network optimized
forfull 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 whenthe 3GPP developed third generation (3G) UMTS standards followed by fourth
generation (4G)LTE Advanced standards. "GSM" is a trademarkowned 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 increasinglyapparent 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 technologiesand protocols that varied from country to country, meaning thatphones 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
http://en.wikipedia.org/wiki/Duplex_(telecommunications)#Full_duplexhttp://en.wikipedia.org/wiki/Telephonyhttp://en.wikipedia.org/wiki/GPRShttp://en.wikipedia.org/wiki/EDGEhttp://en.wikipedia.org/wiki/3GPPhttp://en.wikipedia.org/wiki/3Ghttp://en.wikipedia.org/wiki/UMTShttp://en.wikipedia.org/wiki/4Ghttp://en.wikipedia.org/wiki/LTE_Advancedhttp://en.wikipedia.org/wiki/Trademarkhttp://en.wikipedia.org/wiki/GSM_Associationhttp://en.wikipedia.org/wiki/1Ghttp://en.wikipedia.org/wiki/Mobile_phonehttp://en.wikipedia.org/wiki/European_Conference_of_Postal_and_Telecommunications_Administrationshttp://en.wikipedia.org/wiki/Duplex_(telecommunications)#Full_duplexhttp://en.wikipedia.org/wiki/Telephonyhttp://en.wikipedia.org/wiki/GPRShttp://en.wikipedia.org/wiki/EDGEhttp://en.wikipedia.org/wiki/3GPPhttp://en.wikipedia.org/wiki/3Ghttp://en.wikipedia.org/wiki/UMTShttp://en.wikipedia.org/wiki/4Ghttp://en.wikipedia.org/wiki/LTE_Advancedhttp://en.wikipedia.org/wiki/Trademarkhttp://en.wikipedia.org/wiki/GSM_Associationhttp://en.wikipedia.org/wiki/1Ghttp://en.wikipedia.org/wiki/Mobile_phonehttp://en.wikipedia.org/wiki/European_Conference_of_Postal_and_Telecommunications_Administrations7/27/2019 Gsm Based Home Automation Working File Finished
6/43
7/27/2019 Gsm Based Home Automation Working File Finished
7/43
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 SIMcard 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.
7/27/2019 Gsm Based Home Automation Working File Finished
8/43
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 eachcellular provider. Sonera has number 91.
The Mobile Subscriber Identification Code (MSIC).This uniquely identifies
each customer of the provider. The length is 10 digits
7/27/2019 Gsm Based Home Automation Working File Finished
9/43
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 GSMsystem 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. Trafficchannels 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 TCHIt carries information with half of full rate channels.
Control Channel
Basic structure of Control channel
1 2 3 4 . . . . . 10 11 . . . . . 21
7/27/2019 Gsm Based Home Automation Working File Finished
10/43
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 frequency-
hopping 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 accuratelytune 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.
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
7/27/2019 Gsm Based Home Automation Working File Finished
11/43
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).Thisuses 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 ofDCCHs 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
http://en.wikipedia.org/wiki/Internethttp://en.wikipedia.org/wiki/Internet_Protocolhttp://en.wikipedia.org/wiki/Internethttp://en.wikipedia.org/wiki/Internet_Protocol7/27/2019 Gsm Based Home Automation Working File Finished
12/43
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-SwitchedData (HSCSD).
General Packet Radio Service (GPRS)
The General Packet Radio Service (GPRS) is apacket-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.
http://en.wikipedia.org/wiki/Circuit-switchedhttp://en.wikipedia.org/wiki/Circuit_Switched_Datahttp://en.wikipedia.org/wiki/High-Speed_Circuit-Switched_Datahttp://en.wikipedia.org/wiki/High-Speed_Circuit-Switched_Datahttp://en.wikipedia.org/wiki/General_Packet_Radio_Servicehttp://en.wikipedia.org/wiki/Packet-switchedhttp://en.wikipedia.org/wiki/Base_Transceiver_Stationhttp://en.wikipedia.org/wiki/SMShttp://en.wikipedia.org/wiki/Text_messaginghttp://en.wikipedia.org/wiki/Circuit-switchedhttp://en.wikipedia.org/wiki/Circuit_Switched_Datahttp://en.wikipedia.org/wiki/High-Speed_Circuit-Switched_Datahttp://en.wikipedia.org/wiki/High-Speed_Circuit-Switched_Datahttp://en.wikipedia.org/wiki/General_Packet_Radio_Servicehttp://en.wikipedia.org/wiki/Packet-switchedhttp://en.wikipedia.org/wiki/Base_Transceiver_Stationhttp://en.wikipedia.org/wiki/SMShttp://en.wikipedia.org/wiki/Text_messaging7/27/2019 Gsm Based Home Automation Working File Finished
13/43
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 theprogramming 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.
7/27/2019 Gsm Based Home Automation Working File Finished
14/43
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 destinedfor 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 ofembedded
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.
http://www.engineersgarage.com/articles/printers-types-workinghttp://www.engineersgarage.com/articles/embedded-systemshttp://www.engineersgarage.com/articles/embedded-systemshttp://www.engineersgarage.com/articles/printers-types-workinghttp://www.engineersgarage.com/articles/embedded-systemshttp://www.engineersgarage.com/articles/embedded-systems7/27/2019 Gsm Based Home Automation Working File Finished
15/43
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 fastapplication 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)
7/27/2019 Gsm Based Home Automation Working File Finished
16/43
Proteus is software for microprocessor simulation, schematic capture, and printed
circuit board (PCB) design. It is developed by Lab center Electronics.
The ProteusProfessional 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 thecomplete 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.
7/27/2019 Gsm Based Home Automation Working File Finished
17/43
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 anddisplayed 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 inreceive 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.
http://www.engineersgarage.com/atmega16-avr-microcontrollerhttp://www.engineersgarage.com/atmega16-avr-microcontroller7/27/2019 Gsm Based Home Automation Working File Finished
18/43
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)
7/27/2019 Gsm Based Home Automation Working File Finished
19/43
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 OperationUPM[0:1]: USART Parity Mode, Parity mode selection bits.
USBS: USART Stop Select Bit,
When 0-> 1 Stop BitWhen 1 -> 2 Stop BitsUCSZ[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
7/27/2019 Gsm Based Home Automation Working File Finished
20/43
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:
7/27/2019 Gsm Based Home Automation Working File Finished
21/43
- Supports RS-485 and RS-232
Parallel Slave Port (PSP) module
Analog Features:
Compatible 10-bit Analog-to-Digital Convertermodule (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
7/27/2019 Gsm Based Home Automation Working File Finished
22/43
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
7/27/2019 Gsm Based Home Automation Working File Finished
23/43
7/27/2019 Gsm Based Home Automation Working File Finished
24/43
DEVICE FEATURES
7/27/2019 Gsm Based Home Automation Working File Finished
25/43
7/27/2019 Gsm Based Home Automation Working File Finished
26/43
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 providebidirectional 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,
7/27/2019 Gsm Based Home Automation Working File Finished
27/43
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 dualH-bridge motor driver integrated circuit (IC). Motor drivers act ascurrent 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
7/27/2019 Gsm Based Home Automation Working File Finished
28/43
MICRO-CONTROLLER MODULE
An embedded microcontroller is a chip, which has a computer processor with allits 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 micro-
controller 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 micro-
controller 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
7/27/2019 Gsm Based Home Automation Working File Finished
29/43
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
7/27/2019 Gsm Based Home Automation Working File Finished
30/43
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 billionsubscribers are expected by the end of 2003. As GSM slowly moves towards
3GSM, more problems and security issues will be resolved.
http://www.engineersgarage.com/tutorials/at-commandshttp://www.engineersgarage.com/tutorials/at-commands7/27/2019 Gsm Based Home Automation Working File Finished
31/43
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 theMODEM. 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 SIMcard.
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,
7/27/2019 Gsm Based Home Automation Working File Finished
32/43
7/27/2019 Gsm Based Home Automation Working File Finished
33/43
As the command AT+CMGS and serial number of message are entered, SMS is
sent to the particular SIM.
For example,
AT+CMGS=1OK
5) ATD - This command is used to dial or call a number.
SYNTAX: ATD(Enter)
For example,
ATD123456789
6) ATA - This command is used to answer a call. An incoming call is indicatedby 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)
DC MOTOR MODULE
7/27/2019 Gsm Based Home Automation Working File Finished
34/43
7/27/2019 Gsm Based Home Automation Working File Finished
35/43
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 low-
intensity red light, but modern versions are available across the visible, ultraviolet,
and infrared wavelengths, with very high brightness.
PROGRAM
7/27/2019 Gsm Based Home Automation Working File Finished
36/43
#include
#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
7/27/2019 Gsm Based Home Automation Working File Finished
37/43
}
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
7/27/2019 Gsm Based Home Automation Working File Finished
38/43
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
7/27/2019 Gsm Based Home Automation Working File Finished
39/43
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);
}
}
7/27/2019 Gsm Based Home Automation Working File Finished
40/43
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 connectedthrough 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 motorand 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
7/27/2019 Gsm Based Home Automation Working File Finished
41/43
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
7/27/2019 Gsm Based Home Automation Working File Finished
42/43
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 technicalknowledge 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,
7/27/2019 Gsm Based Home Automation Working File Finished
43/43
http://www.embedtronics.com/