Upload
others
View
5
Download
0
Embed Size (px)
Citation preview
WIRELESS BASED HOME SECURITY WITH AUTOMATION SYSTEM
WAN NORZIELA BINTI WAN ROSLI
This thesis is submitted as partial fulfillment of the requirements for the award of the
Bachelor of Electrical Engineering (Electronics)
Faculty of Electrical & Electronics Engineering
Universiti Malaysia Pahang
NOVEMBER, 2010
ii
“I hereby acknowledge that the scope and quality of this thesis is qualified for the
award of the Bachelor Degree of Electrical Engineering (Electronics)”
Signature : ______________________________________________
Name : NIK MOHD KAMIL NIK YUSOFF
Date : 11 NOVEMBER 2010
iii
“All the trademark and copyrights use herein are property of their respective owner.
References of information from other sources are quoted accordingly; otherwise the
information presented in this report is solely work of the author.”
Signature : ____________________________
Author : WAN NORZIELA BINTI WAN ROSLI
Date : 11 NOVEMBER 2010
v
ACKNOWLEDGEMENT
In the name of Allah, the most Beneficent and most Merciful.
First at all, Alhamdulillah, thanks to Allah S.W.T for HIS bless, guidance and
for the strength that keep I standing to finish my final year project and thesis. I would
like to express my deep and sincere gratitude to my supervisor, Assoc. Mr. Nik
Mohd Kamil Bin Nik Yusoff. His wide knowledge and his logical way of thinking
have been of great value for me. I am deeply grateful to him for his detailed review,
constructive criticism and excellent advice during the preparation of this thesis.
Many thanks are given to my fellow friends for the valuable technical and
Scientific discussions, feasible advices and various kinds of help. I owe my loving
thanks to my parents for all their moral support and financial support during this
project. Lastly, I would like to thank to all the people who had helped me to
accomplish this Final Year Project.
May Allah bless you all. Thank you.
Wan Norziela Wan Rosli
vi
ABSTRACT
The aim of the project is to design a wireless based home security with
automation system. The system uses wireless technology to revolutionize the
standards of living which could give assurance for user to protect their homes from
burglars, thieves and criminals. This project is so versatile and is equipped with
various sensors such as passive infrared sensor, magnetic switch sensor and vibration
sensor to detect different forms of intrusion. A microcontroller is used to control the
system operation while a remote gadget is used to arm and disarm the system. To
ensure only the authorized user can operate the system, the gadget is equipped with a
password. Various indication outputs such as BUZZER, LED and LCD are used to
display the alarm status. In addition, the sound indicators like siren are also included
in the design to inform intrusion. Due to the consideration of user-friendliness,
portability as well as wider-area coverage, all the sensors and remote gadget are
implemented using zigbee transceiver. A backup battery module is also introduced in
the design to ensure the system keep functioning even during power failure.
vii
ABSTRAK
Projek ini bertujuan untuk menghasilkan sebuah sistem keselamatan tanpa
wayar dengan kelengkapan sistem automasi. Sistem ini menggunakan teknologi
tanpa wayar yang mengesyorkan satu revolusi kehidupan yang menawarkan satu
jaminan keselamatan bagi pengguna untuk melindungi rumah mereka dari perompak,
pencuri dan penjahat. Projek serba boleh ini dilengkapi dengan pelbagai jenis
pengesan seperti pengesan pasif infra merah, pengesan suis magnet dan pengesan
getaran untuk mengesan sebarang bentuk pencerobohan. Pengawal mikro digunakan
untuk mengawal keseluruhan sistem operasi sementara alat kawalan jauh digunakan
untuk mengaktifkan sistem. Bagi memastikan hanya pengguna yang sah boleh
mengawal sistem, alat kawalan jauh ini dilengkapi dengan kata laluan. Beberapa
output seperti BUZZER, LED dan LCD digunakan untuk mempamerkan status
semasa dan tanda bunyi seperti siren digunakan untuk memberitahu pencerobohan.
Semua pengesan dan alat kawalan jauh di hubungkan tanpa wayar dengan
menggunakan teknologi zigbee supaya sistem keselamatan ini menjadi lebih mudah
digunakan oleh pengguna, mudah alih dan dapat melindungi kawasan yang lebih
luas. Begitu juga sistem ini dilengkapi dengan bateri sokongan untuk memastikan
sistem berfungsi walaupun semasa kegagalan sistem bekalan kuasa.
TABLE OF CONTENTS
DECLARATION OF THESIS STATUS
TITLE
DECLARATION BY SUPERVISOR ii
DECLARATION iii
DEDICATION iv
ACKNOWLEDGEMENT v
ABSTRACT vi
ABSTRAK vii
TABLE OF CONTENT viii
LIST OF FIGURES xii
LIST OF TABLES xv
LIST OF ABBREVIATIONS xvi
LIST OF SYMBOL xvii
LIST OF APPENDICES xviii
CHAPTER PAGE
1. INTRODUCTION
1.1 Introduction 1
1.2 Objective 3
1.3 Scope of Project 3
1.4 Thesis Outline 4
2. LITERATURE RIVIEW
2.1 Introduction 5
2.2 Zigbee Technology and Previous Research 5
3. ARCHITECTURE OF THE WIRELESS BASED HOME SECURITY
WITH AUTOMATION SYSTEM
3.1 Introduction 13
3.2 Microcontroller Module 15
3.3 LCD Module 18
3.4 Sound indicator module 19
3.5 Sensor Module 20
3.6 Zigbee Transceiver Modules 22
3.7 Backup Battery Module 23
3.8 Remote Gadget Module 24
3.9 Home Appliances 25
4. HARDWARE DESIGN
4.1 Hardware 26
4.2 Microcontroller Module 26
4.2.1 PIC18F4550 27
4.2.2 PIC16F628A 29
4.2.4 Power supply 31
4.2.4 Clock Circuit 32
4.2.5 Reset Circuit 33
4.3 Sensor Module 34
4.3.1 Magnetic Contact (Sensor) 34
4.3.2 Passive Infrared Sensor 35
4.3.3 Vibration Sensor 37
4.4 Liquid Crystal Display (LCD Module) 38
4.5 Sound Indicator Module 39
4.5.1 Buzzer 39
4.5.2 Siren Module 41
4.6 Backup Power Supply Module 42
4.7 High Voltage circuit for lamp 43
4.8 Driver Circuit for Fan 44
4.9 Wireless module 45
4.10 Remote Gadget Module 47
5. SOFTWARE DEVELOPMENT
5.1 Introduction 48
5.2 Microcontroller Module Testing 49
5.3 LCD Module Testing 50
5.4 Sensors and Sound Indicators Modules Testing 51
5.5 Wireless Module Testing 52
5.6 Security System Testing 54
5.7 Remote Gadget Module Testing 56
6. TESTING AND RESULT
6.1 Testing and Result 57
6.2 Microcontroller Module Testing 58
6.3 LCD Module Testing 60
6.4 Sensors and Sound Indicators Modules Testing 62
6.5 Wireless Module Testing 71
6.6 Remote Gadget Module Testing 72
6.6 Security System Testing 76
7. CONCLUSION AND RECOMMENDATION
7.1 Conclusion 77
7.2 Recommendation 78
7.3 Cost and Commercialization 79
REFERENCES 80
APPENDICES A-D 82
LIST OF FIGURES
FIGURE NO. TITLE PAGE
2.1 Topology of zigbee network 6
2.2 Security System 7
2.3 Home automation 8
2.4 The structure of home security system 9
2.5 Block diagram 10
2.6 Communication Architecture of BestariHome 12
3.1 The block diagram of WYSAS 14
3.2 DIP package Microcontroller 16
3.3 PLCC package of PIC18f4550 Microcontroller 16
3.4 Block diagram of both microcontroller board modules
a) PIC18F4550 b) PIC16F628A 17
3.5 LCD Module 18
3.6 The Buzzer and Siren Module 19
3.7 The Magnetic Switch Sensor 20
3.8 The Passive Infrared (PIR) Sensor 21
3.9 The Vibrate Sensor 21
3.10 XBee OEM RF Module 22
3.11 Breakout Board for Xbee Module 22
3.12 The 9V dc Rechargeable Battery 23
3.13 Remote Gadget Module 24
3.14 Block Diagram of Home Automation 25
4.1 The Microcontroller PIC18F4550 Pin Configuration 29
4.2 The Microcontroller PIC16F628A Pin Configuration 30
4.3 Power Supply Circuit 31
4.4 Clock Circuit 32
4.5 Reset Circuit 33
4.6 Magnetic Switch Sensor Circuit 35
4.7 The Coverage of the PIR sensor 36
4.8 Connection of PIR Sensor 36
4.9 Connection of the Vibrate Sensor 37
4.10 Connection of LCD Module with Microcontroller 38
4.11 Connection of Buzzer with Microcontroller 40
4.12 Siren Circuit 41
4.13 Backup Power Supply Module 42
4.14 DC controlled Solid State Relay 43
4.15 Driver circuit for 9V motor 44
4.16 Connection of the Transceiver at Master 45
4.17 Connection of the Transceiver at Slave 46
4.18 Connection of microcontroller and keypad 47
5.1 LED Blinking for Microcontroller Module Testing 49
5.2 LCD Module Testing 50
5.3 Sensors and Siren Module Testing 51
5.4 Wireless Module Testing 55
5.5 Security System Flow Diagrams 52
5.6 Remote Gadget Module Testing 56
6.1 Hardware Connections for Microcontroller
Module Testing 58
6.2 Microcontroller Module Testing Code 59
6.3 LEDs display the result of $FF 59
6.4 Connection for LCD Module Testing 60
6.5 LCD Module Testing Code 61
6.6 Magnetic Switch Sensor 63
6.7 The Snapshot of Magnetic Sensor Testing 63
6.8 Passive Infrared (PIR) Sensor 64
6.9 The Snapshot of PIR Sensor Testing 64
6.10 Vibrate Sensor connection 65
6.11 The Snapshot of vibrate Sensor Testing 65
6.11 The program for the each sensor 66
6.11 Hardware Connection for Main Microcontroller
and Siren Module 67
6.12 The Snapshot of the Main controller 68
6.13 The Program at Main Controller 70
6.14 Result of the Wireless Module Testing 71
6.15 Connections of Keypad 72
6.16 The snapshot result of Lighting ON after keypad press 73
6.17 The program of keypad 74
6.18 The Program at High Voltage Circuit 75
xv
LIST OF TABLES
FIGURE NO. TITLE PAGE
5.1 Possible Conditions Encountered by the Security System 54
xvi
LIST OF ABBREVIATIONS
EEPROM Electrical Erasable Programmable ROM
GPRS General Packet Radio Service
GSM Global System for Mobile Communication
IR Infrared
LCD Liquid Crystal Display
LED Light Emitted Diode
MAC Medium Access Layer
MCU Microcontroller Unit
MOSFET Metal–Oxide–Semiconductor Field-Effect Transistor
PC Personal computer
PHY Physical Layer
PIR Passive Infrared
PMP Property Management Person
RF Radio Frequency
SCI Asynchronous Serial Communication Interface
SMS Short Message Service
SPI Synchronous Serial Peripheral Interface
WYSAS
Wireless Based Home Security with Automation
System
xvii
LIST OF SYMBOLS
Gnd 0 Volt Ground
Rx Receive
Tx Transmit
V Volts
VDD +5 Volts Direct Current
xviii
LIST OF APPENDICES
APPENDIX TITLE PAGE
A Schematic Circuit Diagram 82
A1 Security System Circuit at Main Microcontroller 83
A2 Magnetic Switch Sensor 84
A3 Passive Infrared (PIR) Sensor 85
A4 Vibrate Sensor Circuit 86
A5 Circuit at Remote Gadget 87
A6 High voltage & motor circuit 88
B Program 89
B1 Master Module full program 90
B2 Magnetic sensor program 93
B3 PIR sensor program 94
B4 Vibration sensor program 95
B5 home automation program 96
B6 Program at Remote Gadget 98
C Datasheets 99
E Result Images
1
CHAPTER 1
INTRODUCTION
1.1 Introduction
Nowadays, the most common threat to home resident is burglary. Millions of
Ringgit are lost in each day. By definition, the crime of burglary is breaking and
entering a residence for the intention of committing a crime or while lawfully within,
commit a crime and to thereafter break out, usually crime that occurs when
homeowner are not at home. A crime reduction adviser is suggesting that
homeowners should spend money investing on security measures, which could to
guard the place from intrusion [1].
Home security system is necessary in order to enhance the occupants,
convenience and safe environment from any in invasion [2]. All the home security
systems are designed to achieve the same purpose – to thwart a break-in attempt. The
most basic of all of the types of the home security system is the simple electric
circuit built into an entry way alarm. Some home security systems are wired to all
potential entries into the home, including doors and windows. In a more exhaustive
way, a basic home security system is often system consists of intrusion detectors, a
control panel, and a triggered-on siren. The intrusion detectors or more commonly
2
known as intrusion sensors, include magnetic switch, passive infrared sensor, and
vibration sensor.
However, one very familiar problem related to a home security system is the
tendency of alarm. If the occupants live in an area with high crime rates or in a rural
area with few or no neighbours and travel frequently, the homeowner should
consider a more complete and flexible home alarm security. Thus, the home security
should also consider the zone of coverage of the system. The connection mode, home
security network can be classified into two kinds whether wireless network and non-
wireless. However, for the latter technology, the coverage is encapsulated to several
meters. In addition, the drilling and wall hacking during alarm installation are
definitely a frustrating experience. To make it worst the alarm has been installed, the
limitation of the re-localize some of its components is relatively uneasy. The cost of
installing a whole security system could achieve around a thousand of Ringgit
Malaysia [3] [4].
The aim of the project is to implement the wireless based home security
featuring automation system. The system is equipped with several sensors nodes that
may include such as passive infrared sensor, magnetic switch sensor, and vibration
sensor to detect different forms of intrusion. PIC18F4550 microcontroller is
embedded in the master node to control the system operation. In addition, various
indication outputs such as LED and Liquid Crystal Display (LCD) are used to
display the alarm status, and sound indicators like buzzer, and siren are used to
inform intrusion that are applied in the design. Due to the consideration of user-
friendliness, portability as well as wider-area coverage, passive infrared sensor is
implemented using zigbee wireless technology. To make the system versatile and
handy, a handheld remote device is designed for the user to arm and disarm the
system. The remote also can be used to active any devices such as lamp, fan or gate
and trigger an alarm if suspicious visitors are existed or when the user feel threat or
insecure. A backup battery module is used allow the system function during power
failure.
3
1.2 Project Objective
The objective of this project is to design a zigbee based home security
featuring automation system. The system uses this new wireless technology to
revolutionize the standards of living which could provide assurance for user to
protect their homes from burglars, thieves and criminals. The system consists of
various sensors such as passive infrared sensor, smoke detector, magnetic switch
sensor and motion detector to detect the possibly of intrusion. This system provides
ideal solution to the problems faced by home owners in daily life. . In addition, the
Zigbee-based system offers home automation feature to allow user to control home
devices remotely.
1.2 Project Scope
There are a few scopes and guidelines are listed to ensure the project can be
accomplished. They include:
The system should be portable and easy to be operated
The system should be reliable and efficient.
The system offers various types of sensors to suit the location or
environment.
To build a compact remote gadget to control several home devices
4
1.3 Thesis Outline
This thesis is divided into six chapters. The contents of each chapter are
summarized as below.
Chapter 1 an introduction where it discusses the current technology of
wireless security system. This chapter consists the overview of the objective and
scope of the project. It also summarizes the content of the thesis.
Chapter 2 elaborates the recent research on the technology. It emphasizes the
role of zigbee in various applications.
Chapter 3 explains the system architecture and operation of the wireless
based home security. It describes briefly the hardware components used in this
project.
Chapter 4 discusses the details of hardware design of each module. The
connections of hardware are shown in circuit schematic diagram.
Chapter 5 discusses the development of the software. Each module is
explained in detail to provide better perspective of the system.
Chapter 6 shows and emphasizes the testing and result of the project. Each
module is tested independently before they are combined into a system. Testing and
result that obtained from this project will be discussed in great details.
Chapter 7 provides the conclusion of the project progress. It also discusses
the future recommendation to improve the system performance.
5
CHAPTER 2
LITERATURE REVIEW
2.1 Introduction
This chapter will elaborate the recent research on the new technology. It
emphasizes the role of zigbee in many applications. Research and findings have been
conducted in order to design and develop Wireless Based Home Security With
Automation System (WYSAS) that will suit the aims and objective in this project.
Several of the existing researches conducted the same field that will give inspiring
ideas of designing and developing WYSAS.
2.2 Zigbee Technology and Previous Research
Currently, the implementation of wireless technologies increased with the
rapid expansion. There are various wireless technologies available, for example
Bluetooth, Infrared (IR), Radio Frequency (RF) and other which have been explored
by the most people in modern society. However, currently many of the wireless
sensor network systems are now using ZigBee to employ the designs. ZigBee is
created to satisfy the market's need for a cost-effective, standards-based wireless
networks that support low data rates, low power consumption, security, robustness
6
and reliability [6]. The major applications that offered by ZigBee focus on sensor and
automatic control, such as military application, industrial control, smart buildings
and environment monitoring.
The ZigBee protocol uses the IEEE 802.15.4-2003 specification as its
Medium Access Layer (MAC) and Physical Layer (PHY). The ZigBee protocol
wireless network support three types of configurations such as star topology, tree
topology and mesh topology. In a star topology, the network is controlled by one
single device called the ZigBee coordinator. The ZigBee coordinator is responsible
for initiating and maintaining the devices on the network, and all other devices,
known as end devices, directly communicate with the ZigBee coordinator. In mesh
and tree topologies, the ZigBee coordinator is responsible for starting the network
and for choosing certain key network parameters but the network may be extended
through the use of ZigBee routers. In tree networks, routers move data and control
messages through the network using a hierarchical routing strategy. Mesh networks
shall allow full peer-to-peer communication [7, 16]. Figure 2.1 shows the topology
of zigbee network.
Figure 2.1: Topology of zigbee network
ZigBee technology and the Home Automation profile provide interoperability
from different vendors that allow a greater range of control and integration of
different devices in the home. For example, a home security system, along with its
basic monitoring functions can be expanded to provide status and control of home
lighting when entering and exiting a home.
7
According to [8] [16], ZigBee technology offers a multi-hop communication
capability for data transfer. Multi-hop communication will provide unlimited range
of communication for the system as long as there are intermediate nodes that will
pass the data from one node to another until it reaches the destination. In [8], it
introduces the conceptual understanding and strategy of ZigBee IEEE 802.15.4
standard to be deployed in smart home environment. It offers two importance
features of a smart home; home security and home automation. In home security, the
hardware implementation consists of the development of the main controller, sensor
nodes and the smart home sensor network. The main controller is equipped with a
GSM modem that is used to send and receive SMSes. If any one of the sensor node is
triggered, it will send an alert signal to the main controller through the intermediate
nodes using multi-hop communication. When the main controller receives the alert
signal, it will then send the alert signal to the user by using SMS via the GSM
Modem which is attached to the main controller. Figure 2.2 shows the operation of
this built home security system.
Figure 2.2: Security System