Professional Documents
Culture Documents
A
Project Report
Submitted
in partial fulfillment
for the award of the Degree of
Bachelor of Technology
in Electronics & Communication Engineering.
Supervisor
Submitted By:
This is to certify that the work, which is being presented in the project entitled GSM
BASED HOME SECURITY SYSTEM submitted by Mr. Ramraj Meena, Somendra,
Surendra Singh, Nemi Chand Jat, students of final year B.Tech. in Electronics &
Communication engineering as a partial fulfillment for the award of degree of Bachelor of
Technology is a record of students work carried out under named guidance and supervision.
This work has not been submitted elsewhere for the award of any other degree.
Date:
Place: S.G.I, Sikar, Rajasthan
(ii)
Mr.Devendra Singh
(HOD, ECE)
Candidates Declaration
We hereby declare that the work, which is being presented in the Project, entitled GSM
BASED HOME SECURITY SYSTEM in partial fulfillment for the award of Degree of
Bachelor of Technology in Electronics & Communication Engineering and submitted to
the Department of Electronics & Communication Engineering, Sobhasaria Group of
Institutions, Sikar, Rajasthan under Rajasthan Technical University is a record of my own
investigations carried under the Guidance of Ms.Neelu Pareek, Department of Electronics &
Communication Engineering, Sobhasaria Group of Institutions.
I have not submitted the matter presented in this Project anywhere for the award of any other
Degree.
Name of Supervisor
Ms. Neelu Pareek
(iii)
Acknowledgement
We wish to express our deep sense of gratitude to our Project Guide Ms.Neelu Pareek(Asst.
Prof.of ECE Dept.) Sobhasaria Group of Institutions, Sikar for guiding from the inception till
the completion of the project. We sincerely acknowledge for giving his/her valuable
guidance, critical reviews and comments for giving the final shape of the Project.
Words are inadequate in offering our thanks to Mr. P.R. Agarwala (Chairman), Sh. H.N.
Purohit (Member Secretary), Dr..B.Dhanasekaran (Principal), Prof. S.C. Mahajan (Dean,
ECE), Mr. Devendra Singh (H.O.D., ECE) and Mr. Indranil Sarkar (Project Incharge) of
Sobhasaria Group of Institutions, Sikar 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
successful completion 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.
Somendra (09ESOECM30P112)
(iv)
TABLE OF CONTENTS
Page No.
Cover Page
(i)
Certificate
(ii)
Candidates declaration
(iii)
Acknowledgement
(iv)
Table of contents
(v-vii)
Abstract
1
INTRODUCTION
Chapter 1
1.1
Introduction
1.2
General description
GENERAL ARCHITECTURE
Chapter 2
2.1
Architecture
2.2
2.2.1
AT89S52 Microcontroller
2.2.2
LCD Display
2.2.3
IR Sensor
2.2.4
GSM Module
PROJECT COMPONENTS
Chapter 3
3.1
3.2
AT89S52 Microcontroller
(v)
3.2.1
Features
3.2.2
Description
3.2.3
Pin Diagram
3.2.4
Pin Description
10
3.2.5
12
3.2.6
13
3.2.7
Memory Architecture
14
3.2.8
Addressing Modes
16
3.2.9
17
3.3
Voltage Regulator
18
3.4
Electrolytic Capacitor
19
3.5
20
3.6
21
3.7
Infrared Sensors
22
3.7.1
23
3.7.2
25
GSM Module
29
3.8
Chapter 4
PROJECT DETAILS
34
4.1
Block diagram
34
4.2
35
4.3
37
4.4
Application
37
(vi)
Chapter 5
5.1
Chapter 6
39
39
40
REFERENCES
41
42
Appendix B CODING
43
(vii)
ABSTRACT
The final year project aims at exposing the students undergoing higher technical studies to the
thoughts and logic that must be developed to ensure that one is able to integrate his/her ideas
into something concrete. This generally is initiated by the inception of an idea or a concept,
which not only aims at developing a product (Hardware or Software), but also the in-depth
study of the earlier existing products in the same category and their deficiencies. Accordingly
an approach is taken to propose a solution, which is better from the previous ones in one
respect or the other. With the same approach in mind, we, the final year students of
Bachelor of Technology (Electronics and Telecommunication), have taken up the Advance
GSM Based Home Security System As our final year project. Automated security systems are
a useful addition to todays home where safety is an important issue. Vision-based security
systems have the advantage of being easy to set up, inexpensive and non-obtrusive. Home
security system for detecting an intrusion into a monitored area by an infrared detector. A
security system has a free-standing intrusion detector. The free standing intrusion detector
has a transmitter coupled with a portable receiver to alert a homeowner that an intrusion has
taken place or occurred within a pre-set time period.
Chapter - 1
INTRODUCTION
1.1 Introduction
In todays 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 (indoor sand 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 IR
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. In section II, the integrated architecture of the system
is further elaborated. Finally, section will give the conclusion and future directions
2
Chapter 2
GENERAL ARCHITECTURE
2.1 Architecture
The proposed general architecture incorporates subsystems IR sensors, burglar alarm module
and fire alarm module, into a single automated architecture for practical implementation in
intelligent home environments. The figure shows a simple architecture diagram of the
proposed system and its setup and connectivity. The modules work independently and
parallel but share computational resources.
AT89S52 Microcontroller
LCD Display
IR Sensor
GSM Module
lightweight, portable, less expensive, more reliable, and easier on the eyes. They are available
in a wider range of screen sizes than CRT and plasma displays, and since they do not use
phosphors, they cannot suffer image burn-in. LCDs are more energy efficient and offer safer
disposal than CRTs. Its low electrical power consumption enables it to be used in batterypowered electronic equipment.
2.2.3 IR Sensor
The basic principle of IR sensor is based on an IR emitter and an IR receiver. IR emitter will
emit infrared continuously when power is supplied to it. On the other hand, the IR receiver
will be connected and perform the task of a voltage divider. IR receiver can be imagined as a
transistor with its base current determined by the intensity of IR light received. The lower the
intensity of IR light cause higher resistance between collector-emitter terminals of transistor,
and limiting current from collector to emitter. This change of resistance will further change
the voltage at the output of voltage divider. In others word, the greater the intensity of IR
light hitting IR receiver, the lower the resistance of IR receiver and hence the output voltage
of voltage divider will decreased. Usually the IR emitter and IR receiver will be mounted side
by side, pointing to a reflective surface. The further distance away between emitter and
receiver decrease the amount of infrared light hitting the receiver if the distance between the
sensor and a reflective surface is fixed.
2.2.4 GSM Module
GSM (Global System for Mobile) / GPRS (General Packet Radio Service) TTL Modem is
SIM900 Quad-band GSM / GPRS device, works on frequencies 850 MHZ, 900 MHZ, 1800
MHZ and 1900 MHZ. It is very compact in size and easy to use as plug in GSM Modem. The
Modem is designed with 3V3 and 5V DC TTL interfacing circuitry, which allows User to
directly interface with 5V Microcontrollers (PIC, AVR, Arduino, 8051, etc.) as well as 3V3
Microcontrollers (ARM, ARM Cortex XX, etc.). The baud rate can be configurable from
9600-115200 bps through AT (Attention) commands. This GSM/GPRS TTL Modem has
internal TCP/IP stack to enable User to connect with internet through GPRS feature. It is
suitable for SMS as well as DATA transfer application in mobile phone to mobile phone
interface. The modem can be interfaced with a Microcontroller using USART (Universal
Synchronous Asynchronous Receiver and Transmitter) feature (serial communication).
6
Chapter 3
PROJECT COMPONENTS
3.1 Printed Circuit Board (PCB)
It is used to mechanically support and electrically connect Electrical components using
conductive pathways, tracks or signal traces etched from copper sheets laminated onto a nonconductive substrate It is also referred to as printed-wiring board (PWB) or etched wiring
board A PCB populated with electronic-components is a printed circuit assembly (PCA), also
known as a printed circuit-board assembly(PCBA). Printed circuit boards are used in virtually
all but the simplest commercially-produced electronic devices. PCBs are inexpensive, and
can be highly reliable. They require much more layout effort and higher initial cost than
either wire wrap or point-to-point construction, but are much cheaper and faster for highvolume production; the production and soldering of PCBs can be done by totally automated
equipment. Much of the electronics-industry's PCB design, assembly, and quality control
needs are set by standards that are published by the IPC organization
3.2 AT89S52 Microcontroller
3.2.1 Features
Compatible with MCS-51Products
8K Bytes of In-System Programmable (ISP) Flash Memory
4.0V to 5.5V Operating Range
Fully Static Operation: 0 Hz to 33 MHz
Three-level Program Memory Lock
256 x 8-bit Internal RAM
32 Programmable I/O Lines
Three 16-bit Timer/Counters
Eight Interrupt Sources
Port 0: - Port 0 is an 8-bit open drain bidirectional I/O port. As an output port, each pin can
sink eight TTL inputs. When 1s are written to port 0 pins, the pins can be used as high
impedance inputs.
Port 0 can also be configured to be the multiplexed low-order address/data bus during
accesses to external program and data memory. In this mode, P0 has internal pull-ups. Port 0
also receives the code bytes during Flash programming and outputs the code bytes during
program verification. External pull-ups are required during program verification.
Port 1: - Port 1 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 1 output
buffers can sink/source four TTL inputs. When 1s are written to Port 1 pins, they are pulled
high by the internal pull-ups and can be used as inputs. As inputs, Port 1 pins that are
externally being pulled low will source current (IIL) because of the internal pull-ups. In
addition, P1.0 and P1.1 can be configured to be the timer/counter 2 external count input
(P1.0/T2) and the timer/counter 2 trigger input (P1.1/T2EX), respectively.
P1.0 T2 (external count input to Timer/Counter 2), clock-out.
P1.1 T2EX (Timer/Counter 2 capture/reload trigger and direction control)
P1.5 MOSI (used for In-System Programming).
P1.6 MISO (used for In-System Programming).
P1.7 SCK (used for In-System Programming).
Port 2: - Port 2 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 2 output
buffers can sink/source four TTL inputs. When 1s are written to Port 2 pins, they are pulled
high by the internal pull-ups and can be used as inputs. As inputs, Port 2 pins that are
externally being pulled low will source current (IIL) because of the internal pull-ups.
Port 2 emits the high-order address byte during fetches from external program memory and
during accesses to external data memory that uses 16-bit addresses (MOVX @ DPTR). In
this application, Port 2 uses strong internal pull-ups when emitting 1s. During accesses to
external data memory that uses 8-bit addresses (MOVX @ RI), Port 2 emits the contents of
the P2 Special Function Register. Port 2 also receives the high-order address bits and some
control signals during Flash Programming and verification.
11
Port 3: - Port 3 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 3 output
buffers can sink/source four TTL inputs. When 1s are written to Port 3 pins, they are pulled
high by the internal pull-ups and can be used as inputs. As inputs, Port 3 pins that are
externally being pulled low will source current (IIL) because of the pull-ups.
P3.0 RXD (serial input port)
P3.1 TXD (serial output port)
P3.2 INT0 (external interrupt 0)
P3.3 INT1 (external interrupt 1)
P3.4 T0 (timer 0 external input)
P3.5 T1 (timer 1 external input)
P3.6 WR (external data memory write strobe)
P3.7 RD (external data memory read strobe)
3.2.5 Input and Output Ports (I/O Ports)
All 8051 microcontrollers have 4 I/O ports each comprising 8 bits which can be configured as
inputs or outputs. Accordingly, in total of 32 input/output pins enabling the microcontroller to
be connected to peripheral devices are available for use. Pin configuration, i.e. whether it is to
be configured as an input (1) or an output (0), depends on its logic state. In order to configure
a microcontroller pin as an input, it is necessary to apply logic zero (0) to appropriate I/O port
bit. In this case, voltage level on appropriate pin will be 0.Similarly, in order to configure a
microcontroller pin as an input, it is necessary to apply a logic one (1) to appropriate port. In
this case, voltage level on appropriate pin will be 5V (as is the case with any TTL input). This
may seem confusing but don't lose your patience. It all becomes clear after studying simple
electronic circuits connected to an I/O pin.
Port 0: - The P0 port is characterized by two functions. If external memory is used then the
lower address byte (addresses A0-A7) is applied on it. Otherwise, all bits of this port are
configured as inputs/outputs. The other function is expressed when it is configure das an
output. Unlike other ports consisting of pins with built-in pull-up resistor connected by its
12
end to +5V power supply, pins of this port have this resistor left out. This apparently small
difference has its consequences. If any pin of this port is configured as an input then it acts as
if it floats. Such an input has unlimited input resistance and undetermined potential. When
the pin is configured as an output, it acts as an open drain. By applying logic 0to a port bit,
the appropriate pin will be connected to ground (0V). By applying logic 1, the external output
will keep on floating. In order to apply logic 1 (5V) on this output pin, it is necessary to
built in an external pull-up resistor.
Port 1: - P1 is a true I/O port, because it doesn't have any alternative functions as is the case
with P0, but can be configured as general I/O only. It has a pull-up resistor built-in and is
completely compatible with TTL circuits.
Port 2: - P2 acts similarly to P0 when external memory is used. Pins of this port occupy
addresses intended for external memory chip. This time it is about the higher address byte
with addresses A8-A15. When no memory is added, this port can be used as a general
input/output port showing features similar to P1.
Port 3: - All port pins can be used as general I/O, but they also have an alternative function.
In order to use these alternative functions, a logic one (1) must be applied to appropriate bit
of the P3 register. In terms of hardware, this port is similar to P0, with the difference that its
pins have a pull-up resistor built-in.
3.2.6 Internal Block Diagram of 8051 Microcontroller
This microcontroller is also called as System on a chip because it has all the features on a
single chip. The AT89S52 is a low-power, high-performance CMOS 8-bit microcontroller
with 8K bytes of in-system programmable Flash memory. The device is manufactured using
Atmels high-density nonvolatile memory technology and is compatible with the industry
standard 80C51 instruction set and pin out. The on-chip Flash allows the program memory to
be reprogrammed in-system or by a conventional nonvolatile memory programmer.
13
14
Program Memory: -The first models of the 8051 microcontroller family did not have
internal program memory. It was added as an external separate chip. These models are
recognizable by their label beginning with 803 (for example 8031 or 8032). All later models
have a few Kbyte ROM embedded. Even though such an amount of memory is sufficient
for writing most of the programs, there are situations when it is necessary to use additional
memory as well. A typical example is so called lookup tables. They are used in cases when
equations describing some processes are too complicated or when there is no time for solving
them. In such cases all necessary estimates and approximates are executed in advance and the
final results are put in the tables.
Data Memory: - As already mentioned, Data Memory is used for temporarily storing data
and intermediate results created and used during the operation of the microcontroller.
Besides, RAM memory built in the 8051 family includes many registers such as hardware
counters and timers, input/output ports, serial data buffers etc. The previous models had 256
RAM locations, while for the later models this number was incremented by additional 128
registers. However, the first 256 memory locations (addresses 0-FFh) are the heart of
memory common to all the models belonging to the8051 family. Locations available to the
user occupy memory space with addresses 0-7Fh, i.e. first 128 registers. This part of RAM is
divided in several blocks .The first block consists of 4 banks each including 8 registers
denoted by R0-R7. Prior to accessing any of these registers, it is necessary to select the bank
containing it. The next memory block (address 20h-2Fh) is bit- addressable, which means
that each bit has its own address (0-7Fh). Since there are 16 such registers, this block contains
in total of 128 bits with separate addresses (address of bit 0 of the 20h byte is 0, while address
of bit 7 of the 2Fh byte is 7Fh). The third group of registers occupies addresses2Fh-7Fh, i.e.
80 locations, and does not have any special functions or features.
Additional RAM: - In order to satisfy the programmers constant hunger for Data Memory,
the manufacturers decided to embed an additional memory block of 128 locations into the
latest versions of the 8051 microcontrollers. However, its not as simple as it seems to be.
The problem is that electronics performing addressing has 1 byte (8 bits) on disposal and is
capable of reaching only the first 256 locations.
15
Direct Addressing
On direct addressing, the address of memory location containing data to be read is specified
in instruction. The address may contain a number being changed during operation (variable).
For example: Since the address is only one byte in size (the largest number is 255), only the
first 255locations of RAM can be accessed this way. The first half of RAM is available for
use, while another half is reserved for SFRs.
16
MOV A, 33h;
Means: move a number from address 33 hexadecimal to accumulator
Indirect Addressing
On indirect addressing, a register containing the address of another register is specified in
instruction. Data to be used in the program is stored in the letter register. For example:
Indirect addressing is only used for accessing RAM locations available for use (never for
accessing SFRs). This is the only way of accessing all the latest versions of the
microcontrollers with additional memory block (128 locations of RAM). Simply put, when
the program encounters instruction including @ sign and if the specified address is higher
than 128 (7F hex.), the processor knows that indirect addressing is used and skips memory
space reserved for SFRs
MOV A, @R0;
Means: Store the value from the register whose address is in theR0 register into accumulator.
On indirect addressing, registers R0, R1 or Stack Pointer are used for specifying 8 bit
addresses. Since only 8 bits are available, it is possible to access only registers of internal
RAM this way (128 locations when speaking of previous models or 256locations when
speaking of latest models of microcontrollers). If an extra memory chip is added then the 16bit DPTR Register (consisting of the registers DPTRL and DPTRH) is used for specifying
address. In this way it is possible to access any location in the range of 64K.
3.2.9 Special Function Registers (SFRs)
Special Function Registers (SFRs) are a sort of control table used for running and monitoring
the operation of the microcontroller. Each of these registers as well as each bit they include,
has its name, address in the scope of RAM and precisely defined purpose such as timer
control, interrupt control, serial communication control etc. Even though there are 128
memory locations intended to be occupied by them, the basic core, shared by all types of
8051 microcontrollers, has only 21 such registers. Rest of locations are intentionally left
unoccupied in order to enable the manufacturers to further develop microcontrollers keeping
them compatible with the previous versions. It also enables programs written a long time ago
for microcontrollers which are out of production now to be used today.
17
A Register (Accumulator)
A register is a general-purpose register used for storing intermediate results obtained during
operation. Prior to executing an instruction upon any number or operand it is necessary to
store it in the accumulator first all results obtained from arithmetical operations performed by
the ALU are stored in the accumulator. Data to be moved from one register to another must
go through the accumulator. In other words, the A register is the most commonly used
register and it is impossible to imagine a microcontroller without it. More than half
instructions used by the 8051 microcontroller use somehow the accumulator.
B Register
Multiplication and division can be performed only upon numbers stored in the A and B
registers. All other instructions in the program can use this register as a spare accumulator .
3.3 Voltage Regulator
A Voltage Regulator is an electrical regulator designed to automatically maintain a constant
voltage level. A voltage regulator may be a simple "feed-forward" design or may include
negative feedback control loops. It may use an electro-mechanical mechanism, or electronic
components. Depending on the design, it may be used to regulate one or more AC or DC
voltages. Electronic voltage regulators are found in devices such as computer power supplies
where they stabilize the DC voltages used by the processor and other elements.
A basic voltage regulator LM7805 has three legs, converts varying input voltage
and produces a constant regulated output voltage. The most common part numbers start with
the numbers 78 or 79 and finish with two digits indicating the output voltage. The number 78
represents positive voltage and 79 negative one.
18
19
These two plates are used to store charge between them. One is connected with positive
voltage and other one with negative voltage. A capacitor is characterized by the parameter
capacitance. Capacitance is measured as ratio of difference of charges between the plates and
total voltage drop between the plates.
C = dQ/dV
The unit of capacitance is FARAD.
Figure-3.4 Capacitors
20
Figure-3.5 LCD
21
differences in infrared energy because they are primarily sensitive to visible light energy
from 400 to 700 nm. Our eyes are not sensitive to the infrared energy.
2. Stephan Boltzmann Law
The total energy emitted at all wavelengths by a black body is related to the absolute
temperature as
1. Infrared Source
All objects above 0 K radiate infrared energy and hence are infrared sources. Infrared sources
also include blackbody radiators, tungsten lamps, silicon carbide, and various others. For
active IR sensors, infrared Lasers and LEDs of specific IR wavelengths are used as IR
sources.
2. Transmission Medium
Three main types of transmission medium used for Infrared transmission are vacuum, the
atmosphere, and optical fibers. The transmission of IR radiation is affected by presence of
CO2, water vapor and other elements in the atmosphere. Due to absorption by molecules of
water carbon dioxide, ozone, etc. the atmosphere highly attenuates most IR wavelengths
leaving some important IR windows in the electromagnetic spectrum; these are primarily
utilized by thermal imaging, remote sensing applications.
Medium wave IR (MWIR: 3-5 m)
Long wave IR (LWIR: 8-14 m)
3. Optical Components.
Often optical components are required to converge or focus infrared radiations, to limit
spectral response, etc. To converge/focus radiations, optical lenses made of quartz, CaF2, Ge
and Si, polyethylene Fresnel lenses, and mirrors made of Al, Au or a similar material are
used. For limiting spectral responses, band pass filters are used. Choppers are used to pass/
interrupt the IR beams.
4. Infrared detectors.
Various types of detectors are used in IR sensors. Important specifications of detectors are
Photosensitivity or Responsivity
Responsivity is the Output Voltage/Current per watt of incident energy, Higher the better.
Noise Equivalent Power (NEP)
24
NEP represents detection ability of a detector and is the amount of incident light equal to
intrinsic noise level of a detector. In addition, wavelength region or temperature to be
measured, response time, cooling mechanism, active area, no of elements, package, linearity,
stability, temperature characteristics, etc. are important parameters which need attention
while selecting IR detectors.
5. Signal Processing
Since detector outputs are typically very small, preamplifiers with associated circuitry are
used to further process the received signals.
3.7.2 Types of Infrared Sensors
1. Active Infrared Sensors
Active infrared sensors employ both infrared source and infrared detectors. They operate by
transmitting energy from either a light emitting diode (LED) or a laser diode. A LED is used
for a non-imaging active IR detector, and a laser diode is used for an imaging active IR
detector. In this types of IR sensors, the LED or laser diode illuminates the target, and the
reflected energy is focused onto a detector. Photoelectric cells, Photodiode or phototransistors
are generally used as detectors. The measured data is then processed using various signalprocessing algorithms to extract the desired information.
Active IR detectors provide count, presence, speed, and occupancy data in both night and day
operation. The laser diode type can also be used for target classification because it provides
target profile and shape data. These sensors are used as reflective opto-sensors. Reflective
opto-sensors are either intensity based or use modulated IR. Intensity based sensors are
affected by ambient light. Modulated Infrared sensors wherein emitter is turned ON and OFF
rapidly, are less susceptible to ambient light. Reflective opto-sensors are used in two
configurations.
Break Beam Sensors
This type of sensors consists of a pair of light emitting and light detecting elements. Infrared
source transmits a beam of light towards a remote IR receiver creating an electronic fence.
Once a beam is broken/ interrupted due to some opaque object, output of detector changes
25
and associated electronic circuitry takes appropriate actions. Typical applications of such
sensors are intrusion detection, shaft encoder (for measurement of rotation angle/rate of
rotation)
detect presence, occupancy, and count. Passive Infrared Sensors are of two types: Thermal &
Quantum. Thermal type sensors have no wavelength dependence. They use the infrared
energy as heat and their photosensitivity is independent of wavelength. Thermal detectors
dont require cooling but have disadvantages that response time is slow & detection time is
low. Common types of thermal type IR detectors are
Thermocouple-Thermopile
A detector that converts temperature into an electrical signal is commonly known as a
thermocouple. The junction of dissimilar metals generates a voltage potential, which is
directly proportional to the temperature. This junction can be made into multiple junctions to
improve sensitivity. Such a configuration is called a thermopile.
The active or Hot junctions are blackened to efficiently absorb radiation. The reference or
Cold junctions are maintained at the ambient temperature of the detector. The absorption of
radiation by the blackened area causes a rise in temperature in the hot junctions as
compared to the cold junctions of the thermopile. This difference in temperature across the
thermocouple junction causes the detector to generate a positive voltage. If the active or hot
junction were to cool to a temperature less than the reference or cold junction the voltage
output would be negative. These detectors has a relatively slow response time, but offers the
advantages of DC stability, requiring no bias, and responding to all wavelengths.
Bolometer
A bolometer is a simple thermal or total power detector. A bolometer changes resistance
when incident infrared radiation interacts with the detector. This thermally sensitive
semiconductor is made of a sintered metal oxide material. It has a high temperature
coefficient of resistanceIt essentially consists of two main elements: a sensitive thermometer
and an absorptive element and a heat sink. Absorber is connected by a weak thermal link to a
heat sink (at temperature T0). Incoming energy increases the temperature of the absorptive
element above that of a heat sink and rise in temperature is measured by a thermometer.
Delta T = T - T0 = E/C
Bolometer use metals or semiconductor/superconductors as absorptive elements.
27
Pyroelectric detector
Pyroelectric detectors use PZT having pyroelectic effect, a high resistor and a low noise FET,
hermetically sealed in a package. Pyroelectric materials are crystals, such as lithium tantalate,
which exhibit spontaneous polarization, or a concentrated electric charge that is temperature
dependent. PZT is spontaneously polarized in dark state. As infrared radiation strikes the
detector surface, the change in temperature causes a current to flow. This results in change of
polarization state which is reflected in terms of voltage change at the output.
This detector exhibits good sensitivity and good response to a wide range of wavelengths,
and does not require cooling of the detector. It is the most commonly used detector for gas
monitors.
Quantum type offer higher detection performance and a faster response speed although their
photosensitivity is wavelength dependant. Quantum type detectors require cooling for
accurate measurements (except for those in near IR region).Quantum type detectors are
further classified into two categories
Intrinsic type
i. Photoconductive
Photoconductive type of IR detectors makes use of photoconductive effect. This effect causes
change in resistance when IR radiation falls upon detecting elements.
Examples are PbS, PbSe, MCT (HgCdTe) Band gap of PbS, PbSe have negative temperature
coefficient and hence their spectral response characteristics shift to long wavelength region
when cooled. However, band gap of HgCdTe depends upon the composition and therefore,
spectral response characteristics can be tailored to suit the requirements.
ii. Photovoltaic
Photoconductive type of IR detectors makes use of photovoltaic effect. Incident IR light
cause increase in voltage output of these detectors.
Examples are InGaAs PIN photodiodes, InAs, InSb
28
Extrinsic type
Various types of detectors like Ge:Au, Ge:Hg, Ge:Cu, Ge:Zn, Si:Ga, Si:As and are used
depending upon the requirements of the application- spectral response, D*, etc.
3.8 GSM Module
GSM (Global System for Mobile) / GPRS (General Packet Radio Service) TTL Modem is
SIM900 Quad-band GSM / GPRS device, works on frequencies 850 MHZ, 900 MHZ, 1800
MHZ and 1900 MHZ. It is very compact in size and easy to use as plug in GSM Modem. The
Modem is designed with 3V3 and 5V DC TTL interfacing circuitry, which allows User to
directly interface with 5V Microcontrollers (PIC, AVR, Arduino, 8051, etc.) as well as 3V3
Microcontrollers (ARM, ARM Cortex XX, etc.). The baud rate can be configurable from
9600-115200 bps through AT (Attention) commands. This GSM/GPRS TTL Modem has
internal TCP/IP stack to enable User to connect with internet through GPRS feature. It is
suitable for SMS as well as DATA transfer application in mobile phone to mobile phone
interface. The modem can be interfaced with a Microcontroller using USART (Universal
Synchronous Asynchronous Receiver and Transmitter) feature (serial communication).
Features
Inbuilt Powerful TCP / IP (Transfer Control Protocol / Internet Protocol) stack for
29
Hardware Description
almost all the space requirements in Users applications, such as M2M, smart phone, PDA
and other mobile devices.
Figure-3.8.2 MAX232 IC
31
GSM Antenna
Using a suitable antenna can greatly improve your chances of success when trying to detect
weak radio signals. Unfortunately the range of suitable antennas for the GSM bands is very
limited
and/or
very
expensive.
Having
previously
experimented
with building
homemade/DIY wireless (Wi-Fi) antennas, I felt doing the same for a GSM antenna shouldn't
be a problem.
Frequency Range
The antenna needs to cover the full Standard and Extended GSM-900 bands, (880 MHz To
960 MHz). The GSM-1800 bands would be nice but it's optional, I can design another
antenna for those bands.
Size
The antenna needs to be small and compact; the goal would be to have something that could
easily fit inside a laptop bag.
Gain
The antenna should have a reasonable amount of gain; I was hoping for something about 8
dB
Build
The antenna should be easy to build and require tools and materials that are easy and cheap to
acquire. A little bit of maths- An important measurement in radio is the distance between the
same points on two consecutive wave cycles, this distance is known as the wavelength and is
denoted with the symbol (lambda).
To calculate the wave length of a radio signal we take the Speed of Light in a Vacuum and
divide it by the frequency in Hertz (the number of full wave cycles per second).Wavelength
() = Speed of Light / Frequency The center frequency for my antenna design is 920 MHz so
the wavelength is: Wavelength () = 299792458 / 920000000 = ~0.325861367 = ~0.326
meters.
32
33
Chapter 4
PROJECT DETAILS
4.1 Block diagram
34
IR Transmitter
In general, the basic building block of any IR transmitter is modulation of the information
signal with carrier signal, because the receiver modules which are available off-the-shelf are
made for a particular carrier frequency. So it is clear that when you chose a particular IR
receiver module, you also need to transmit the modulated wave with the same carrier
frequency of that of an IR receiver module.
IR Receiver
It is quite simple to construct an IR receiver with readily available off-the-shelf modules.
These modules are nothing but the IC packages, referred as TSOP (Thin small-outline
package). In this document, the receiver is designed for 38 kHz carrier signal; hence the IC
selected should work for the same frequency. The IC TSOP4838 will serve as a receiver
module, which is compatible with both TTL and CMOS logic. This means that we can
directly get digital signal from the receiver module and then connect it to the microcontroller.
Once the transmitter and receiver is complete, both should be placed at a certain angle, so that
the obstacle detection happens in a proper way. This angle is nothing but the directivity of the
sensor, which is generally +/- 45 degrees.
36
37
It has 8 security region codes and 1 fire/ smoke code to distinguish. We can choose some
certain regions to arm or disarm.
Emergency Reporting
Under emergency situation, the house member can press SOS key on the RF remote or on
wireless Door/ Window sensor. Home-Guard also uses GSM network to report to 5 prestored numbers: short message for control center, short message for 3 pre-stored mobile
phone, and 1 voice call for monitoring or talking. phone.
Arm/Disarm By SMS
In addition to use the RF Remote, the system allows the users to arm and disarm the alarm
system via SMS message from mobile phone. Users can also check the alarm status anytime
by simply sending an inquiry SMS message to the main unit.
Power Failure Reporting
When the main power gets cut off, Home-Guard can report to the preset phone numbers
immediately.
38
Chapter 5
This system has many advantages such as remote controlling of home appliances,
availability and ease of users. The user can get alerts anywhere through the GSM
technology thus making the system location independent. The system contains low cost
components easily available which cuts down the overall system cost.
GSM technology provides the benefit that the system is accessible in remote areas as
well.
The system reliability increases due to the useful features such as battery level checking,
charging status and signal strength indicating the system about threats.
The system integration is simple and is also scalable and extensible. However, the system
functionality is based on GSM technology so the techno-logical constraints must be kept
in mind.
39
Chapter 6
40
REFERENCES
To refer a research paper- S.Am Yoon, H.Su Jeoung, Y.Sun Yoon and I.Cha," The Study
on the Characteristic of Charge and Discharge of Security Alarm System Battery with PIC",
Proceeding of IEEE Int. Conference on Industrial Electronics, vol.1, Chohla, Puebla, Mexico,
2000, pp. 48-51.
To refer a research paper - K. C. Lee "Network-based fire-detection system via controller
area network for smart home automation", IEEE Trans. Consumer Electron., vol. 50, no.
4, pp.1093 -1100 2004.
To refer a book - Mazidi, The 8051 Microcontroller and Embedded Systems Using
Assembly and C, 2/E, ISBN 8131710262, Pearson Education India, 2007.
41
LIST OF FIGURES
Figure No.
Page No.
14
16
19
Figure-3.4 Capacitor
20
Figure-3.5 LCD
21
21
22
23
26
26
30
31
Figure-3.8.2 MAX232 IC
31
33
34
35
Figure-4.2.2 IR Directivity
36
42
CODING
1.Code to Detect Obstacle using IR (Infrared) Sensor
#include "E:\WinAVR-20080512\avr\include\avr\io.h"
/* function prototype */
void millisecond_delay(unsigned int count);
int main()
{
unsigned int i = 0;
unsigned int r_count = 0;
/* Initialize timer (wave generation OCR2 )*/
OCR2 = 119;
TCCR2 = 0x19;
/* Initialize LED */
DDRB = DDRB & 0x01;
/* Initialize IR receiver */
DDRD = DDRD & 0xFB;
/* Continuos Loop */
while(1)
{
/* Activate OCR2 wave generation for 10 milliseconds */
DDRD = DDRD | 0x80;
for (i = 0; i <10 ; i++)
{
/* Delay one millisecond */
millisecond_delay(1);
if (((PIND >> 2) & 0x01) == 0)
{
/* increment counter when a signal is received from the IR receiver
module */
r_count++;}}
43
44
void init_serial()
{
TMOD=0x20;
TH1=0xfd;
SCON=0x50;
TR1=1;
void delay(unsigned int msec)
{
int i,j;
for(i=0;i<msec;i++)
for(j=0; j<1275; j++);
45
46
47
48
}
case 0x0d:
{
return 0x01;
break ;
}
default :return 0x02 ;
}
}
void main()
{
lcd();
init_serial();
count=(-1);
delay(500);
lcd_data_string("Gas Alarm");
delay(10);
lcd_cmd(0x01);
IE=0x94;
transmit_data('AT');
delay(1);
49
transmit_data('AT+CMGS=1');
delay(1);
transmit_data("9829056738");
delay(50);
while(1)
{
if(count>=0)
{
check=byte_check();
if(check!=0x00)
{
if(check==0x01)
{
if(check_space==1)
{
lcd_data(0x20);
check_space=0;
}
}
else
{
lcd_data(str[0]);
50
check_space=1;
}
}
count--;
for(i=0;i<count;i++)
{
str[i]=str[i+1];
}
}
}
}
51