report on embedded based home security system
DESCRIPTION
Report on Embedded Based Home security system using GSM technology & AT89S52TRANSCRIPT
1 | P a g e
NATIONAL INSTITUTE OF TECHNOLOGY
SRINAGAR
A
Seminar Report
On
“EMBEDDED BASED HOME SECURITY SYSTEM”
By
Jitendra Kumar
416/11
DEPARTMENT OF
ELECTRONICS &COMMUNICATION ENGINEERING
2 | P a g e
CONTENTS
Introduction
General Architecture
Various Components
Working
Applications
Advantages
Future Scope
Conclusion
References
3 | P a g e
INTRODUCTION
When we talk about the security the one thing come in mind that whether our home is
secure or not. Our home has always important documents, money and other precious things,
that need to be protected from the intruders or thieves.
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. 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. Thus, a feasible system should be effective, practical and reasonable in cost. In
this report, we proposed an integrated based home security system, consisting an IR sensor
and GSM Module.
4 | P a g e
GENERAL ARCHITECTURE
The proposed general architecture incorporates subsystems IR sensors, GSM 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-1 Simple Architecture of GSM home security system
5 | P a g e
Overview of Components Used in Architecture
AT89S52 Microcontroller
LCD Display
IR Sensor
GSM Module
LED
MAX232 IC
6 | P a g e
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 non-volatile memory technology and is compatible with the industry standard
80C51 instruction set and pinout. The on-chip Flash allows the program memory to be
reprogrammed in-system or by a conventional non-volatile memory programmer. 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:
Features
8K bytes of Flash,
256 bytes of RAM,
32 I/O lines, Watchdog timer,
2 data pointers,
Three 16-bit timer/counters,
A six-vector two-level interrupt architecture,
A full duplex serial port,
On-chip oscillator,
4.0V to 5.5V Operating Range
7 | P a g e
Pin Diagram
The 8051 microcontroller consists of 40 pins. These pins are well represented by the pin
diagram below.
Figure- 2 Pin Diagram of 8052 Microcontroller
8 | P a g e
Pin Description
Pin No Function Name
1 External count input to Timer/Counter 2, clock-out T2 P1.0
2 Timer/Counter 2 capture/reload trigger and direction
control T2 EX P1.1
3
8 bit input/output port (P1) pins
P1.2
4 P1.3
5 P1.4
6 P1.5
7 P1.6
8 P1.7
9 Reset pin; Active high Reset
10 Input (receiver) for serial
communication RxD
8 bit input/output port (P3) pins
P3.0
11 Output (transmitter) for serial
communication TxD P3.1
12 External interrupt 1 Int0 P3.2
13 External interrupt 2 Int1 P3.3
14 Timer1 external input T0 P3.4
15 Timer2 external input T1 P3.5
16 Write to external data memory Write P3.6
17 Read from external data memory Read P3.7
18 Quartz crystal oscillator (up to 24 MHz)
Crystal 2
19 Crystal 1
20 Ground (0V) Ground
21
8 bit input/output port (P2) pins
/ High-order address bits when interfacing with external memory
P2.0/ A8
22 P2.1/ A9
23 P2.2/ A10
24 P2.3/ A11
25 P2.4/ A12
26 P2.5/ A13
27 P2.6/ A14
28 P2.7/ A15
29 Program store enable; Read from external program memory PSEN
30 Address Latch Enable ALE
Program pulse input during Flash programming Prog
31 External Access Enable; Vcc for internal program executions EA
Programming enable voltage; 12V (during Flash programming) Vpp
32
8 bit input/output port (P0) pins
Low-order address bits when interfacing with external memory
P0.7/ AD7
33 P0.6/ AD6
34 P0.5/ AD5
35 P0.4/ AD4
36 P0.3/ AD3
37 P0.2/ AD2
38 P0.1/ AD1
39 P0.0/ AD0
40 Supply voltage; 5V (up to 6.6V) Vcc
9 | P a g e
Internal Block Diagram of 8051 Microcontroller
Figure-3 Internal block diagram of 8051 Microcontroller
Memory Architecture
The 8051 has two types of memory and these are Program Memory and Data Memory. All
8051 microcontrollers have a 16-bit addressing bus and are capable of addressing 64 kb
memory.
Program Memory: - Program Memory (ROM) is used to permanently save the program
being executed
Data Memory: - Data Memory is used for temporarily storing data and intermediate results
created and used during the operation of the microcontroller
10 | P a g e
Figure-4 Memory Banks in 8051 Microcontroller
Special Function Registers (SFRs)
Special Function Registers (SFRs) are a sort of control table used for running and monitoring
the operation of the microcontroller.
A Register (Accumulator)
A register is a general-purpose register used for storing intermediate results obtained during
operation. 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.
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.
11 | P a g e
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). They are used in a wide range of applications,
including computer monitors, television, instrument panels, aircraft cockpit displays 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. 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.
Figure-5 LCD
12 | P a g e
Infra-Red Sensor (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. 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.
Figure- 6 infrared sensor
Infrared radiation is the portion of electromagnetic spectrum having wavelengths longer
than visible light wavelengths, but smaller than microwaves, i.e., the region roughly from
0.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).
13 | P a g e
Voltage Regulator
A Voltage Regulator is an electrical regulator designed to automatically maintain a
constant voltage level. Depending on the design, it may be used to regulate one or more AC
or DC voltages. A basic voltage regulator LM7805 has three legs, converts varying input
voltage and produces a constant regulated output voltage.
Figure-7 Voltage Regulator
14 | P a g e
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-8 Light-Emitting Diodes (LED‟s)
15 | P a g e
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).
Figure-9 GSM Module
16 | P a g e
Features
Quad Band GSM/GPRS : 850 / 900 / 1800 / 1900 MHz
Built in RS232 to TTL or vice versa Logic Converter (MAX232)
Configurable Baud Rate
Built in Network Status LED
Input Voltage : 5V to 12V D
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.
Figure-10 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.
17 | P a g e
SIM (Subscriber Identity Module) Card Slot:
This on board SIM card slot provides 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-11 SIM Slot
18 | P a g e
Circuitry in proper way
Figure- 12 GSM Based Home Security System
19 | P a g e
WORKING
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- 13 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.
20 | P a g e
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 -14 IR Directivity
21 | P a g e
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.
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 differs significantly from its predecessors in
that both signalling 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
22 | P a g e
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 to 5
pre-set numbers: short message for control centre, short message for 3 pre-stored mobile
phone, and 1 voice call. The owner can monitor or talk to the thief.
It has 8 security region codes. 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 centre, 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 pre-set phone numbers
immediately.
23 | P a g e
Advantages
Worldwide Roaming: - 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 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
FUTURE SCOPE
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.
24 | P a g e
CONCLUSION
Low cost, secure, ubiquitously accessible, auto-configurable, remotely controlled
solution for automation of homes has been introduced. GSM technology capable solution has
proved to be controlled remotely, provide home security and is cost-effective as compared to
the previously existing systems. The basic level of home appliance control and remote
monitoring has been implemented.
25 | P a g e
REFERENCES
Mazidi, “The 8051 Microcontroller and Embedded Systems.
http://www.gsm-modem.de/gsm-module.html
http://www.gsm-modem.de/gsm-module.html
http://www.atmel.com/devices/at89s52.aspx