You are on page 1of 41

GSM Based Home Security System

A Report submitted for the Fulfillment of the requirements for the Degree of
BACIIELOR, OT' TECINTOL(rcY

in

INFORMATION TECHNOTOGY
By

RWIRIIB DAIIT'IARI (GAU-C -tut34)


MANAB GHOSE (GAU-C.I ut37)
JIIDHASING BRAHIVIA (GAU-C. I UL .22ri)
RWN ffi BRAHI\'IA (GAU-C-I W-228)

Under the supervision of


Mn BIKRAWIT CHOUDIITIRY

Crtil frftbOlfrcimlqy
tCottr{rrr:: lodchnd

DEPARTTIIEilT OF NFORMATIOITI TECHTOLOGY

d€r ffiFrd srrrar EdlmlrSrs


CENTRAL INSITTUTE OF TECHNOLOGY KOKRA"THAR
(A Centrally Funded Insdtute rmder Mlnlstry of IIRD, Govt" of India)
BODOLAND TERRTI0RIAL AREA DIsrRrcTs :: KoKRA[tlAR :: AS$AM r: zEtt370
Webelte: ww*.dtkokrqlhanln, wwwcilrc.ln
DEPARTMENT OF IilFORI'ATION TECHNOLOGY
Hrerffi
cI> crg @
CENTRAL INSTITTJTE OF TECHNOLOGY, KOffi
(An Autonomous Institute under MI{RD)
EgT9. r 2OOC
Kokrajhar - 78337A,BTAD, Assam, India
w* q itrfr rlrtf
trrrsl qn idtftrfcq

CERTIFICA

This is to certify that the work embodied in this project entitled "GSM BASED
HOME
(Gau-
SECURTTY sysrnni" subrnitted by Rwirub Daimari (Gau-C-l lll34), Manab Ghose
c-1||137),Judhasing Brahma (Gau-C-I |lL-226), Rwn Khungur Brahma
(Gau-C-I |lL'228'
out our direot supervisions and
to the Department of-Information Technology is canied under
guidance.

The project work has been prepared as per the regulations of -Cenfial Institute
of
the fulfillment of
Technology and we stongly r"ro**rnd ittut tlit project work be accepted
for
requirement for the degree of Bachelor of Technology'

.M,,
Mr.Kongkon kalita
HoD (irc)r.{,
DEPARTMENT OF INFORMATION TECHNOLOGY
\.
cr,edtq'ffi
.,
sreffa @
CENTRAL INSTITUTE OF TECHNOLOGY, KOKRAJHAR
(Ar1 Autonomous Institute under MHRD)
EaTD.:2OOO
etrd qt ffi {qrt
Kokrajhar - 783370. BTAD, Assam, India
rrysl qr ,lq\ffil{'nq

Certificate bv the Board of Examiners

This is to certifu that the project work entitled "GSM BASED HOME SECURITY
SYSTEM" submitted by Rwirub Daimari (Gau-C-l lll34), ldanab Ghose (Gau-C-l lll37),
Judhasing Brahma (Gau-C-lltL-226), Rwn Khungur Brahma (Gau-C-11/L-228) to the
Deparflnent of Information Technology of Central Institute of Technology, Kokrajhar has been
examined and evaluated.
The project work has been prepared as per the regulations of Cenfial Institute of
Technology and qualifies to be accepted for the fulfillment of requirement for the degree of
Bachelor of Technology.

nf)
v\ry{MMm
pHi [6t c o- o rdi n ilfroffirE S
It Board of Examiners

d€$P$tNFs
C.lnlrsl fnititut€ cll lechnology
Xotr'ilrar :' Eodoland DEPARTMENT OF TNFORMATION TECHNOLOGY
ffiq ffi Ti,aqprra ffitflrur-gru
CENTRAL INSTITTJTE OF TECHNOLOGY, KOKRAJHAR
(An Autonomous Institute under MHRD)
ESTIT, ;2O!0O Kokralhar: 783370, BTAD, Assam, India
a{fidl qr qd lrltlr
drt(t\ 'tt .rdfitfrrq

STUDEN TS' I}ECLARATTO]Y

We hereby declare that the project work entitled "GSM BASED HOME SECURITY
SYSTEM" is an authenticated work carried out by us under the guidance of Mr. Bikramjit
Choudhury, Asst. Prof., Department of IT, CIT, Kokrajhar for the fulfillment of award of the
degree in Information Technology and this work has not been submitted for similar purpose
anywhere else except to Department of IT, CIT, Kokrajhar.

/*t'n,LL Dar'Tn erti


Rwirub Daimari
University Roll No. :- Gau-C- 1 I I 134
lJniversity Registration No: 015055 of }AI1*ZAI?

fYL^nnb <Jth,osr-
Manab Ghose
{Jrriversity Roll No.:- Gau-C- Wl37
University Registration No: 01 5 I 85 of 2011 - zAn

Judhasingh Brahma
University Roll No. :- Gau-C- 1| ll-,-226
University Registration No: 08 1842 of 2012-13

Rwn Khungur Brahma


University Roll No. :-Gau-C* | | lL-228
lJniversity Registration No: 08 1862 of 2012-l3
C.6tnrl frrtltutr Of Tcchnotogy
DEPARTMENT OF INFORMATTON TECHNOLOGY
*fter ffi
fl{rlr..aher, Bcdoltrtd
nrr Itl

"{'trlra @
uttilt
rSttt c,{J_C'9|

N'Ul).)t
t CENTRAL INSTITUTE OF TECHNOLOGY, KOKRAJHAR
A-'T//)Lt
mlr (An Autonomous Institute under MHRD)
.f1 {llrtll
ESm, : 2OOG Kokrajhar - 783370, BTAD, Assam, lndia
rrd {t rrfl rt}r{t
rrrrdl {l sdf.t,t{q

ACKNOWLEDGEMENT

We wish to express our deep sense of gratitude to our Project Guide Mr. Bikramjit
Choudhury (Asst. Prof. Dept. of IT, CIT, Kokrajhar) for guiding us in our progress of the project.
We sincerely acknowiedge for giving his valuable guidance, critical reviews and comments for
giving the progress shape of the hoject. Words are inadequate in offering our thanks to
Prof.Debkumar Chakraborti (Director,ClT Kokrajhar), Mr. Kongkon Kalita (HoD.Vc Dept. of
Information Technology), Mr.Dipankar Sutradhar (Asst. Prof., Dept. of Instrumentation
Engineering), Mr.Ranjan Patowary (Asst. Prof. Dept. of IT, CIT, Kokrajhar), and Mr.Nayanmoni
Barman (Lab Technician) for consistent encouragement and support for shaping our project in
the presentable form.
We wish to put on record the appreciative original work of all the authors of various
technical papers which we have referred in our project without whom it was very difficult to
achieve progress of the project. Finally, we would like to express our heartfelt thanks to all
supporting staff members and friends who have been a constant source of encouragement for
successful completion of the project.
TABLE OF CONTEIITS
Page No.

ABSTRACT............
CHAPIER 1: INTRODUCTION
1.1. Introduction..................... 2

L.2. GeneralDescriPtion 3

CHAPIER 2: TOOLS and COMPONENTS


2.1. Microcontroller
PIC18F26K22 ........:..... 4
2.2. GSM 300 Module .............:....... 6

2.3. MAx-232.... 9

2.4. RS-232........ 9

2.5. Sensors....... 10

2.5.L. Fire sensor. 10

2.s.2.|RSensor..........;..............::........;j......... 11

2.6. 8u22er......... LL

2.7. 1EDs............ L2

2.8. CaPacitors., L2

2.9. Diode 13

2.10. Resistors..... T4

2.tL. Crysta1........ ................:.... 15

2.L2. Bread board.......... 15

2.13. Connecting wires........... 16

2.L4. PlCkit 3 burner......... T7

2.I5. REI-ATED STI.JDIES


2.15.1. EUSART Communication......:........ 18

2.15.2. Timer function..... 20


2.15.3. ADC......... 20
2.15.4. AT command............. 2l
CHAPTER 3: PROPOSED MODEL
3.1. Aims and Objectives .......... 22
3.2. Block diagram.... 22
CHAPTER 4: IMPLEMENTATION
4.1. Circuit diagram...... 24

4.2. Pseudo code............ 27

CHAPTERIt: CONCLUSION....... 32
CHAPTER 6: FIIIIIRE SCOPE.... 33

CHAPT'ER 7: REFERENCES...... 34
LIST OF FIGURES

Page No.
1. Pin diagram of PIC18F261Q2.......... 05

2. INTERFACING WTTH MICRO CONTROLI.ER FOR SENDING SMS........ 07

3. MAX 232 rC..............;............ 09

4: RS 232maleand female. 09

5: Fire sensor......... l0
6: IR Sensor 1l

7:Buzz,et. ll
8: Light-Emitting Diodes (LEDs)....... t2
9: Capacitors................ r3

10 : Diode.. ...............................i...... l4
1 I : Resistor.:................. t4
12 : Bread Board......... 15

l3: ConnectingWires...... .........................:............:.................. 16

14: PICkit 3 BLJRNER .........r......... T7

IS:EUSART Transmit block diagram ....'..'........... r9

16:EUSART Receive block diagram r9

17: Block diagram of ADC...... 20

18: Block diagram of GSM based home security................ 23

19: Circuit Diagram of GSM Based home security................ 24

20: IR Sensor...... 25

2l: Fire Sensor 26

22:Power supply with 5V voltage regulator.... 26


ABSTRACT

Automated security systems are a useful addition to today's home where safety is an
important issue. The important issue of this system is to obtain information from a remote place
about the intnrsion at our home via the automated system rathcr than a traditional method of
security system. A free standing intrusion detector has a transmitter coupled with a portable
receiver to alett a homeowner that an intrusion has taken plaoe or occurred within a pre-s€t time
period. With the same approach in mind, we, the final year students of Bachelor of Technology
(Information Technology), have taken up the Advanced GSM Based Home Security System as
our final year project.

In this project we used PIC18F26K22 microconfroller along with intnrsion detectors


(Sensors) to find out the intnrsion and sends the obtained intnrsion signal to the registered GSM
Sim. We have used infrared and fire sensors to detect intrusion or fire. Whenever sensor will
detect some intrusion, a message will be send to the rcgistcred rnobile via the GSM based
modem. Different indicators such as LEDs and Buzzers are also uscd to indicate the intrusion
occurring.
CHAPTER 1.I NTRODUCTION

1.1 Introduction
In today's age of digital technology and intelligent systems, home automation has

become one of the fastest developing application-based technologies in the world. The idea of
comfortable living in home has since changed for the past decade as digital, vision and wireless
technologies are integrated into it. Intelligent homes, in simple terms, can be described as
homes that are fully automated in terms of carrying out a predetermined task, providing
feedback to the users, and responding accordingly to situations. In other words, it simply allows
many aspects of the home system such as temperature and lighting control, network and
communications, entertainment system, emergency response and security monitoring systems
to be automated and controlled, both near and at a distance. Automated security systems play
an important role of providing an extra layer of security through user authentication to prevent
break-ins at entry points and also to track illegal intrusions or unsolicited activities within the
vicinity of the home (indoorsand outdoors).
There has been much research done in the design of various types of automated
security systems. Sensor-based systems that rely on contact or movement-sensors or contact-
based systems such as fingerprint and palm print scan or keypad-activation that require
substantial amount of contact with an input device. Many security systems are based on only a
single system. In an event of system failure or intrusion of the user authentication, there is no
backup system to monitor the home continually. This shortcoming can be dealt with using
multiple security systems (or multi-layered security systems). However, multi-system
implementations will definitely be more demanding in terms of computational cost and
organization. This requires careful integration and sharing of resources. Thus, a feasible system
should be effective, practical and reasonable in cost. In this paper, we proposed an integrated
dual-level sensor based home security system, consisting of two sub systems an lR sensor,
burglar alarm module and fire alarm module. Both subsystems work independently but are
incorporated into a single automated system for practical implementation. The organization of
this paper is as follows
1.2 GENERAL DESCRIPTION
system' In this project we have planned to
The project here is all about a Home security
an intrusion into a monitored area by an
infrared
develop a Home security system for detecting
detector.Asecuritysystemhasafree-standingintrusiondetector.Thefreestandingintrusion
portable receiver to alert a homeowner that an
detector has a transmitter coupled with a
pre-set time period 'The area under surveillance
intrusionhas taken place or occurred within a
ismonitoredbyaninfrareddetectorwhichactivatesthetransmitteruponthedetectionof
abruptdifferencesininfraredradiation|evels,associatedwiththepresenceofawarmbodyin
anotherwiseequilibratedenvironment'Aradiosignalisemittedbythetransmitterwhichis
intrusion
receiver. A first signal, indicating that an
received by the portable hand-held remote
hasbeendetectedlessthanapreselectedperiodoftimeinthepastinthemonitoredareas'is
displayedonthereceiverforthatpreselectedperiodoftime.Aftertheprese|ectedperiodof
time has elapsed, a second signal is generated
to indicate that the intrusion took place at a time
greaterthantheprese|ectedperiodoftimeinthepastandthattheprobabilityoftheintruder
is activated, the signal is continuously
sti|l being present is ress. once the intrusion detector
intrusion detector has been reset'
transmitted to the portable receiver until the
Asecuritysystemforahomecomprisingafreestandingintrusiondetectortobesetin
anareaofsaidhometobeprotected,saidfreestandingintrusiondetectorcomprisingan
in responseto an intrusion into said area' A
intrusion detector to generate an intrusion signal
intrusion signal to transmit a radio-signal means
radio signaling transmitter responsive to said
time in response to said intrusion signal
for modulating said radio signal for a predetermined
andtimedelaymeansforde|ayingtheactivationofsaidintrusiondetectortoa|Iowaperson
sufficient time to exit said area to be
protected after setting said intrusion detector and a
Means for generating an output signal
portable receiver adapted to be hand carried comprising.
generating a visual display indicating an
in response to said radio signal. Display means for
signal.
intrusion has occurred in response to said output
I
CHAPTER2: TOOLS and COMPONENTS

2. 1. PlCl 8F26K22 M icrocontrol ler


The PIC18F26K22 is a microcontroller used for programming and to control the
components. This microcontrollers has an advantages of high computationalperformance at an
economical price with the addition of high-endurance, Flash program memory. On top of these
features, the P|C18F26K22 introduces design enhancements that make themicrocontroller a

logical choice for high performance,power sensitive applications.

Core Features
1. nanoWatt TECHNOLOGY

The P|C18F26K22 incorporates a range of features that can significantly reduce power
consumption during operation.

Kev item include:


. Alternate Run Modes: By clocking the controller from the Timerl source or the internal
oscillator block, power consumption during code execution can be reduced by as much as
90%.

o Multiple ldle Modes: The controller can also run with its CPU core disabled but the
peripherals still active. In these states, power consumption can be reduced even further, to as
ittf e as 4/o of normal operation requirements.
f

o On-the-fly Mode Switching: The power managed modes are invoked by user code during
operation, allowing the user to incorporate power saving ideas into their application
softwaredesign.
. Low Consumption in Key Modules: The power requirements for both Timerl and the
Watchdog Timer are minimized.

2. MULTIPLE OSCILLATOR OPTIONS AND FEATURES


The P|C18F26K22 offers ten different oscillator options, allowing users a wide range of
choices in developing application hardware. These include:

o Four Crystal modes, using crystals or ceramic resonators.


Two External Clock modes, offering the option of using two pins (oscillator input and a
divide-by-4 clock output) or one pin (oscillator input, with the second pin reassigned as
general l/O).
Two External RC Oscillator modes with the same pin options as the External Clock modes.
An internal oscillator block which contains a 16 MHz HFINTOSC oscillator and a 31 kHz
LFINTOSC oscillator, which together provide 8 user selectable clock frequencies, from 31 kHz
to15MHz. This option frees the two oscillator pins for use as additional general purpose l/O.
A Phase Lock Loop (PLL) frequency multiplier, available to both external and internal
oscillatormodes, which allows clock speeds of up to 54MHz. Used with the internal oscillator,
the Pllgives users a complete selection of clock speeds, from 31 kHz to 64 MHz all without
using anexternal crystal or clock circuit.

Besides its availability as a clock source, the internal oscillator block provides a stable
reference source that gives the microcontroller additional features for robustoperation:
o Fail-Safe Clock Monitor: This option constantly monitorsthe main clock source against
areference signal provided by the LFINTOSC. lf a clock failure occurs, the controller is
switched tothe internal oscillator block, allowing for continued operation or a safe
application shutdown.
o to serve as the clock source
Two-Speed Start-up: This option allows the internal oscillator
from Power-on Reset, or wake-up from Sleep mode, until the primary clock source is
available.

28-pin PDIR SOIC, SSOP

ffil-nyvpp/RE3€ o1 28 {--+ RB7


RAo "{r"'-'> 2 27 € RBo
RA1 ++ 3 N zo € RBs
RA2 .<F{r 4 N 25 {-{> RB4
5 24 +-+ RB3
RA3 M
RA4 H o sN 23 <]-?
<{-r>
RB2
RAs €> 7 22 RB 1

I trr <'+ RBo

r
Vss 21
->
RA7 --+ I 2A Vnn
RA6 <- 10 19 <- V,SS

RCO '{---} 11 U 18 *...+ RC7


€>
RC1 12
H 17 € RCo
RC2<+ 13
& 16 {r+ RCs
RC3 +4> 14 15 .r..-> RC4

Fig 1:- Pin diagram of P|C18F26K22


2.2GSM 300 Module
card and act just like a
This GSM Modem can accept any GSM network operator slM
using this modem will be that
mobile phone with its own unique phone number. Advantage of
Applications
you can use its RS232 port to communicate and develop embedded applications'
like SMS Control, data transfer, remote control and logging can
be developed easily' The
any microcontroller' lt can be
modem can either be connected to PC serial port directly or to
used to send and receive SMS or make/receive voice calls.
lt can also be used in GPRS mode to
and control' In GPRS mode you
connect to internet and do many applications for data logging
can also connect to any remote FTp server and upload files
for data logging. This GSM modem is
and easy integration to RS232
a highly flexible plug and play quad band GSM modem for direct
GPRS and integrated TCP/IP stack'
applications. supports features like Voice, sMS, Data/Fax,

APPTICATIONS

I.SMS based Remote Control & Alerts'


I

2.SecuritY APPlications.
3.Sensor Monitoring.
4. GPRS Mode Remote Data Logging'

FEATURES

1. Highly Reliable for 24x7 operations with Matched Antenna.


2. Status of Modem lndicated by LED'
3.Simple to Use & Low Cost.
4.Quad Band Modem supports all GSM operator SIM cards'

POWER SUPPLY REQUIREMENT

Use DC Power Adaptor with following ratings


. DC Voltage: 12V
. DC Current Rating at least: 1A
. DC Socket Polarity: Centre +ve& Outside -ve
. current consumption in normal operation 250mA, can rise up to
lAmp peak while
least lAmp current' Power
transmission so your power supply should be able to handle at
supply is included in the packaging of this product'
SERIAT CABLE DETAITS

Serial Cable provided has following pins connected with RS232 level (+12V / -tzVl output

1. Pin 2 is RS232 levelTX output


2. Pin 3 is RS232 level RX input
3.Pin 5 is Ground

Serial Cable connections

To use with a PCserial port, use a serial cable of male-female type with pins 2, 3, 5 connected
to 2,3,5 straight (no cross over cable).

SAMPTE CODE FOR INTERFACING WITH MICRO CONTROTTER FOR SENDING SMS

12x
x14
11 ;)
13

---
-

Fig 2:-INTERFACING WITH MICRO CONTROTTER FOR SENDING SMS

Connect MCU TXD/RXD through MAX232 so that MCU can communicate with GSM Modem.
Then use following reference code to send SMS. Before going ahead with MCU interfacing, it is
best practice to first try all these commands with PC with the use of Terminal software. Then
make a note of all AT commands and then proceed with development.
void moin}
{
initADc0; // setup ADC
serialtnit}; // setup 9600 s;eriol communicotion
while(7)
{
printf("AAn");
delayms(2000); // Z sec delay
p ri ntf (" AT+C M G F = 7\n " ) ;
deloyms(20Cf); // Z sec delay
p ri ntf( " AT+C M G S=\" 09 8 2 5 I 5 I 509 \ "\n" ) ;
delayms(20M); // Z sec deloY
printf ("CH#7=%bu ", getADC(l)); // sends ADC volue osSMS
putchar(25); // ctrt-z indicotes end of sMS and tronsmit
messoge
deloyms(2000); // 2 sec delay
]
].
2.3 MAX-232
The MAX232 is an integrated circuit that converts signals from an RS-232 serial port to
signals suitable for use in TTL compatible digital logic circuits, so that devices works on TTL logic
can share the data with devices connected through Serial port (DB9 Connector).

Fig 3: MAX 232 lC

2.4 RS-232
This is a plug and play GSM Modem with a simple to Interface serial interface. Use it to
send SMS, make and receive calts, and do other GSM operations by controlling it through
simple AT commands from micro controllers and computers. lt uses the highly popular SlM300
module for all its operations. lt comes with a standard RS232 interface which can be used to
easily interface the modem to micro controllers and computers.

Fig 4: RS 232 male and female


2.5 SENSORS
A sensor is a device that detects and responds to some type of input from the physical
environment. The specific input could be light, heat, motion, moisture, pressure, or any one of
a great number of other environmental phenomena. The output is generally a signal that is
converted to human-readable display at the sensor location or transmitted electronically over a
network for reading or furthei processing. Two types of sensor are used in this project. They
are:

2.5,1 Fire Sensor


Aflame detector is a sensor designed to detect and respond to the presence of
a flame or fire. Responses to a detected flame depend on the installatlon, but can include
sounding an dlarm, deactivating a fuel line (such as a propane or a natural gas line), and
activating a fire suppression system. When used in applications such as industrial furnaces,
their role is to provide confirmation that the furnace is properly liU in these cases they take no
direct action beyond notifying the operator or control system. A flame detector can often
respond faster and more accurately than a smoke or heat detector due to the mechanisms it
uses to detect the flame.

Fig 5: Fire sensor

10
2.5.21R Sensor
Infrared radiation is the portion of electromagnetic spectrum having wavelengths longer
than visible light wavelengths, but smaller than microwaves, i.e., the region roughly from
0.75pm to 1000pm is the infrared region. Infrared waves are invisible to human eyes' The
wavelength region of 0.75pm to 3pm is called near infrared, the region from 3pm to 6pm is
called mid infrared and the region higher than 6pm is called far infrared. (The demarcations are
not rigid; regions are defined differently by many).

*t, '' *i,,l,l' :'',,

'

Fig 6: lRSensor

2.6 BUZZER
Buzzer is a device used for beep signal. This will help us to make understand information
or message. A buzzer is usually electronic device used in automobiles, household applications
etc.

Fig 7: Buzzer

It mostly consists of switches or sensors connected to a control unit that determines if and
which button was pushed or a preset time has lapsed, and usually illuminates a light on
appropriate button or control panel, and sounds a warning in the form of a continuous or
intermittent buzzingor beeping sound. Initially this device was based on an
electromechanical system which wasidentical to an electrical bell without the metalgong.
Often these units were anchored to a wall or ceiling and used the ceiling or wall as a sounding
board. Another implementation with some AC-connected devices was to implement a circuit
to
make the AC current into a noise loud enough toderive a loudspeaker and hook this circuit to a

11
cheap 8-ohm speaker. These buzzers do not makea sound or turn on a light, they stop a
exit and
nearby digital clock, briefly fire two smoke cannons oneach side of the stage
open the exit. However, at the end of the Heartbreaker in Viking,the buzzer
is replaced with
a sword that, when removed, Causes two contacts to touch, closingthe circuit and
causing the latter two actions above to occur.

2.7light Emitting Diodes (LEDsl


LEDs present many advantages over incandescent light sources including lower enerry
and greater
consumption, longer lifetime, improved robustness, smaller size, faster switching
and
durability and reliabiliW. LEDs powerful enough for room lighting are relatively expensive
sources of
require more precise current and heat management than compact fluorescent lamp
comparable output.

Fig 8: Light-Emitting Dlodes (tEDs)

lighting,
Light-emitting diodes are used in applications as diverse as replacements for aviation
as in traffic
automotive lighting (particularly brake lamps, turn signals and indicators) as well
and extreme
signals. The compact size, the possibility of narrow bandwidth, switching speed,
while
reliability of LEDs has allowed new text and video displays and sensors to be developed,
their high sw1ching rates are also useful in advanced communications technology. Infrared
LEDs are also used in the remote control units of many commercial
products including
televisions, DVD players, and other domestic appliances'

2.8 ELECTROLYTIC CAPACITORS


An electrolytic capacitor is a type of capacitor that uses an electrolyte, an ionic-
conductingliquid, as one of its plates, to achieve a larger capacitance
per unit volume than
They are
other types.They are often referred to in electronics usage simply as "electrolytic".
used inrelatively high-current and low-frequencY electrical circuits, particularly
in power supply
in
filters, where they store charge needed to moderate output voltage and current fluctuations

T2
rectifier output. They are also widely used as coupling capacitors in circuits where AC shouldbe
conducted but DC should not. There are two types of electrolytic; aluminum and tantalum'

SJructure of a Caoacitor
A capacitor contains two conductor plates which are generally made of metal and an
insulatorbetween them. This insulator also known as dielectric is made up of material like
paper,plastic, ceramic or glass. The two plates are electrically connected to the external circuit
withthe help of two thin metal rods also known as the legs of the capacitor. These two
plates

are used to store charge between them. One is connected with positivevoltage and other one
with negative voltage. A capacitor is characterized by the parametercapacitance. Capacitance is
measured as ratio of difference of charges between the plates andtotal voltage drop between
the plates.
C = de/dV
The unit of capacitance is FAMD.

Fig 9 : Capacitors

2.9DlODE
The diode is a p-n junction device. Diode is the component used to control the flow of
the current in any one direction. Thediode widely works in fonrard bias.DiodeWhen the current
flows from the p to N direction. Then it is in fonrvard bias. The Zenner diode is used in reverse
bias function i.e. N to p direction. Visually the identification of the diode's terminal can be done

13
by identifying he silver/black line. The silver/black line is the negative terminal (cathode) and
the other terminal is the positive terminal (cathode)

Fig 10 : Diode

z.to RESISTORS
The 1ow of charge through any material encounters an opposing force similar in many
respects to mechanical friction. This opposing force is called resistance of the material .in some
electric circuit resistance is deliberately introduced in form of resistor. Resistor used fall in
three categories , only two of which are color coded which are metal film and carbon film
resistor .the third category is the wire wound type ,where value are generally printed on the
vitreous paint finish of the component. Resistors are in ohms and are represented in Greek
letter omega, looks as an upturned horseshoe. Most electronic circuit requires resistors to
make them work properly and it is obliviously important to find out something about the
different types of resistors available. Resistance is measured in ohms; the symbol for ohm is an
omega ohm. 1 ohm is quite smallfor electronics so resistances are often given in kilo ohm and
Mega ohm. Resistors used in electronics can have resistances as low as 0.1 ohm or as high as 10
Mega ohm.

tr
Fig II :Re sistor
FUNCTION
Resistor restricts the flow of electric current, for example a resistor is placed in series with
light-emitting diode (LED) to limit the current passing through the LED.

L4
2.L1. CRYSTAL

A crystal oscillator is an electronic oscillator circuit that uses


the mechanical resonance of a
vibrating crystal of piezoelectric material to create an
electrical signal with a very
precise frequency.This frequency is commonly used to keep
track of time (as in quartz
integrated circuits, and to stabilize
wristwatches), to provide a stable clock signal for digital
common type of piezoelectric
frequencies for radio transmitters and receivers. The most
incorporating them became known as
resonator used is the quartz crystal, so oscillator circuits
polycrystalline ceramics are used
crystal oscillators,but other piezoelectric materials including
in similar circuits'Quartz crystals are manufactured for frequencies from a
few tens
of kilohertz to hundreds of megahertz. More than two
billion crystals are manufactured
clocks' radios' computers'
annually.Most are used for consumer devices such as wristwatches'
andCell phoneS. Quartz crystals are alsOfound inside
test and measurement equipment' such as
counters, signal generators, andoscilloscopes'

2.L2 BREAD BOARD


quickly before finalizing any circuit design.
A breadboard is used to build and test circuits
The breadboard has many holes into which circuit components like lcs and resistors can be
inserted. A typical breadboard is shown below:

__
t:::: ii:i:: i:: l'=i i ii il lii ili: i iil:lit:i i:l; i'ii:il:ii
:
i,ii i: iili
: 1l il;- : -,- :: i : : : : : : ii:,:;l;r:1 ;':
:i 5;i :: : l;;" *,,r.r
:
: :
::l :;;;:i:;::
ri.'-u,
::;::: ::;:
:::;: :i::i: :::il:i i:; ;:l;:;i:: ::!i;:::::
: I : :: :: :
'
I I : : :; : l: : ; I i :: : . :: : ; :: I .i i; : i : i i i : :iitllf :*
FigL2: Bread Board
Tousethebreadboard,thelegsofcomponentsareplacedintheholes'Eachsetofholes
connected by a metal strip underneath forms a node'
A node is a point in a circuit where two
components are formed by putting
components are connected. connections between different
their legs in a common node.
The long top and bottom row of holes are usually used
for power supply connections' The rest
them together with jumper wires'
of the circuit is built by placing components and connecting
lcs are placed in the middle of the board so that half of
the legs are on one side of the middle
line and half on the other.

15
Bread boarding tiPs:
that one can debug it and
It is important to breadboard a circuit neatly and systematically, so
get it running easily and quickly. lt also helps when someone else needs to
understand and
inspect the circuit' Here are some tips:
Pov.,er the chips from the side-lines
1. Always use the side-lines for power supply connections.
and not directly from the power supply.
power connections'
2. Use black wires for ground connections (0V), and red for other
the board does not look cluttered'
3. Keep the jumper wiies on the board flat, so that
makes changing the chips
4. Route jumper wires around the chips and not over the chips. This
when needed easier.
and LEDs, so that they fit in
5. you could trim the legs of components like reiistors, transistors
snugly and do not get pulled out by accident'

2.L3 CONNECTING WIRES


The definition of connecting wire is a piece of wire used to attach
two circuits or
large enough to support the
components together. The gauge or size of the wire must be
amount of current flow.

Fig 13: Connecting Wires

16
2.l4PICKit 3 BURNER
P|CkitisafamilyofprogrammersforPlCmicrocontro|lersmadebyMicrochip
Technology. They are used to program and
debug microcontrollers' as well as program
EEPRoM.Somemode|salsofeaturelogicanalyzerandseria|communications(UART)too].The
PlCkit use a mailing list for collaboration'
people who develop open-source software for the
of the Plckit 2 with the
Pickit3MicrochiphasgoneontomanufacturethePlCkit3,avariation
lt features a faster 16-bit P\C}4F Processor and
a
same form factor and a new translucent case.
the
complaints of it not being as reliable as
wider voltage regulation range' There are some
Prckit 2.
voltage regulators' This allows them' in
Both Plckit 2 and Plckit 3 have internal, switch-mode
2'5 to 5 volts' or in the case of the Plckit 3'
the case of the Plckit 2, to generate voltages from output
2.5 to 5.5 volts, from 5V USB, at around
100mA' Both have options for calibrating the
for some Plcs, the MCLR programming
with a multimeter, for increased accuracy. Additionally, the flash
volts. ThiS voltage is required to reprogram
voltage can be generated, at around 13-14
memory.

Fig T4:PICK|I 3 BURNER

T7
2.!5. RELATED STUDIES

2.!5.!z EUSART Commu nication

The Enhanced Unlversal Synchronous Asynchronous Receiver Transmitter


(EUSART)
generators, shift
module is a serial l/O communications peripheral. lt contains all the clock
registers and data buffers necessary to perform an input or output
serial data transfer
a serial communications
independent of device program execution. The EUSART, also known as
Interface(scl), canbe configured as a full-duplex asynchronous system or half-duplex
synchronous system. Full-Duplex mode is useful for communications
with peripheral systems,
mode is intended for
such as cRT terminals and personal computers. Half-Duplex synchronous
communications with peripheral devices, such as A/D or D/A integrated
circuits, serial
EEpROMs or other microcontrollers. These devices typically do
not have internal clocks for
Baud rate generation and require the external clock signal
provided by a master synchronous
device.
The EUSART module includes the following capabilities:
. Full-duplex asynchronous transmit and receive'
. Two-character inPut buffer'
. One-character outPut buffer.
. Programmable 8-bit or 9-bit character length'
. Address detection in 9-bit mode.
. lnput buffer overrun error detection.
. Received character framing error detection'
. Half-duplex synchronous master.
. Half-duplex sYnchronous slave.
. Programmable clock and data polarity.
The EUSART module implements the following additional features, making
it ideally suited for
use in Local Interconnect Network (LlN) bus systems:
. Automatic detection and calibration of the baud rate'
. Wake-up on Break recePtion'
. 13-bit Break character transmits.

The operation of the EUSART module is controlled through three


registers:

. Transmit Status and Control (TXSTAx)


. Receive Status and Control (RCSTAx)
. Baud Rate Control (BAUDCONx)

18
For all modes of EUSART operation, the TRIS control bits corresponding to the R)fi/DTx and
TXx/CKx pins should be set to '1'. The EUSART control will automatically reconfigure the pin
from input to output, as needed. When the receiver or transmitter section is not enabled then
the corresponding RXx/DTx or TXx/CKx pin may be used for general purpose input and output.

Fig IS:EUSART Transmit block diagram

RXxrDTx ph

FCReGx ReglsEr

Fig 16:EUSART Receive block diagram

19
2.!5.2: TIMER FUNCTION
features:
The Timer0 module
incorporates the following

Softwareselectab|eoperationasatimero,..oun*,inboth8-bitandl6.bitmodes.
registers'
Readable and writable
programmable pre-scalar'
Dedicated 8-bit, software
Selectablec|ocksource(internalorexternal)
o Edge select for external
clock

o lnterruPt-on-overflow

2.15.32 ADC . ,a .rn


converslc of an analog
input signal to a
Converter (ADC) allows
The Analog-to-Digital
and hold is
ana noto circuit. The output of the sample
lo-bitbinaryrepresentationofthatsignal.Thisdeviceusesanaloginputs,whichare
mu|tiplexed into a ,"u,"
samp|e result via
The converter generates a 10-bit binary
of the converter.
connected to the input resurt into the ADc result
registers (ADRESL
and stores the conversion
successive approximation
is software serectabre
to either VDD or a voltage
vortage reference
and ADRESH). The ADc
reference pins
applied to the external

TheADCcangenerateaninterruptuponcompletionofaconversion.Thisinterruptcan
be used to wake-up
the device from Sleep'

FigIT: Block diagram


2.L5.42 AT COMMAND

AT commands are instructions used to control a modem. AT is the abbreviation of


Attention. Every command line starts with
rrATrr
Of rratrr. That'S Why mOdem Commands afe
,et. GSM/GPRS modems and mobile phones
support an AT command set that is specific to the GSM technology, which includes SMS related
commands like AT+CMGS (Send SMS message), AT+CMGF=1(TexI mode). The starting "AT" is
the prefix that informs the modem about the start of a command line. lt is not part of the AT
command name. For example, D is the actual AT command name in ATD and +CMGS is the
actual AT command name in AT+CMGS.

Some of the AT Commands:

1) Ar To check whether the device is working or not

2l ArEo To enable the Echo

3) ArEl To disable the Echo

4l AT+cMGF=o To erfabfe text mode

5) AT+CMGS:<mobile number> To pass the mobile number to GSM module

Steps for Sending n essase:

1. AT
2. 0x0d
3. AT+CMGF=1
4. AT+CMGS =" <Mobile N u mbe r>"
5. Type message to send
6. cTRL+z (25)

2T
CHAPTER 3: PROPOSED MODEL

3.1 Aims and Obiectives


crime is increasing and everybody
Home/ Bank/ office security has been a major issue where
wants to take proper measures to prevent intrusion. In
addition there was a need to automate
advancement in such a way that a
home so that user can take advantage of the technological
person getting off the office does not get melted with the hot climate.

Some of the aims and objectives of the project are:


o are installed at room which
Detecting Obstacle with Sensor: In our projects certain sensors
senses the intrusion and it
is capable of detecting the intrusions taking place. The sensors
gives the information to the microcontroller and further the
intrusion information are again
GSM module via installed GSM slM
directed to the phone number programmed through the
card in the form text message'
o main aim of the project is to
obtaining the intrusion information from remote area: The
place from the installed device which we
receive the intrusion information at any remote
are develoPing in this Project.
are also aiming for the
o controlling or accessing the devices from a remote place: we
phone number via text message
control of the installed device at the home through any
controlling the device'
which the GSM SIM installed will receive it as a code for

3.2 Block diagram


structure how to receive a
Inthe block diagram below, the diagram describes about the
problem detected by the sensors'
message from the installed GSM slM about the

Here, the sensors senses the intrusion and this intrusion sensed in informed to the
are set of programs'
microcontroller through the required operations done, which
sensors it alerts through
When the microcontroller receives information from the
indicators are the LEDs which glow in
indicators as well as through the GSM module. Here the
and Buzzer alarm at the room so
different colors according to the condition of the seriousness
that it can alert the neighbors.
programmed GSM SIM about the
The GSM module sends a text message to the
Here different sensor senses different
intrusion as per the text message written at the program.
intrusion'
intrusion and the GSM also sends the according to the sensed
22
Receive
Nlessage
Q"anrl
Mess age Micro-
Required

GSM Controller l* Sensors


frr
Mobile /{
l#
\*r* Operations
\r*
Ne,tuuork
Phone Perf,orrn

It
\/

lndicators

Fig 1g: Block diagram of GsM based home security


CHAPTER IMPLEMENTATION

4.ICIRCUIT DIAGRAM:
VDD

R7 ,A.
^ 4.7K . 1X4

*r iietRvPPrRE3 RBz
*L
'6
RAO
RAI
Rg6
RB5
RAz RB4
RA3 RB3
HAq HBe
RAs
itI
RBt
Vss RBo
RA7 VDD

r: Y1
8.00il1H2
RA6
RCO
RCr
v$$1
RC7
RC6
roK
VDD
RC2 RCs R5
RT RC3 RC4

GSM Based home security'


Fig19: Circuit Diagram of

|ntheabovefigurewehadshownhowtointerfacetheP|C1SF26K22microcontroller is active low


and the GSM modure. As the pinl of the microcontroter
arong with the sensors
pin
gMHz is fed into the microcontrolrer in
resetbutton,wehadsupplied(+ve)5Vruoo,r.Theoutputofthesensorisgivenasanaloginput
of
externar oscitator
in A3 of poRT A in pin5. The
numbersgandl0.Thepinnumbers8andlgaregroundedwhi|ethepinnumbers14and20
areprovidedwithpositive+5Vpowersupply.TheRBTandRB6ofPORTBareusedfortheserial
GSM Module 300 the Microcontroller'
communication between the

24
+5v

lMohm
olp
AN3

2N2222

100ohm

--
-l

Fig 20:lR Sensor

Asthemicrocontro|lerwillbecontinuous|ymonitoringtheAna|ogpinAN3andfetching
signalson|yfromthatpin,soitisrequiredtof|ip-f|opthecircuittoon|ypasson|yonesigna]ata output
used two nPn transistors to ground the
time or interval. so in the above figure we have
input in the microcontroller'
of other when itself is conducting feeding as

25
+5v

olP
Fire $ensor

Fig Fire Sensor

14V AC
23OAC

N4007

Fig Powersupplywith5Vvoltageregulator
get Dc voltage from the
AC
bridge rectifier to
a full
we had impremented to the Voltage
rn the above figure
of the trri itiogt rectifier is fed as input
(230V) transformer. in" output
of OC 5V' Later whose
output is fed to the
Regulator LM7805
to get constant Oo*"' 'uOOtV
microcontrol|eras5V(Dc)constantpowersupply.

26
Pseudo code
1. Begin:

2. Define MACRO:
2.L.|nc|udeheaderfileforstdio
2.2.lncludeheaderfileforstdlib
2.3.|ncludeheaderfi|eforPlc18F26K22
z.4.Configure FOSC to HSMP
2.5. Configure WDTEN to
OFF

2.6.Configure LVP to OFF

2.7. Configure DEBUG to OFF


3. Function Definition:
3.1. Define function for DelaY
void delaY$
t
inti
for(i=O to i=15500);
)
Communication
3.z.Define tunltion for UART1
void UART1O
t
SPBRGl = 51;
TXSTAIb|Is.SYNC = 0;
TXSTAIb|Is.TXEN = ti
TXSTAIbiIs.BRGH = ti
BAUDCONIbIIS.BRGI6 = O;
RCISTAbIIs.CREN = ti
RCISTAbiIs.SPEN = Li
)
Ar to
nr ADc ( Analog
3.3. Define function for ADC
Dit gital Converter)
void ADCO

ADCONObitS.ADON =ti
ADCON1bits.PVCFG = 00i
ADCON1bits.NVCFG = 00i
ADCON2bits.ACQT =5i
ADCON2bits.ADCS =4i
PlRlbits.ADlF = 0;
ADCON2bitS.ADFM = O;
ADCONObits.GO = Li
)
3.4.Define function for TIMERO
- void TlMER00
27
T0CONbits.TOSBlT- 0;
T0CONbits.TOCS - 0;
TocoNbits.ToPs = 4;
TOCONbits.TMROON = t;
TOCONb|IS.PSA = O;

UIE Declaration:
4. Variable IJELICII (
to ATEO ll^t^o^',n::l"
4.!. Declare unsigned character for echo[] lllt:':l
F=L /.lfor GSM rext Mode
i.i. Slllill :H:ffi character for initializ;[] to nr+crue ,-lant nf FNTFR
,Dliilil ililffi character ror enter to 0x0D // Ascll equivalent or ENrER
i.i. Sllilll ..r r- ar, // to
^r.r,:c- // tn start
cfart sending MSG
i.i. il:iffi character for mss_startl] to Ar+cMGS= i- f^r nr rmhar
i.l. Sliiil ffi ffi crra racter ror corn a.to "" 4{.:.:..Y.'.:::iJ"i'lj::l:T:i:
.r,.,.o",. for numlr to +elxxxxxxxxxx //
number where MSG
i.'.. Blilli! :::i;ffi
will be sent // MsG which
msgl[] to "lnput from fire sensorl"
4.7. Declare unsigned character for
will be sensort!!" // MsG which
1".1tJ,1", character for mse2u
to "rnput from rR
l::: l"J.l]r:
will be sent for second sensor to oxLA llASCIl for crRL+Z
terminatefl
4.1. Declare unsigned character for

5. Main Function Start:


void mainfl
lnitialize a=3,j=0, flag, total to integer
oscillator
;.;.
),L. ffii,;
llllLlsll' ;;io*bits.scs to 2for selectins internal rt n -^:ll^sar
Oscillator
to 5 for selecting SMHZ
5.3. lnitialize osccoNbits.lRCF l't t^ 'l .}rr zenabre them as Anarog
and ANSELAbiis.ANsA3 to 1to
l.i. lllllilii:;i,Hfits.ANSA2
to 1 to enabre them as Input pins
llll,",,,r,,re TRrSAbits.RA2 and rRrSAbits.RA3
as Analog Pins
i.S. tni,i.lire ANSELC to 0 to disable them
as UART1(Tx& Rx)
5.7. lnitialize TRlscbits.RC6 and
rRlscbits.Rit ,o t fo enable them
Pins
5.8. Function callfor UART1
5.9. Function call for ADC
5.10. Function call for TIMERO

5.11. while (1)


{
if(a==3)
then
Select Analog Pin RA2
a=2
flag = g

28
end if
else if(a==2)
then
Select Analog Pin RA3
a=J
flag = t
end else if
call delaY$
if(timer flag is set)
then
set Analog flag as 0
if(flag is 0)
then
|f(ADRESH is 0)
then )
forfi=g to i<=l)
call delaYfl 'r
send echoffl to TX1
call delaY0
end of for looP
send enter to TX1

send initializeliJ to TXl


call delaY0
end of for looP
send enter to TX1
call delaY$
forfi=g to i<=71
call delaY$
send msg-start[il to TX1
call delaY()
end of for loop
send coma to TX1
call delaY0
for(j=g to i<=Izl
call delaYfl
. send numUl
to tXr
call delaY0
end of for looP
send coma to TX1
call delaY$
send enter to TX1
call delaY$

29
for(j=g to j<=221-
call delaY0
send msgl[jl to TX1
call delaYfl
end of for looP
send terminate to TXt
call delay$
end if
end if
if(flag is 1)
then
if(ADRESH is 0)
then
forfi=g to j<=31
call delay0
send echoffl to TX1
call delayfl
end of for looP
send enter to TX1
forfi=g to j<=91
call delaY$
send initializeUJ toTXl
call delaYfl
end of for looP
send enter to TX1
call delaYfl
for(j=g to j<=71
call delay0
send msg-start[j] to TX1
call delaY$
end of for looP
send coma to TX1
call delayfl
forfi=g to j<= I2l
call delay$
send numUl to TX1
call delay$
end of for looP
send coma to TX1
call delayfl
send enter to TX1
call delaY$
for(j=g to j<=221
call delayfl

30
send msg2[J to TX1
call delay$
end of for looP
send terminate to TX1
call delaY$
end if
end if
Set TIMER0 flag to 0
end if
Analoe GObits to 1

31
CHAPTER 5: CONCLUSION
controlled
accessible' auto-configurable' remotely
ln this project low cost, secirre, ubiquitously in the proiect is
been introduced' The approach discussed
solution for automation of homes has sMS-based system
home appliances remotely using the
novel and has the target to control proved to be
technology capable solution has
satisfying user needs and requirements.GsM to the previously
and is cost-effective as compared
controiled remotery, provide home security level of home
methods of home security' The basic
existing systems, which are traditional is extensible and
has been implemented' The system
appliance control and remote monitoring so that solution
using LGP gas deteCtOrS' smoke detector
more levels can be further developed the
with the send other detection systems' Hence we can conclude that
can be integrated using an
goals and objectives of our project have is to safeguard our home appliances
required
automated system.

32
CHAPTER FUTURE SCOPE

of our prolec uerrrrs below:


zlrE defined
ject are
future scope
Some of the
the
t t:T:::^:lace: The system can control
the devices from
o contro'ing or accessing
we can control
area or *" forgot to switctr the fan off than
intrusionfromanyremoteareasuchaswhenabuzzergivesana|armwecancontro|the
*rr"n"rJ,
buzzer from a remote

can be implemented
for easv customization'
o :ffi.T*:ttn,"n..", A keypad and a LCD at the LcD'
il ;;Jit;"rbv the users bv looking
.r"
rhe GSM stM number registered

33
REFERENCES:

L. MicrochipPlCl8(L)F2X l4XK22 Data Sheet'


2. htt p:l /Wikiped ial microchip.com'
3. http :/ /microchip.com/support'
4. www. microch ip'cofn.
5. http :l lwww.Youtube.com

34

You might also like