SlideShare a Scribd company logo
1 of 58
Download to read offline
GSM BASED HOME SECURITY SYSTEM
A
Project Report
Submitted
in partial fulfillment
for the award of the Degree of
Bachelor of Technology
in Electronics & Communication Engineering.
Supervisor Submitted By:
Ms. Neelu Pareek Ramraj Meena (09ESOECM30P100)
(Asst. Prof. of ECE Dept.) Somendra (09ESOECM30P112)
Surendra Singh (09ESOECM30P120)
NemiChand Jat (09ESOECM30P074)
Department of Electronics & Communication Engineering
Sobhasaria Group of Institutions
Rajasthan Technical University
2012-2013
(ii)
Department of Electronics & Communication Engineering
Certificate
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 student’s 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
Ms. Neelu Pareek Mr. Indranil Sarkar Mr.Devendra Singh
(Project Guide) (Project Incharge) (HOD, ECE)
(iii)
Candidate’s 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.
Ramraj Meena (09ESOECM30P100)
Somendra (09ESOECM30P112)
Surendra Singh (09ESOECM30P120)
NemiChand Jat (09ESOECM30P074)
Sobhasaria Group of Institutions, sikar.
Name of Supervisor
Ms. Neelu Pareek
(iv)
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.
Ramraj Meena (09ESOECM30P100)
Somendra (09ESOECM30P112)
Surendra Singh (09ESOECM30P120)
NemiChand Jat (09ESOECM30P074)
(v)
TABLE OF CONTENTS
Page No.
Cover Page (i)
Certificate (ii)
Candidate’s declaration (iii)
Acknowledgement (iv)
Table of contents (v-vii)
Abstract 1
Chapter 1 INTRODUCTION 2
1.1 Introduction 2
1.2 General description 3
Chapter 2 GENERAL ARCHITECTURE 4
2.1 Architecture 4
2.2 Overview of Components Used in Architecture 5
2.2.1 AT89S52 Microcontroller 5
2.2.2 LCD Display 5
2.2.3 IR Sensor 6
2.2.4 GSM Module 6
Chapter 3 PROJECT COMPONENTS 7
3.1 Printed Circuit Board (PCB) 7
3.2 AT89S52 Microcontroller 7
(vi)
3.2.1 Features 7
3.2.2 Description 8
3.2.3 Pin Diagram 9
3.2.4 Pin Description 10
3.2.5 Input and Output Ports (I/O Ports) 12
3.2.6 Internal Block Diagram of 8051 Microcontroller 13
3.2.7 Memory Architecture 14
3.2.8 Addressing Modes 16
3.2.9 Special Function Registers (SFRs) 17
3.3 Voltage Regulator 18
3.4 Electrolytic Capacitor 19
3.5 Liquid Crystal Display (LCD) 20
3.6 Light Emitting Diodes (LED’s) 21
3.7 Infrared Sensors 22
3.7.1 Elements of Infrared Detection System 23
3.7.2 Types of Infrared Sensors 25
3.8 GSM Module 29
Chapter 4 PROJECT DETAILS 34
4.1 Block diagram 34
4.2 Working of GSM Home Security System 35
4.3 Working of GSM Module 37
4.4 Application 37
(vii)
Chapter 5 CHARACTERISTICS & STRENGTHS 39
5.1 Characteristics & Strengths 39
Chapter 6 CONCLUSION AND FUTURE SCOPE 40
REFERENCES 41
Appendix A LIST OF FIGURES 42
Appendix B CODING 43
1
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 today‟s 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.
2
Chapter - 1
INTRODUCTION
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 (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
3
1.2. General Description
The project here is all about a Home security system, In this project we have planned to
develop a Home security system .Home security system for detecting an intrusion into a
monitored area by an infrared detector. A security system has a flee-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 .The area under surveillance is monitored by an infrared detector which activates
the transmitter upon the detection of abrupt differences in infrared radiation levels, associated
with the presence of a warm body in an otherwise equilibrated environment. A radio signal is
emitted by the transmitter which is received by the portable hand-held remote receiver. A
first signal, indicating that an intrusion has been detected less than a preselected period of
time in the past in the monitored areas, is displayed on the receiver for that preselected period
of time. After the preselected period of time has elapsed, a second signal is generated to
indicate that the intrusion took place at a time greater than the preselected period of time in
the past and that the probability of the intruder still being present is less. Once the intrusion
detector is activated, the signal is continuously transmitted to the portable receiver until the
intrusion detector has been-reset
A security system for a home comprising: A free standing intrusion detector to be set in an
area of said home to be protected, said-free standing intrusion detector comprising: An
intrusion detector to generate an intrusion signal in response to an intrusion into said area ;A
radio signaling transmitter responsive to said intrusion signal to transmit a radio-signal means
for modulating said radio signal for a predetermined time in response to said intrusion signal;
and time delay means for delaying the actuation of said intrusion detector to allow a person
sufficient time to exit said area to be protected after setting said intrusion detector; and a
portable receiver adapted to be hand carried comprising. Means for generating an output
signal in response to said radio signal. Display means for generating a visual display
indicating an intrusion has occurred in response to said output signal
4
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.
Figure-2.1 Simple Architecture of GSM home security system
5
2.2 Overview of Components Used in Architecture
 AT89S52 Microcontroller
 LCD Display
 IR Sensor
 GSM Module
2.2.1 AT89S52 Microcontroller
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 Atmel‟s 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.
By combining a versatile 8-bit CPU with in-system programmable Flash on a monolithic
chip, the Atmel AT89S52 is a powerful microcontroller which provides a highly-flexible and
cost-effective solution to many embedded control applications. The AT89S52 provides the
following standard features: 8K bytes of Flash, 256 bytes of RAM, 32 I/O lines, Watchdog
timer, two data pointers, three 16-bit timer/counters, a six-vector two-level interrupt
architecture, a full duplex serial port, on-chip oscillator, and clock circuitry. In addition, the
AT89S52 is designed with static logic for operation down to zero frequency and supports two
software selectable power saving modes. The Idle Mode stops the CPU while allowing the
RAM, timer/counters, serial port, and interrupt system to continue functioning. The Power-
down mode saves the RAM contents but freezes the oscillator, disabling all other chip
functions until the next interrupt or hardware reset.
2.2.2 LCD Display
A liquid crystal display (LCD) is a thin, flat electronic visual display that uses the light
modulating properties of liquid crystals (LCs). LCs do not emit light directly They are used in
a wide range of applications, including computer monitors, television, instrument panels,
aircraft cockpit displays, signage, etc. They are common in consumer devices such as video
players, gaming devices, clocks, watches, calculators, and telephones. LCDs have displaced
cathode ray tube (CRT) displays in most applications. They are usually more compact,
6
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 battery-
powered 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).
7
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 non-
conductive 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 high-
volume 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
8
• Full Duplex UART Serial Channel
• Low-power Idle and Power-down Modes
• Interrupt Recovery from Power-down Mode
• Watchdog Timer
• Dual Data Pointer
• Power-off Flag
• Fast Programming Time
• Flexible ISP Programming (Byte and Page Mode)
3.2.2 Description
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 Atmel‟s 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.
By combining a versatile 8-bit CPU with in-system programmable Flash on a monolithic
chip, the Atmel AT89S52 is a powerful microcontroller which provides a highly-flexible and
cost-effective solution to many embedded control applications. The AT89S52 provides the
following standard features: 8K bytes of Flash, 256 bytes of RAM, 32 I/O lines, Watchdog
timer, two data pointers, three 16-bit timer/counters, a six-vector two-level interrupt
architecture, a full duplex serial port, on-chip oscillator, and clock circuitry. In addition, the
AT89S52 is designed with static logic for operation down to zero frequency and supports two
software selectable power saving modes. The Idle Mode stops the CPU while allowing the
RAM, timer/counters, serial port, and interrupt system to continue functioning. The Power-
down mode saves the RAM contents but freezes the oscillator, disabling all other chip
functions until the next interrupt or hardware reset.
9
3.2.3 Pin Diagram
The 8051 microcontroller consists of 40 pins. These pins are well represented by the pin-
diagram below.
Figure- 3.2.3 Pin Diagram of 8052 Microcontroller
10
3.2.4 Pin Description
VCC: - +5V Power supply.
GND: - Ground.
RST (RESET): - Reset input. A high on this pin for two machine cycles while the oscillator
is running resets the device. This pin drives high for 98 oscillator periods after the Watchdog
times out. The DISRTO bit in SFR AUXR (address 8EH) can be used to disable this feature.
In the default state of bit DISRTO, the RESET HIGH out feature is enabled.
ALE/PROG: - Address Latch Enable (ALE) is an output pulse for latching the low byte of
the address during accesses to external memory. This pin is also the program pulse input
(PROG) during Flash programming. In normal operation, ALE is emitted at a constant rate of
1/6 the oscillator frequency and may be used for external timing or clocking purposes. Note,
however, that one ALE pulse is skipped during each access to external data memory. If
desired, ALE operation can be disabled by setting bit 0 of SFR location 8EH. With the bit set,
ALE is active only during a MOVX or MOVC instruction. Otherwise, the pin is weakly
pulled high. Setting the ALE-disable bit has no effect if the microcontroller is in external
execution mode.
PSEN: - Program Store Enable (PSEN) is the read strobe to external program memory. When
the AT89S52 is executing code from external program memory, PSEN is activated twice
each machine cycle, except that two PSEN activations are skipped during each access to
external data memory.
EA/VPP: - External Access Enable. EA must be strapped to GND in order to enable the
device to fetch code from external program memory locations starting at 0000H up to
FFFFH. Note, however, that if lock bit 1 is programmed, EA will be internally latched on
reset. EA should be strapped to VCC for internal program executions. This pin also receives
the 12-volt programming enable voltage (VPP) during Flash programming.
XTAL1: - Input to the inverting oscillator amplifier and input to the internal clock operating
circuit.
XTAL2: - Output from the inverting oscillator amplifier.
11
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.
12
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
13
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
Atmel‟s 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.
14
Figure-3.2.6 Internal block diagram of 8051 Microcontroller
3.2.7 Memory Architecture
The 8051 has two types of memory and these are Program Memory and Data Memory.
Program Memory (ROM) is used to permanently save the program being executed, while
Data Memory (RAM) is used for temporarily storing data and intermediate results created
and used during the operation of the microcontroller. Depending on the model in use (we are
still talking about the 8051 microcontroller family in general) at most a few Kb of ROM and
128 or 256 bytes of RAM is used .All 8051 microcontrollers have a 16-bit addressing bus and
are capable of addressing64 kb memory. It is neither a mistake nor a big ambition of
engineers who were working on basic core development. It is a matter of smart memory
organization which makes these microcontrollers a real “programmers‟ goody.
15
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, it‟s 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.
16
Figure-3.2.7 Memory Banks in 8051 Microcontroller
3.2.8 Addressing Modes
While operating, the processor processes data as per program instructions. Each instruction
consists of two parts. One part describes WHAT should be done, while the other explains
HOW to do it. The latter part can be a data (binary number) or the address at which the data is
stored. There are 4 types of addressing modes present in 8052 microcontroller.
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.
17
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 16-
bit 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.
18
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.
19
Figure-3.3 Voltage Regulator
3.4 Electrolytic Capacitor
An electrolytic capacitor is a type of capacitor that uses an electrolyte, an ionic-conducting
liquid, as one of its plates, to achieve a larger capacitance per unit volume than other types.
They are often referred to in electronics usage simply as "electrolytic". They are used in
relatively high-current and low-frequency electrical circuits, particularly in power supply
filters, where they store charge needed to moderate output voltage and current fluctuations in
rectifier output. They are also widely used as coupling capacitors in circuits where AC should
be conducted but DC should not. There are two types of electrolytic; aluminum and tantalum.
Structure of a Capacitor
A capacitor contains two conductor plates which are generally made of metal and an insulator
between 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 with
the help of two thin metal rods also known as the legs of the capacitor.
20
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
3.5 Liquid Crystal Display (LCD)
A liquid crystal display (LCD) is a thin, flat electronic visual display that uses the light
modulating properties of liquid crystals (LCs). LCs do not emit light directly They are used in
a wide range of applications, including computer monitors, television, instrument panels,
aircraft cockpit displays, signage, etc. They are common in consumer devices such as video
players, gaming devices, clocks, watches, calculators, and telephones. LCDs have displaced
cathode ray tube (CRT) displays in most applications. They are usually more compact,
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 battery-
powered electronic equipment.
21
Figure-3.5 LCD
3.6 Light Emitting Diodes (LED’s)
LEDs present many advantages over incandescent light sources including lower energy
consumption, longer lifetime, improved robustness, smaller size, faster switching, and
greater durability and reliability. LEDs powerful enough for room lighting are relatively
expensive and require more precise current and heat management than compact fluorescent
lamp sources of comparable output.
Figure-3.6 Light-Emitting Diodes (LED‟s)
22
Light-emitting diodes are used in applications as diverse as replacements for aviation
lighting, automotive lighting (particularly brake lamps, turn signals and indicators) as well as
in traffic signals. The compact size, the possibility of narrow bandwidth, switching speed,
and extreme reliability of LEDs has allowed new text and video displays and sensors to be
developed, while their high switching 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.
3.7 Infrared Sensors
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.75µm
to 1000 µm is the infrared region. Infrared waves are invisible to human eyes. The
wavelength region of 0.75µm to 3 µm is called near infrared, the region from 3 µm to 6 µm is
called mid infrared and the region higher than 6 µm is called far infrared. (The demarcations
are not rigid; regions are defined differently by many).
Figure 3.7 infrared sensor
There are different types of IR sensors working in various regions of the IR spectrum but the
physics behind "IR sensors" is governed by three laws:
1. Plank’s radiation law:
Every object at a temperature T not equal to 0 K emits radiation. Infrared radiant energy is
determined by the temperature and surface condition of an object. Human eyes cannot detect
23
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
3. Wein‟s Displacement Law
Wein‟s Law tells that objects of different temperature emit spectra that peak at different
wavelengths. It provides the wavelength for maximum spectral radiant emittance for a given
temperature. The relationship between the true temperature of the black body and its peak
spectral existence or dominant wavelength is described by this law
The world is not full of black bodies; rather it
comprises of selectively radiating bodies like rocks, water, etc. and the relationship between
the two is given by emissivity (E).
Emissivity depends on object color, surface roughness, moisture content, degree of
compaction, field of view, viewing angle & wavelength.
3.7.1 Elements of Infrared Detection System
A typical system for detecting infrared radiation is given in the following block diagram:
Figure-3.7.1 Infrared detection system
24
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)
25
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 signal-
processing 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
26
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)
Figure-3.7.2.1 Break beam sensor
• Reflectance Sensors
This type of sensors house both an IR source and an IR detector in a single housing in such a
way that light from emitter LED bounces off an external object and is reflected into a
detector. Amount of light reflected into the detector depends upon the reflectivity of the
surface. This principle is used in intrusion detection, object detection (measure the presence
of an object in the sensor‟s FOV), barcode decoding, and surface feature detection (detecting
features painted, taped, or otherwise marked onto the floor), wall tracking (detecting distance
from the wall), etc.
Figure-3.7.2.2 Reflectance sensor
It can also be used to scan a defined area; the transmitter emits a beam of light into the scan
zone, the reflected light is used to detect a change in the reflected light thereby scanning the
desired zone.
2. Passive Infrared Sensors
These are basically IR detectors; they don‟t use any IR source. These form the major class of
IR sensors/detectors. A passive infrared system detects energy emitted by objects in the field
of view and may use signal-processing algorithms to extract the desired information. It does
not emit any energy of its own for the purposes of detection. Passive infrared systems can
27
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
don‟t 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.
28
• 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
29
• 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
 Quad Band GSM/GPRS : 850 / 900 / 1800 / 1900 MHz
 Built in RS232 to TTL or vice versa Logic Converter (MAX232)
 Configurable Baud Rate
 SMA (Sub Miniature version A) connector with GSM L Type Antenna
 Built in SIM (Subscriber Identity Module) Card holder
 Built in Network Status LED
 Inbuilt Powerful TCP / IP (Transfer Control Protocol / Internet Protocol) stack for
 internet data transfer through GPRS (General Packet Radio Service)
 Audio Interface Connectors (Audio in and Audio out)
30
 Most Status and Controlling pins are available
 Normal Operation Temperature : -20 °C to +55 °C
 Input Voltage : 5V to 12V DC
Hardware Description
Figure-3.8.1 GSM Module
SIMCOM SIM900A GSM Module
This is actual SIM900 GSM module which is manufactured by SIMCOM. Designed for
global market, SIM900 is a quad-band GSM/GPRS engine that works on frequencies GSM
850MHz, EGSM 900MHz, DCS 1800MHz and PCS 1900MHz. SIM900 features GPRS
multi slot class 10/ class 8 (optional) and supports the GPRS coding schemes CS-1, CS-2,
CS-3 and CS-4. With a tiny configuration of 24mm x 24mm x 3mm, SIM900 can meet
31
almost all the space requirements in User‟s applications, such as M2M, smart phone, PDA
and other mobile devices.
Figure -3.8.1 SIMCOM SIM900A GSM Module
MAX232 IC
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).
Figure-3.8.2 MAX232 IC
Serial port / DB9 connector:
User just needs to attach RS232 cable here so that it can be connected to devices which have
Serial port / DB9 Connector.
32
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 math‟s- 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.
33
SIM (Subscriber Identity Module) Card Slot:
This onboard SIM card slot provide User functionality of insert a SIM (GSM only) card of
any service provider. Process of inserting and locking SIM card into SIM card slot is given in
this manual. While inserting in and removing out SIM card from SIM card slot, User needs to
take precaution that power supply should be OFF so that after making Power supply ON it
will be easy to reinitialize with SIM for this module.
Figure-3.8.3 SIM Slot
34
Chapter – 4
PROJECT DETAILS
4.1 Block diagram
Figure-4.1 Block Diagram of GSM Home Security System
35
4.2 Working of GSM Home Security System
Home/ Bank/ Office security has been a major issue where crime is increasing and everybody
wants to take proper measures to prevent intrusion. In addition there was a need to automate
home so that user can take advantage of the technological advancement in such a way that a
person getting off the office does not get melted with the hot climate.
Detecting Obstacle with IR (Infrared) Sensor
The basic concept of IR (infrared) obstacle detection is to transmit the IR signal(radiation) in
a direction and a signal is received at the IR receiver when the IR radiation bounces back
from a surface of the object.
Figure- 4.2.1 IR Sensor Detection Process
Here in the figure the object can be anything which has certain shape and size, the IR LED
transmits the IR signal on to the object and the signal is reflected back from the surface of the
object. The reflected signals are received by an IR receiver. The IR receiver can be a
photodiode /photo transistor or a readymade module which decodes the signal. In order to
implement the IR obstacle detection, we need to understand the following
 We need to understand how to transmit IR signal using commercially available electronic
components.
 Same way we also need to understand the IR receiver.
36
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.
Figure -4.2.2 IR Directivity
Also remember, that a thick enclosure is necessary for both IR transmitter and IR receiver,
because the IR radiation may bounce back from the surrounding objects which may not help
when you want to detect obstacle in one direction. Sometimes, if you don‟t have a thick
enclosure then the signal may directly reach the receiver even without having an obstacle.
37
4.3 Working of GSM Module
The GSM modem is slightly different from the conventional modem. This utilizes the GSM
standard for cellular technology. Here, one end being a wired connection, receives and
transmits data. The other end is connected to a RF antenna. The GSM modem acts like a
cellular phone and transmits text and voice data. It communicates with the GSM network via
the SIM (Subscriber‟s Identity Module) card.
The Global System for Mobile Communications (GSM: originally from Grouper Special
Mobile) is the most popular standard for mobile phones in the world. GSM service is used by
over 2 billion people across more than 212 countries and territories. The ubiquity of the GSM
standard makes international roaming very common between mobile phone operators,
enabling subscribers to use their phones in many parts of the world. GSM differs significantly
from its predecessors in that both signaling and speech channels are Digital call quality,
which means that it is considered a second generation (2G) mobile phone system. This fact
has also meant that data communication was built into the system from the 3rd Generation
Partnership Project (3GPP).
When any object is detected by IR sensor then it sends the command to the microcontroller
and now microcontroller send the command to the GSM module .GSM module have a SIM
card, with the help of SIM card GSM module send the SMS on give mobile number which is
already programmed in the microcontroller.
4.4 Application
The applications of SMS/GSM Based security system are quite diverse. There are many real
life situations that require control of different devices remotely and to provide security. There
will be instances where a wired connection between a remote appliance/device and the
control unit might not be feasible due to structural problems. Major areas where it is used as
Anti-Theft Reporting
When someone break in , Home-Guard uses GSM network to report automatically to5 preset
numbers: short message for control center, short message for 3 pre-stored mobile phone, and
1 voice call. The owner can monitor or talk to the thief.
38
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 pre-
stored 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.
39
Chapter – 5
CHARACTERISTICS & STRENGTHS
5.1 Characteristics & Strengths
The proposed system characteristics involve remote controlling of appliances, intrusion
detection, system security and auto-configuration such that system automatically adjusts the
system settings on running hardware support check. The system has useful features such as
displaying of battery level, charging status and signal strength of the mobile thus making
system reliable.
 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.
 The ease of deployment is due to wireless mode of communication.
 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.
40
Chapter – 6
CONCLUSION AND FUTURE SCOPE
In the paper low cost, secure, ubiquitously accessible, auto-configurable, remotely controlled
solution for automation of homes has been introduced. The approach discussed in the paper is
novel and has achieved the target to control home appliances remotely using the SMS-based
system satisfying user needs and requirements.GSM technology capable solution has proved
to be controlled remotely, provide home security and is cost-effective as compared to the
previously existing systems. Hence we can conclude that the required goals and objectives of
our project have been achieved. The basic level of home appliance control and remote
monitoring has been implemented. The system is extensible and more levels can be further
developed using automatic motion/glass breaking detectors so the solution can be integrated
with the send other detection systems. In future the system will be small box combining the
PC and GSM modem. The hardware will be self contained and cannot be prone to electric
failure. This appliance will have its own encapsulated UPS and charging system
41
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.
42
LIST OF FIGURES
Figure No. Page No.
Figure-2.1 Simple Architecture of GSM home security system 4
Figure-3.2.3 Pin Diagram of 8052 Microcontroller 9
Figure-3.2.6 Internal block diagram of 8051 Microcontroller 14
Figure-3.2.7 Memory Banks in 8051 Microcontroller 16
Figure-3.3 Voltage Regulator 19
Figure-3.4 Capacitor 20
Figure-3.5 LCD 21
Figure-3.6 Light-Emitting Diodes (LED’s) 21
Figure-3.7 infrared sensor 22
Figure-3.7.1 Infrared detection system 23
Figure-3.7.2.1 Break beam sensor 26
Figure-3.7.2.2 Reflectance sensor 26
Figure-3.8.1 GSM Module 30
Figure-3.8.1 SIMCOM SIM900A GSM Module 31
Figure-3.8.2 MAX232 IC 31
Figure-3.8.3 SIM Slot 33
Figure-4.1 Block Diagram of GSM Home Security System 34
Figure-4.2.1 IR Sensor Detection Process 35
Figure-4.2.2 IR Directivity 36
43
CODING
1.Code to Detect Obstacle using IR (Infrared) Sensor
#include "E:WinAVR-20080512avrincludeavrio.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++;}}
44
/* Deactivate OCR2 wave generation */
DDRD = DDRD & 0x7F;
/*
if (r_count >5)
{
/* ON LED */
PORTB = PORTB & 0x1;
/* Delay while the LED is ON */
millisecond_delay(200);
/* OFF LED */
PORTB = PORTB & 0xFE;}
/* Initialize IR receiver count */
r_count = 0;
/* Delay to keep maintain the OFF state of the IR transmitter */
millisecond_delay(90);
}
return 0;}
void millisecond_delay(unsigned int count)
{
unsigned int i =0;
unsigned int j = 0;
do
{
/*One millisecond delay
The delay is measured for 8 Mhz crystal */
for (i=0;i<=400;i++)
{
/* delay */}
j++;
}while(j<count);
}
45
2.Program to Interface GSM Module with (AT89S52) Microcontroller
#include<reg52.h>
#define port P1
#define dataport P2
sbit rs = port^2;
sbit rw = port^3;
sbit en = port^4;
int count,i;
unsigned char check,str[15];
bit check_space;
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++);
46
}
void lcd_cmd(unsigned char item)
{
dataport = item;
rs= 0;
rw=0;
en=1;
delay(1);
en=0;
return;
}
void lcd_data(unsigned char item)
{
dataport = item;
rs= 1;
rw=0;
en=1;
delay(1);
en=0;
return;
47
}
void lcd_data_string(unsigned char *str)
{
int i=0;
while(str[i]!='0')
{
lcd_data(str[i]);
i++;
delay(10);
}
return;
}
void lcd()
{
lcd_cmd(0x38);
delay(5);
lcd_cmd(0x0F);
delay(5);
lcd_cmd(0x80);
delay(5);
}
48
void transmit_data(unsigned char str)
{
SBUF=str;
while(TI==0);
}
void receive_data() interrupt 4
{
RI=0;
str[++count]=SBUF;
}
unsigned char byte_check()
{
switch(str[0])
{
case 0x0a:
{
return 0x00;
break ;
49
}
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);
50
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]);
51
check_space=1;
}
}
count--;
for(i=0;i<count;i++)
{
str[i]=str[i+1];
}
}
}
}

More Related Content

What's hot

Design and implementation of home automation system u...
Design and implementation of home                         automation system u...Design and implementation of home                         automation system u...
Design and implementation of home automation system u...MUHAMMAD KHURSHID AHMAD
 
Project Dissertation - ZigBee Based Wireless Sensor Network
Project Dissertation - ZigBee Based Wireless Sensor NetworkProject Dissertation - ZigBee Based Wireless Sensor Network
Project Dissertation - ZigBee Based Wireless Sensor NetworkAnand Agrawal
 
Home automation system using gsm
Home automation system using gsmHome automation system using gsm
Home automation system using gsmRohit Sinha
 
Final year project 2013 14 for ECE, EEE, TE, EIE Branches
Final year project 2013 14 for ECE, EEE, TE, EIE BranchesFinal year project 2013 14 for ECE, EEE, TE, EIE Branches
Final year project 2013 14 for ECE, EEE, TE, EIE Branchesprojectsepark
 
Design and implement a smart system to detect intruders and firing using IoT
Design and implement a smart system to detect intruders and firing using IoT Design and implement a smart system to detect intruders and firing using IoT
Design and implement a smart system to detect intruders and firing using IoT IJECEIAES
 
Design and Construction of Digital Locking System
Design and Construction of Digital Locking SystemDesign and Construction of Digital Locking System
Design and Construction of Digital Locking SystemTarek Erin
 
Home automation & security system
Home automation & security systemHome automation & security system
Home automation & security systemAniket Maithani
 
Password based door locking system
Password based door locking systemPassword based door locking system
Password based door locking systemArjun Singh
 
IoT and Fingerprint Based Door Looking System
IoT and Fingerprint Based Door Looking SystemIoT and Fingerprint Based Door Looking System
IoT and Fingerprint Based Door Looking Systemrahulmonikasharma
 
Android based home automation
Android based home automationAndroid based home automation
Android based home automationhasan sarker
 
A zigbee and embedded based security
A zigbee and embedded based securityA zigbee and embedded based security
A zigbee and embedded based securityijistjournal
 
A minor project report HOME AUTOMATION USING MOBILE PHONES
A minor project report HOME AUTOMATION  USING  MOBILE PHONESA minor project report HOME AUTOMATION  USING  MOBILE PHONES
A minor project report HOME AUTOMATION USING MOBILE PHONESashokkok
 
To protect user’s password from theft by using rfid and mems technology
To protect user’s password from theft by using rfid and mems technologyTo protect user’s password from theft by using rfid and mems technology
To protect user’s password from theft by using rfid and mems technologyeSAT Journals
 
INDUSTRIAL SECURITY SYSTEM PROJECTS ABSTRACT:Industrial safety measures syste...
INDUSTRIAL SECURITY SYSTEM PROJECTS ABSTRACT:Industrial safety measures syste...INDUSTRIAL SECURITY SYSTEM PROJECTS ABSTRACT:Industrial safety measures syste...
INDUSTRIAL SECURITY SYSTEM PROJECTS ABSTRACT:Industrial safety measures syste...ASHOKKUMAR RAMAR
 
Biometric Identification using Opencv Based on Arduino
Biometric Identification using Opencv Based on ArduinoBiometric Identification using Opencv Based on Arduino
Biometric Identification using Opencv Based on ArduinoIRJET Journal
 
Smart Home Automation by LDCE student
Smart Home Automation by LDCE studentSmart Home Automation by LDCE student
Smart Home Automation by LDCE studentMitul Lakhani
 
IRJET- Theft Control using IoT
IRJET-  	  Theft Control using IoTIRJET-  	  Theft Control using IoT
IRJET- Theft Control using IoTIRJET Journal
 
Android Based Home Automation Control
Android Based Home Automation ControlAndroid Based Home Automation Control
Android Based Home Automation ControlVivek Porwal
 
Final year report on remote control of home appliances via bluetooth
Final year report on remote control of home appliances via bluetoothFinal year report on remote control of home appliances via bluetooth
Final year report on remote control of home appliances via bluetoothShubham Bhattacharya
 
Telephone Based Home Automation System By Lokendra Pankaj
Telephone Based Home Automation System By Lokendra PankajTelephone Based Home Automation System By Lokendra Pankaj
Telephone Based Home Automation System By Lokendra PankajLokendra Pankaj
 

What's hot (20)

Design and implementation of home automation system u...
Design and implementation of home                         automation system u...Design and implementation of home                         automation system u...
Design and implementation of home automation system u...
 
Project Dissertation - ZigBee Based Wireless Sensor Network
Project Dissertation - ZigBee Based Wireless Sensor NetworkProject Dissertation - ZigBee Based Wireless Sensor Network
Project Dissertation - ZigBee Based Wireless Sensor Network
 
Home automation system using gsm
Home automation system using gsmHome automation system using gsm
Home automation system using gsm
 
Final year project 2013 14 for ECE, EEE, TE, EIE Branches
Final year project 2013 14 for ECE, EEE, TE, EIE BranchesFinal year project 2013 14 for ECE, EEE, TE, EIE Branches
Final year project 2013 14 for ECE, EEE, TE, EIE Branches
 
Design and implement a smart system to detect intruders and firing using IoT
Design and implement a smart system to detect intruders and firing using IoT Design and implement a smart system to detect intruders and firing using IoT
Design and implement a smart system to detect intruders and firing using IoT
 
Design and Construction of Digital Locking System
Design and Construction of Digital Locking SystemDesign and Construction of Digital Locking System
Design and Construction of Digital Locking System
 
Home automation & security system
Home automation & security systemHome automation & security system
Home automation & security system
 
Password based door locking system
Password based door locking systemPassword based door locking system
Password based door locking system
 
IoT and Fingerprint Based Door Looking System
IoT and Fingerprint Based Door Looking SystemIoT and Fingerprint Based Door Looking System
IoT and Fingerprint Based Door Looking System
 
Android based home automation
Android based home automationAndroid based home automation
Android based home automation
 
A zigbee and embedded based security
A zigbee and embedded based securityA zigbee and embedded based security
A zigbee and embedded based security
 
A minor project report HOME AUTOMATION USING MOBILE PHONES
A minor project report HOME AUTOMATION  USING  MOBILE PHONESA minor project report HOME AUTOMATION  USING  MOBILE PHONES
A minor project report HOME AUTOMATION USING MOBILE PHONES
 
To protect user’s password from theft by using rfid and mems technology
To protect user’s password from theft by using rfid and mems technologyTo protect user’s password from theft by using rfid and mems technology
To protect user’s password from theft by using rfid and mems technology
 
INDUSTRIAL SECURITY SYSTEM PROJECTS ABSTRACT:Industrial safety measures syste...
INDUSTRIAL SECURITY SYSTEM PROJECTS ABSTRACT:Industrial safety measures syste...INDUSTRIAL SECURITY SYSTEM PROJECTS ABSTRACT:Industrial safety measures syste...
INDUSTRIAL SECURITY SYSTEM PROJECTS ABSTRACT:Industrial safety measures syste...
 
Biometric Identification using Opencv Based on Arduino
Biometric Identification using Opencv Based on ArduinoBiometric Identification using Opencv Based on Arduino
Biometric Identification using Opencv Based on Arduino
 
Smart Home Automation by LDCE student
Smart Home Automation by LDCE studentSmart Home Automation by LDCE student
Smart Home Automation by LDCE student
 
IRJET- Theft Control using IoT
IRJET-  	  Theft Control using IoTIRJET-  	  Theft Control using IoT
IRJET- Theft Control using IoT
 
Android Based Home Automation Control
Android Based Home Automation ControlAndroid Based Home Automation Control
Android Based Home Automation Control
 
Final year report on remote control of home appliances via bluetooth
Final year report on remote control of home appliances via bluetoothFinal year report on remote control of home appliances via bluetooth
Final year report on remote control of home appliances via bluetooth
 
Telephone Based Home Automation System By Lokendra Pankaj
Telephone Based Home Automation System By Lokendra PankajTelephone Based Home Automation System By Lokendra Pankaj
Telephone Based Home Automation System By Lokendra Pankaj
 

Viewers also liked

A project report on comparative study of mutual funds in india
A project report on comparative study of mutual funds in indiaA project report on comparative study of mutual funds in india
A project report on comparative study of mutual funds in indiaProjects Kart
 
Sample Acknowledgement of Project Report
Sample Acknowledgement of Project ReportSample Acknowledgement of Project Report
Sample Acknowledgement of Project ReportMBAnetbook.co.in
 
Acknowledgement For Assignment
Acknowledgement For AssignmentAcknowledgement For Assignment
Acknowledgement For AssignmentThomas Mon
 
Social Psychology Project 3- Report Writing
Social Psychology Project 3- Report WritingSocial Psychology Project 3- Report Writing
Social Psychology Project 3- Report WritingEricaGloriaChin
 
Implementation of Home Security System using GSM module and Microcontroller
Implementation of Home Security System using GSM module and MicrocontrollerImplementation of Home Security System using GSM module and Microcontroller
Implementation of Home Security System using GSM module and MicrocontrollerMohan Prabhu
 
SECURITY SYSTEM
SECURITY SYSTEMSECURITY SYSTEM
SECURITY SYSTEMK. Gourav
 
project report. final
project report. finalproject report. final
project report. finalKumar Prateek
 
group project report
group project reportgroup project report
group project reportVy Quoc Tran
 
MIS Project Group 14
MIS   Project Group 14MIS   Project Group 14
MIS Project Group 14Heena Khatri
 
Awards and recognition in an organization
Awards and recognition in an organizationAwards and recognition in an organization
Awards and recognition in an organizationBibhav Pal
 
Lifestyle 600 Owner's Guide
Lifestyle 600 Owner's GuideLifestyle 600 Owner's Guide
Lifestyle 600 Owner's GuideTom Hodgson
 
Invoice and Renewal Display
Invoice and Renewal DisplayInvoice and Renewal Display
Invoice and Renewal DisplaySarah Boraas
 
WyattWaroResumeQC2
WyattWaroResumeQC2WyattWaroResumeQC2
WyattWaroResumeQC2Wyatt Waro
 

Viewers also liked (20)

Example of acknowledgment
Example of acknowledgmentExample of acknowledgment
Example of acknowledgment
 
A project report on comparative study of mutual funds in india
A project report on comparative study of mutual funds in indiaA project report on comparative study of mutual funds in india
A project report on comparative study of mutual funds in india
 
Sample Acknowledgement of Project Report
Sample Acknowledgement of Project ReportSample Acknowledgement of Project Report
Sample Acknowledgement of Project Report
 
Acknowledgement For Assignment
Acknowledgement For AssignmentAcknowledgement For Assignment
Acknowledgement For Assignment
 
Social Psychology Project 3- Report Writing
Social Psychology Project 3- Report WritingSocial Psychology Project 3- Report Writing
Social Psychology Project 3- Report Writing
 
Group-3
Group-3Group-3
Group-3
 
Implementation of Home Security System using GSM module and Microcontroller
Implementation of Home Security System using GSM module and MicrocontrollerImplementation of Home Security System using GSM module and Microcontroller
Implementation of Home Security System using GSM module and Microcontroller
 
Commercial policy
Commercial policyCommercial policy
Commercial policy
 
SECURITY SYSTEM
SECURITY SYSTEMSECURITY SYSTEM
SECURITY SYSTEM
 
project report. final
project report. finalproject report. final
project report. final
 
group project report
group project reportgroup project report
group project report
 
MIS Project Group 14
MIS   Project Group 14MIS   Project Group 14
MIS Project Group 14
 
Awards and recognition in an organization
Awards and recognition in an organizationAwards and recognition in an organization
Awards and recognition in an organization
 
Diamond birthday
Diamond birthdayDiamond birthday
Diamond birthday
 
Birchman process prop
Birchman process propBirchman process prop
Birchman process prop
 
Lifestyle 600 Owner's Guide
Lifestyle 600 Owner's GuideLifestyle 600 Owner's Guide
Lifestyle 600 Owner's Guide
 
Invoice and Renewal Display
Invoice and Renewal DisplayInvoice and Renewal Display
Invoice and Renewal Display
 
M. alsayad NEW_CV_2015
M. alsayad NEW_CV_2015M. alsayad NEW_CV_2015
M. alsayad NEW_CV_2015
 
WyattWaroResumeQC2
WyattWaroResumeQC2WyattWaroResumeQC2
WyattWaroResumeQC2
 
Imnci
ImnciImnci
Imnci
 

Similar to Sri

laser security alarm thesis
laser security alarm thesislaser security alarm thesis
laser security alarm thesisyash kumar singh
 
Smart door project report shivnaresh likhar
Smart door project report shivnaresh likharSmart door project report shivnaresh likhar
Smart door project report shivnaresh likharShivnaresh Likhar
 
HOME AUTOMATION AND COUNTERMEASURESYSTEM USING ARDUINO AND LDR MODULE
HOME AUTOMATION AND COUNTERMEASURESYSTEM USING ARDUINO AND LDR MODULEHOME AUTOMATION AND COUNTERMEASURESYSTEM USING ARDUINO AND LDR MODULE
HOME AUTOMATION AND COUNTERMEASURESYSTEM USING ARDUINO AND LDR MODULEIRJET Journal
 
Home Automation & Security
Home Automation & SecurityHome Automation & Security
Home Automation & SecurityRoshan Mani
 
IRJET- Home Automation using IoT: Review
IRJET- Home Automation using IoT: ReviewIRJET- Home Automation using IoT: Review
IRJET- Home Automation using IoT: ReviewIRJET Journal
 
IRJET - Smart Doorbell System
 IRJET - Smart Doorbell System IRJET - Smart Doorbell System
IRJET - Smart Doorbell SystemIRJET Journal
 
Motion Detection System for Security Using IoT- Survey
Motion Detection System for Security Using IoT- SurveyMotion Detection System for Security Using IoT- Survey
Motion Detection System for Security Using IoT- SurveyIRJET Journal
 
IRJET- Smart Security System in Homes using Simple Internet of Things Ena...
IRJET-  	  Smart Security System in Homes using Simple Internet of Things Ena...IRJET-  	  Smart Security System in Homes using Simple Internet of Things Ena...
IRJET- Smart Security System in Homes using Simple Internet of Things Ena...IRJET Journal
 
GSM Mobile Phone Based LCD Message Display System
GSM Mobile Phone Based LCD Message Display SystemGSM Mobile Phone Based LCD Message Display System
GSM Mobile Phone Based LCD Message Display SystemManish Kumar
 
11.[106 118]design and implementation of a short message service based remote...
11.[106 118]design and implementation of a short message service based remote...11.[106 118]design and implementation of a short message service based remote...
11.[106 118]design and implementation of a short message service based remote...Alexander Decker
 
Design and realization of motion detector system for house security
Design and realization of motion detector system for house securityDesign and realization of motion detector system for house security
Design and realization of motion detector system for house securityTELKOMNIKA JOURNAL
 
A Short Review on the Perspective of Home Automation Technology
A Short Review on the Perspective of Home Automation TechnologyA Short Review on the Perspective of Home Automation Technology
A Short Review on the Perspective of Home Automation TechnologyIRJET Journal
 
border security using gsm
border security using gsmborder security using gsm
border security using gsmbharath naidu
 
IRJET - Safety and Security Aspects of Smart Home Applications using Face...
IRJET -  	  Safety and Security Aspects of Smart Home Applications using Face...IRJET -  	  Safety and Security Aspects of Smart Home Applications using Face...
IRJET - Safety and Security Aspects of Smart Home Applications using Face...IRJET Journal
 
[[IAA JSR 10(1)36-48, 2023.Automated Hybrid Smart Door Control System.pdf
[[IAA JSR 10(1)36-48, 2023.Automated Hybrid Smart Door Control System.pdf[[IAA JSR 10(1)36-48, 2023.Automated Hybrid Smart Door Control System.pdf
[[IAA JSR 10(1)36-48, 2023.Automated Hybrid Smart Door Control System.pdfPUBLISHERJOURNAL
 
Automated Hybrid Smart Door Control System.pdf
Automated Hybrid Smart Door Control System.pdfAutomated Hybrid Smart Door Control System.pdf
Automated Hybrid Smart Door Control System.pdfssuser793b4e
 
Smart Sensor Network for Society Automation-A Review
Smart Sensor Network for Society Automation-A ReviewSmart Sensor Network for Society Automation-A Review
Smart Sensor Network for Society Automation-A ReviewIRJET Journal
 
csc project .docx
csc project .docxcsc project .docx
csc project .docxvorsv
 
IRJET- Centralized Wireless Home Appliances Control System
IRJET- Centralized Wireless Home Appliances Control SystemIRJET- Centralized Wireless Home Appliances Control System
IRJET- Centralized Wireless Home Appliances Control SystemIRJET Journal
 

Similar to Sri (20)

laser security alarm thesis
laser security alarm thesislaser security alarm thesis
laser security alarm thesis
 
Smart door project report shivnaresh likhar
Smart door project report shivnaresh likharSmart door project report shivnaresh likhar
Smart door project report shivnaresh likhar
 
HOME AUTOMATION AND COUNTERMEASURESYSTEM USING ARDUINO AND LDR MODULE
HOME AUTOMATION AND COUNTERMEASURESYSTEM USING ARDUINO AND LDR MODULEHOME AUTOMATION AND COUNTERMEASURESYSTEM USING ARDUINO AND LDR MODULE
HOME AUTOMATION AND COUNTERMEASURESYSTEM USING ARDUINO AND LDR MODULE
 
SEDRP
SEDRPSEDRP
SEDRP
 
Home Automation & Security
Home Automation & SecurityHome Automation & Security
Home Automation & Security
 
IRJET- Home Automation using IoT: Review
IRJET- Home Automation using IoT: ReviewIRJET- Home Automation using IoT: Review
IRJET- Home Automation using IoT: Review
 
IRJET - Smart Doorbell System
 IRJET - Smart Doorbell System IRJET - Smart Doorbell System
IRJET - Smart Doorbell System
 
Motion Detection System for Security Using IoT- Survey
Motion Detection System for Security Using IoT- SurveyMotion Detection System for Security Using IoT- Survey
Motion Detection System for Security Using IoT- Survey
 
IRJET- Smart Security System in Homes using Simple Internet of Things Ena...
IRJET-  	  Smart Security System in Homes using Simple Internet of Things Ena...IRJET-  	  Smart Security System in Homes using Simple Internet of Things Ena...
IRJET- Smart Security System in Homes using Simple Internet of Things Ena...
 
GSM Mobile Phone Based LCD Message Display System
GSM Mobile Phone Based LCD Message Display SystemGSM Mobile Phone Based LCD Message Display System
GSM Mobile Phone Based LCD Message Display System
 
11.[106 118]design and implementation of a short message service based remote...
11.[106 118]design and implementation of a short message service based remote...11.[106 118]design and implementation of a short message service based remote...
11.[106 118]design and implementation of a short message service based remote...
 
Design and realization of motion detector system for house security
Design and realization of motion detector system for house securityDesign and realization of motion detector system for house security
Design and realization of motion detector system for house security
 
A Short Review on the Perspective of Home Automation Technology
A Short Review on the Perspective of Home Automation TechnologyA Short Review on the Perspective of Home Automation Technology
A Short Review on the Perspective of Home Automation Technology
 
border security using gsm
border security using gsmborder security using gsm
border security using gsm
 
IRJET - Safety and Security Aspects of Smart Home Applications using Face...
IRJET -  	  Safety and Security Aspects of Smart Home Applications using Face...IRJET -  	  Safety and Security Aspects of Smart Home Applications using Face...
IRJET - Safety and Security Aspects of Smart Home Applications using Face...
 
[[IAA JSR 10(1)36-48, 2023.Automated Hybrid Smart Door Control System.pdf
[[IAA JSR 10(1)36-48, 2023.Automated Hybrid Smart Door Control System.pdf[[IAA JSR 10(1)36-48, 2023.Automated Hybrid Smart Door Control System.pdf
[[IAA JSR 10(1)36-48, 2023.Automated Hybrid Smart Door Control System.pdf
 
Automated Hybrid Smart Door Control System.pdf
Automated Hybrid Smart Door Control System.pdfAutomated Hybrid Smart Door Control System.pdf
Automated Hybrid Smart Door Control System.pdf
 
Smart Sensor Network for Society Automation-A Review
Smart Sensor Network for Society Automation-A ReviewSmart Sensor Network for Society Automation-A Review
Smart Sensor Network for Society Automation-A Review
 
csc project .docx
csc project .docxcsc project .docx
csc project .docx
 
IRJET- Centralized Wireless Home Appliances Control System
IRJET- Centralized Wireless Home Appliances Control SystemIRJET- Centralized Wireless Home Appliances Control System
IRJET- Centralized Wireless Home Appliances Control System
 

Sri

  • 1. GSM BASED HOME SECURITY SYSTEM A Project Report Submitted in partial fulfillment for the award of the Degree of Bachelor of Technology in Electronics & Communication Engineering. Supervisor Submitted By: Ms. Neelu Pareek Ramraj Meena (09ESOECM30P100) (Asst. Prof. of ECE Dept.) Somendra (09ESOECM30P112) Surendra Singh (09ESOECM30P120) NemiChand Jat (09ESOECM30P074) Department of Electronics & Communication Engineering Sobhasaria Group of Institutions Rajasthan Technical University 2012-2013
  • 2. (ii) Department of Electronics & Communication Engineering Certificate 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 student’s 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 Ms. Neelu Pareek Mr. Indranil Sarkar Mr.Devendra Singh (Project Guide) (Project Incharge) (HOD, ECE)
  • 3. (iii) Candidate’s 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. Ramraj Meena (09ESOECM30P100) Somendra (09ESOECM30P112) Surendra Singh (09ESOECM30P120) NemiChand Jat (09ESOECM30P074) Sobhasaria Group of Institutions, sikar. Name of Supervisor Ms. Neelu Pareek
  • 4. (iv) 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. Ramraj Meena (09ESOECM30P100) Somendra (09ESOECM30P112) Surendra Singh (09ESOECM30P120) NemiChand Jat (09ESOECM30P074)
  • 5. (v) TABLE OF CONTENTS Page No. Cover Page (i) Certificate (ii) Candidate’s declaration (iii) Acknowledgement (iv) Table of contents (v-vii) Abstract 1 Chapter 1 INTRODUCTION 2 1.1 Introduction 2 1.2 General description 3 Chapter 2 GENERAL ARCHITECTURE 4 2.1 Architecture 4 2.2 Overview of Components Used in Architecture 5 2.2.1 AT89S52 Microcontroller 5 2.2.2 LCD Display 5 2.2.3 IR Sensor 6 2.2.4 GSM Module 6 Chapter 3 PROJECT COMPONENTS 7 3.1 Printed Circuit Board (PCB) 7 3.2 AT89S52 Microcontroller 7
  • 6. (vi) 3.2.1 Features 7 3.2.2 Description 8 3.2.3 Pin Diagram 9 3.2.4 Pin Description 10 3.2.5 Input and Output Ports (I/O Ports) 12 3.2.6 Internal Block Diagram of 8051 Microcontroller 13 3.2.7 Memory Architecture 14 3.2.8 Addressing Modes 16 3.2.9 Special Function Registers (SFRs) 17 3.3 Voltage Regulator 18 3.4 Electrolytic Capacitor 19 3.5 Liquid Crystal Display (LCD) 20 3.6 Light Emitting Diodes (LED’s) 21 3.7 Infrared Sensors 22 3.7.1 Elements of Infrared Detection System 23 3.7.2 Types of Infrared Sensors 25 3.8 GSM Module 29 Chapter 4 PROJECT DETAILS 34 4.1 Block diagram 34 4.2 Working of GSM Home Security System 35 4.3 Working of GSM Module 37 4.4 Application 37
  • 7. (vii) Chapter 5 CHARACTERISTICS & STRENGTHS 39 5.1 Characteristics & Strengths 39 Chapter 6 CONCLUSION AND FUTURE SCOPE 40 REFERENCES 41 Appendix A LIST OF FIGURES 42 Appendix B CODING 43
  • 8. 1 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 today‟s 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.
  • 9. 2 Chapter - 1 INTRODUCTION 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 (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
  • 10. 3 1.2. General Description The project here is all about a Home security system, In this project we have planned to develop a Home security system .Home security system for detecting an intrusion into a monitored area by an infrared detector. A security system has a flee-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 .The area under surveillance is monitored by an infrared detector which activates the transmitter upon the detection of abrupt differences in infrared radiation levels, associated with the presence of a warm body in an otherwise equilibrated environment. A radio signal is emitted by the transmitter which is received by the portable hand-held remote receiver. A first signal, indicating that an intrusion has been detected less than a preselected period of time in the past in the monitored areas, is displayed on the receiver for that preselected period of time. After the preselected period of time has elapsed, a second signal is generated to indicate that the intrusion took place at a time greater than the preselected period of time in the past and that the probability of the intruder still being present is less. Once the intrusion detector is activated, the signal is continuously transmitted to the portable receiver until the intrusion detector has been-reset A security system for a home comprising: A free standing intrusion detector to be set in an area of said home to be protected, said-free standing intrusion detector comprising: An intrusion detector to generate an intrusion signal in response to an intrusion into said area ;A radio signaling transmitter responsive to said intrusion signal to transmit a radio-signal means for modulating said radio signal for a predetermined time in response to said intrusion signal; and time delay means for delaying the actuation of said intrusion detector to allow a person sufficient time to exit said area to be protected after setting said intrusion detector; and a portable receiver adapted to be hand carried comprising. Means for generating an output signal in response to said radio signal. Display means for generating a visual display indicating an intrusion has occurred in response to said output signal
  • 11. 4 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. Figure-2.1 Simple Architecture of GSM home security system
  • 12. 5 2.2 Overview of Components Used in Architecture  AT89S52 Microcontroller  LCD Display  IR Sensor  GSM Module 2.2.1 AT89S52 Microcontroller 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 Atmel‟s 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. By combining a versatile 8-bit CPU with in-system programmable Flash on a monolithic chip, the Atmel AT89S52 is a powerful microcontroller which provides a highly-flexible and cost-effective solution to many embedded control applications. The AT89S52 provides the following standard features: 8K bytes of Flash, 256 bytes of RAM, 32 I/O lines, Watchdog timer, two data pointers, three 16-bit timer/counters, a six-vector two-level interrupt architecture, a full duplex serial port, on-chip oscillator, and clock circuitry. In addition, the AT89S52 is designed with static logic for operation down to zero frequency and supports two software selectable power saving modes. The Idle Mode stops the CPU while allowing the RAM, timer/counters, serial port, and interrupt system to continue functioning. The Power- down mode saves the RAM contents but freezes the oscillator, disabling all other chip functions until the next interrupt or hardware reset. 2.2.2 LCD Display A liquid crystal display (LCD) is a thin, flat electronic visual display that uses the light modulating properties of liquid crystals (LCs). LCs do not emit light directly They are used in a wide range of applications, including computer monitors, television, instrument panels, aircraft cockpit displays, signage, etc. They are common in consumer devices such as video players, gaming devices, clocks, watches, calculators, and telephones. LCDs have displaced cathode ray tube (CRT) displays in most applications. They are usually more compact,
  • 13. 6 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 battery- powered 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).
  • 14. 7 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 non- conductive 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 high- volume 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
  • 15. 8 • Full Duplex UART Serial Channel • Low-power Idle and Power-down Modes • Interrupt Recovery from Power-down Mode • Watchdog Timer • Dual Data Pointer • Power-off Flag • Fast Programming Time • Flexible ISP Programming (Byte and Page Mode) 3.2.2 Description 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 Atmel‟s 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. By combining a versatile 8-bit CPU with in-system programmable Flash on a monolithic chip, the Atmel AT89S52 is a powerful microcontroller which provides a highly-flexible and cost-effective solution to many embedded control applications. The AT89S52 provides the following standard features: 8K bytes of Flash, 256 bytes of RAM, 32 I/O lines, Watchdog timer, two data pointers, three 16-bit timer/counters, a six-vector two-level interrupt architecture, a full duplex serial port, on-chip oscillator, and clock circuitry. In addition, the AT89S52 is designed with static logic for operation down to zero frequency and supports two software selectable power saving modes. The Idle Mode stops the CPU while allowing the RAM, timer/counters, serial port, and interrupt system to continue functioning. The Power- down mode saves the RAM contents but freezes the oscillator, disabling all other chip functions until the next interrupt or hardware reset.
  • 16. 9 3.2.3 Pin Diagram The 8051 microcontroller consists of 40 pins. These pins are well represented by the pin- diagram below. Figure- 3.2.3 Pin Diagram of 8052 Microcontroller
  • 17. 10 3.2.4 Pin Description VCC: - +5V Power supply. GND: - Ground. RST (RESET): - Reset input. A high on this pin for two machine cycles while the oscillator is running resets the device. This pin drives high for 98 oscillator periods after the Watchdog times out. The DISRTO bit in SFR AUXR (address 8EH) can be used to disable this feature. In the default state of bit DISRTO, the RESET HIGH out feature is enabled. ALE/PROG: - Address Latch Enable (ALE) is an output pulse for latching the low byte of the address during accesses to external memory. This pin is also the program pulse input (PROG) during Flash programming. In normal operation, ALE is emitted at a constant rate of 1/6 the oscillator frequency and may be used for external timing or clocking purposes. Note, however, that one ALE pulse is skipped during each access to external data memory. If desired, ALE operation can be disabled by setting bit 0 of SFR location 8EH. With the bit set, ALE is active only during a MOVX or MOVC instruction. Otherwise, the pin is weakly pulled high. Setting the ALE-disable bit has no effect if the microcontroller is in external execution mode. PSEN: - Program Store Enable (PSEN) is the read strobe to external program memory. When the AT89S52 is executing code from external program memory, PSEN is activated twice each machine cycle, except that two PSEN activations are skipped during each access to external data memory. EA/VPP: - External Access Enable. EA must be strapped to GND in order to enable the device to fetch code from external program memory locations starting at 0000H up to FFFFH. Note, however, that if lock bit 1 is programmed, EA will be internally latched on reset. EA should be strapped to VCC for internal program executions. This pin also receives the 12-volt programming enable voltage (VPP) during Flash programming. XTAL1: - Input to the inverting oscillator amplifier and input to the internal clock operating circuit. XTAL2: - Output from the inverting oscillator amplifier.
  • 18. 11 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.
  • 19. 12 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
  • 20. 13 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 Atmel‟s 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.
  • 21. 14 Figure-3.2.6 Internal block diagram of 8051 Microcontroller 3.2.7 Memory Architecture The 8051 has two types of memory and these are Program Memory and Data Memory. Program Memory (ROM) is used to permanently save the program being executed, while Data Memory (RAM) is used for temporarily storing data and intermediate results created and used during the operation of the microcontroller. Depending on the model in use (we are still talking about the 8051 microcontroller family in general) at most a few Kb of ROM and 128 or 256 bytes of RAM is used .All 8051 microcontrollers have a 16-bit addressing bus and are capable of addressing64 kb memory. It is neither a mistake nor a big ambition of engineers who were working on basic core development. It is a matter of smart memory organization which makes these microcontrollers a real “programmers‟ goody.
  • 22. 15 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, it‟s 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.
  • 23. 16 Figure-3.2.7 Memory Banks in 8051 Microcontroller 3.2.8 Addressing Modes While operating, the processor processes data as per program instructions. Each instruction consists of two parts. One part describes WHAT should be done, while the other explains HOW to do it. The latter part can be a data (binary number) or the address at which the data is stored. There are 4 types of addressing modes present in 8052 microcontroller. 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.
  • 24. 17 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 16- bit 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.
  • 25. 18 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.
  • 26. 19 Figure-3.3 Voltage Regulator 3.4 Electrolytic Capacitor An electrolytic capacitor is a type of capacitor that uses an electrolyte, an ionic-conducting liquid, as one of its plates, to achieve a larger capacitance per unit volume than other types. They are often referred to in electronics usage simply as "electrolytic". They are used in relatively high-current and low-frequency electrical circuits, particularly in power supply filters, where they store charge needed to moderate output voltage and current fluctuations in rectifier output. They are also widely used as coupling capacitors in circuits where AC should be conducted but DC should not. There are two types of electrolytic; aluminum and tantalum. Structure of a Capacitor A capacitor contains two conductor plates which are generally made of metal and an insulator between 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 with the help of two thin metal rods also known as the legs of the capacitor.
  • 27. 20 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 3.5 Liquid Crystal Display (LCD) A liquid crystal display (LCD) is a thin, flat electronic visual display that uses the light modulating properties of liquid crystals (LCs). LCs do not emit light directly They are used in a wide range of applications, including computer monitors, television, instrument panels, aircraft cockpit displays, signage, etc. They are common in consumer devices such as video players, gaming devices, clocks, watches, calculators, and telephones. LCDs have displaced cathode ray tube (CRT) displays in most applications. They are usually more compact, 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 battery- powered electronic equipment.
  • 28. 21 Figure-3.5 LCD 3.6 Light Emitting Diodes (LED’s) LEDs present many advantages over incandescent light sources including lower energy consumption, longer lifetime, improved robustness, smaller size, faster switching, and greater durability and reliability. LEDs powerful enough for room lighting are relatively expensive and require more precise current and heat management than compact fluorescent lamp sources of comparable output. Figure-3.6 Light-Emitting Diodes (LED‟s)
  • 29. 22 Light-emitting diodes are used in applications as diverse as replacements for aviation lighting, automotive lighting (particularly brake lamps, turn signals and indicators) as well as in traffic signals. The compact size, the possibility of narrow bandwidth, switching speed, and extreme reliability of LEDs has allowed new text and video displays and sensors to be developed, while their high switching 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. 3.7 Infrared Sensors 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.75µm to 1000 µm is the infrared region. Infrared waves are invisible to human eyes. The wavelength region of 0.75µm to 3 µm is called near infrared, the region from 3 µm to 6 µm is called mid infrared and the region higher than 6 µm is called far infrared. (The demarcations are not rigid; regions are defined differently by many). Figure 3.7 infrared sensor There are different types of IR sensors working in various regions of the IR spectrum but the physics behind "IR sensors" is governed by three laws: 1. Plank’s radiation law: Every object at a temperature T not equal to 0 K emits radiation. Infrared radiant energy is determined by the temperature and surface condition of an object. Human eyes cannot detect
  • 30. 23 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 3. Wein‟s Displacement Law Wein‟s Law tells that objects of different temperature emit spectra that peak at different wavelengths. It provides the wavelength for maximum spectral radiant emittance for a given temperature. The relationship between the true temperature of the black body and its peak spectral existence or dominant wavelength is described by this law The world is not full of black bodies; rather it comprises of selectively radiating bodies like rocks, water, etc. and the relationship between the two is given by emissivity (E). Emissivity depends on object color, surface roughness, moisture content, degree of compaction, field of view, viewing angle & wavelength. 3.7.1 Elements of Infrared Detection System A typical system for detecting infrared radiation is given in the following block diagram: Figure-3.7.1 Infrared detection system
  • 31. 24 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)
  • 32. 25 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 signal- processing 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
  • 33. 26 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) Figure-3.7.2.1 Break beam sensor • Reflectance Sensors This type of sensors house both an IR source and an IR detector in a single housing in such a way that light from emitter LED bounces off an external object and is reflected into a detector. Amount of light reflected into the detector depends upon the reflectivity of the surface. This principle is used in intrusion detection, object detection (measure the presence of an object in the sensor‟s FOV), barcode decoding, and surface feature detection (detecting features painted, taped, or otherwise marked onto the floor), wall tracking (detecting distance from the wall), etc. Figure-3.7.2.2 Reflectance sensor It can also be used to scan a defined area; the transmitter emits a beam of light into the scan zone, the reflected light is used to detect a change in the reflected light thereby scanning the desired zone. 2. Passive Infrared Sensors These are basically IR detectors; they don‟t use any IR source. These form the major class of IR sensors/detectors. A passive infrared system detects energy emitted by objects in the field of view and may use signal-processing algorithms to extract the desired information. It does not emit any energy of its own for the purposes of detection. Passive infrared systems can
  • 34. 27 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 don‟t 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.
  • 35. 28 • 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
  • 36. 29 • 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  Quad Band GSM/GPRS : 850 / 900 / 1800 / 1900 MHz  Built in RS232 to TTL or vice versa Logic Converter (MAX232)  Configurable Baud Rate  SMA (Sub Miniature version A) connector with GSM L Type Antenna  Built in SIM (Subscriber Identity Module) Card holder  Built in Network Status LED  Inbuilt Powerful TCP / IP (Transfer Control Protocol / Internet Protocol) stack for  internet data transfer through GPRS (General Packet Radio Service)  Audio Interface Connectors (Audio in and Audio out)
  • 37. 30  Most Status and Controlling pins are available  Normal Operation Temperature : -20 °C to +55 °C  Input Voltage : 5V to 12V DC Hardware Description Figure-3.8.1 GSM Module SIMCOM SIM900A GSM Module This is actual SIM900 GSM module which is manufactured by SIMCOM. Designed for global market, SIM900 is a quad-band GSM/GPRS engine that works on frequencies GSM 850MHz, EGSM 900MHz, DCS 1800MHz and PCS 1900MHz. SIM900 features GPRS multi slot class 10/ class 8 (optional) and supports the GPRS coding schemes CS-1, CS-2, CS-3 and CS-4. With a tiny configuration of 24mm x 24mm x 3mm, SIM900 can meet
  • 38. 31 almost all the space requirements in User‟s applications, such as M2M, smart phone, PDA and other mobile devices. Figure -3.8.1 SIMCOM SIM900A GSM Module MAX232 IC 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). Figure-3.8.2 MAX232 IC Serial port / DB9 connector: User just needs to attach RS232 cable here so that it can be connected to devices which have Serial port / DB9 Connector.
  • 39. 32 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 math‟s- 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.
  • 40. 33 SIM (Subscriber Identity Module) Card Slot: This onboard SIM card slot provide User functionality of insert a SIM (GSM only) card of any service provider. Process of inserting and locking SIM card into SIM card slot is given in this manual. While inserting in and removing out SIM card from SIM card slot, User needs to take precaution that power supply should be OFF so that after making Power supply ON it will be easy to reinitialize with SIM for this module. Figure-3.8.3 SIM Slot
  • 41. 34 Chapter – 4 PROJECT DETAILS 4.1 Block diagram Figure-4.1 Block Diagram of GSM Home Security System
  • 42. 35 4.2 Working of GSM Home Security System Home/ Bank/ Office security has been a major issue where crime is increasing and everybody wants to take proper measures to prevent intrusion. In addition there was a need to automate home so that user can take advantage of the technological advancement in such a way that a person getting off the office does not get melted with the hot climate. Detecting Obstacle with IR (Infrared) Sensor The basic concept of IR (infrared) obstacle detection is to transmit the IR signal(radiation) in a direction and a signal is received at the IR receiver when the IR radiation bounces back from a surface of the object. Figure- 4.2.1 IR Sensor Detection Process Here in the figure the object can be anything which has certain shape and size, the IR LED transmits the IR signal on to the object and the signal is reflected back from the surface of the object. The reflected signals are received by an IR receiver. The IR receiver can be a photodiode /photo transistor or a readymade module which decodes the signal. In order to implement the IR obstacle detection, we need to understand the following  We need to understand how to transmit IR signal using commercially available electronic components.  Same way we also need to understand the IR receiver.
  • 43. 36 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. Figure -4.2.2 IR Directivity Also remember, that a thick enclosure is necessary for both IR transmitter and IR receiver, because the IR radiation may bounce back from the surrounding objects which may not help when you want to detect obstacle in one direction. Sometimes, if you don‟t have a thick enclosure then the signal may directly reach the receiver even without having an obstacle.
  • 44. 37 4.3 Working of GSM Module The GSM modem is slightly different from the conventional modem. This utilizes the GSM standard for cellular technology. Here, one end being a wired connection, receives and transmits data. The other end is connected to a RF antenna. The GSM modem acts like a cellular phone and transmits text and voice data. It communicates with the GSM network via the SIM (Subscriber‟s Identity Module) card. The Global System for Mobile Communications (GSM: originally from Grouper Special Mobile) is the most popular standard for mobile phones in the world. GSM service is used by over 2 billion people across more than 212 countries and territories. The ubiquity of the GSM standard makes international roaming very common between mobile phone operators, enabling subscribers to use their phones in many parts of the world. GSM differs significantly from its predecessors in that both signaling and speech channels are Digital call quality, which means that it is considered a second generation (2G) mobile phone system. This fact has also meant that data communication was built into the system from the 3rd Generation Partnership Project (3GPP). When any object is detected by IR sensor then it sends the command to the microcontroller and now microcontroller send the command to the GSM module .GSM module have a SIM card, with the help of SIM card GSM module send the SMS on give mobile number which is already programmed in the microcontroller. 4.4 Application The applications of SMS/GSM Based security system are quite diverse. There are many real life situations that require control of different devices remotely and to provide security. There will be instances where a wired connection between a remote appliance/device and the control unit might not be feasible due to structural problems. Major areas where it is used as Anti-Theft Reporting When someone break in , Home-Guard uses GSM network to report automatically to5 preset numbers: short message for control center, short message for 3 pre-stored mobile phone, and 1 voice call. The owner can monitor or talk to the thief.
  • 45. 38 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 pre- stored 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.
  • 46. 39 Chapter – 5 CHARACTERISTICS & STRENGTHS 5.1 Characteristics & Strengths The proposed system characteristics involve remote controlling of appliances, intrusion detection, system security and auto-configuration such that system automatically adjusts the system settings on running hardware support check. The system has useful features such as displaying of battery level, charging status and signal strength of the mobile thus making system reliable.  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.  The ease of deployment is due to wireless mode of communication.  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.
  • 47. 40 Chapter – 6 CONCLUSION AND FUTURE SCOPE In the paper low cost, secure, ubiquitously accessible, auto-configurable, remotely controlled solution for automation of homes has been introduced. The approach discussed in the paper is novel and has achieved the target to control home appliances remotely using the SMS-based system satisfying user needs and requirements.GSM technology capable solution has proved to be controlled remotely, provide home security and is cost-effective as compared to the previously existing systems. Hence we can conclude that the required goals and objectives of our project have been achieved. The basic level of home appliance control and remote monitoring has been implemented. The system is extensible and more levels can be further developed using automatic motion/glass breaking detectors so the solution can be integrated with the send other detection systems. In future the system will be small box combining the PC and GSM modem. The hardware will be self contained and cannot be prone to electric failure. This appliance will have its own encapsulated UPS and charging system
  • 48. 41 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.
  • 49. 42 LIST OF FIGURES Figure No. Page No. Figure-2.1 Simple Architecture of GSM home security system 4 Figure-3.2.3 Pin Diagram of 8052 Microcontroller 9 Figure-3.2.6 Internal block diagram of 8051 Microcontroller 14 Figure-3.2.7 Memory Banks in 8051 Microcontroller 16 Figure-3.3 Voltage Regulator 19 Figure-3.4 Capacitor 20 Figure-3.5 LCD 21 Figure-3.6 Light-Emitting Diodes (LED’s) 21 Figure-3.7 infrared sensor 22 Figure-3.7.1 Infrared detection system 23 Figure-3.7.2.1 Break beam sensor 26 Figure-3.7.2.2 Reflectance sensor 26 Figure-3.8.1 GSM Module 30 Figure-3.8.1 SIMCOM SIM900A GSM Module 31 Figure-3.8.2 MAX232 IC 31 Figure-3.8.3 SIM Slot 33 Figure-4.1 Block Diagram of GSM Home Security System 34 Figure-4.2.1 IR Sensor Detection Process 35 Figure-4.2.2 IR Directivity 36
  • 50. 43 CODING 1.Code to Detect Obstacle using IR (Infrared) Sensor #include "E:WinAVR-20080512avrincludeavrio.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++;}}
  • 51. 44 /* Deactivate OCR2 wave generation */ DDRD = DDRD & 0x7F; /* if (r_count >5) { /* ON LED */ PORTB = PORTB & 0x1; /* Delay while the LED is ON */ millisecond_delay(200); /* OFF LED */ PORTB = PORTB & 0xFE;} /* Initialize IR receiver count */ r_count = 0; /* Delay to keep maintain the OFF state of the IR transmitter */ millisecond_delay(90); } return 0;} void millisecond_delay(unsigned int count) { unsigned int i =0; unsigned int j = 0; do { /*One millisecond delay The delay is measured for 8 Mhz crystal */ for (i=0;i<=400;i++) { /* delay */} j++; }while(j<count); }
  • 52. 45 2.Program to Interface GSM Module with (AT89S52) Microcontroller #include<reg52.h> #define port P1 #define dataport P2 sbit rs = port^2; sbit rw = port^3; sbit en = port^4; int count,i; unsigned char check,str[15]; bit check_space; 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++);
  • 53. 46 } void lcd_cmd(unsigned char item) { dataport = item; rs= 0; rw=0; en=1; delay(1); en=0; return; } void lcd_data(unsigned char item) { dataport = item; rs= 1; rw=0; en=1; delay(1); en=0; return;
  • 54. 47 } void lcd_data_string(unsigned char *str) { int i=0; while(str[i]!='0') { lcd_data(str[i]); i++; delay(10); } return; } void lcd() { lcd_cmd(0x38); delay(5); lcd_cmd(0x0F); delay(5); lcd_cmd(0x80); delay(5); }
  • 55. 48 void transmit_data(unsigned char str) { SBUF=str; while(TI==0); } void receive_data() interrupt 4 { RI=0; str[++count]=SBUF; } unsigned char byte_check() { switch(str[0]) { case 0x0a: { return 0x00; break ;
  • 56. 49 } 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);