Design and Implementation of Home Security System Using Zigbee & Arduino Controller With Sensors
Design and Implementation of Home Security System Using Zigbee & Arduino Controller With Sensors
Mohammed F. Abdulqader
Department of Electrical, College of Engineering, Kirkuk University, Kirkuk, Iraq
[email protected]
ABSTRACT
The purpose of this research is to design a home security system using Zigbee and
Arduino controllers with number of sensors. The security system is widely used at home,
institutes and factories. Zigbee is a communication protocol which is based on “IEEE
802.15.4 standard”. The physical and medium access control layers are defined by this
standard. Three communication topology type are supported by Zigbee; they are: mesh, star
and tree. Zigbee technology is characterized as having a low data rate, low power
consumption and low cost. Arduino platform has good specifications, cheap, easy to use and
wide varieties of shields have been emerged with many different purposes such as; Ethernet
and GSM (Global System for Mobile communications) support available.
This study utilizes motion, gas and temperature sensors as the end device for detecting
any intruder, gas or fire. Two Zigbee devices are used; one of them is used as a transmitter
and the other as a receiver. Receiver coupled to the Arduino UNO and connected by wire to a
computer to show the output using graphical user interface; also, Arduino Uno is connected to
a bluetooth module to show the output on a smart phone.
The results show that the designed system can send and receive data up to 100 meters of
distance between Zigbee sides (receiver – transmitter). The home security system using
Zigbee and Arduino controllers with sensors has been successfully designed and
implemented.
1
)Kirkuk University Journal /Scientific Studies (KUJSS
) Volume, Issue, 2018, pp. ( -
– ISSN
الملخص
الغرض من هذا البحث هو تصميم نظام أمن منزلي بإستخدام أجهزة التحكم الزيجبي واألردينو مع ع**دد من أجه*زة
اإلستش*عار .يس*تخدم النظ*ام األم*ني على نط*اق واس**ع في المن**ازل والمؤسس*ات والمص*انع .زيج*بي ه**و بروتوك**ول اتص*ال
يس **تند إلى "معي **ار "IEEE 802.15.4ال **ذي يتم تعري **ف طبق **ات التحكم في الوص **ول المادي **ة والمتوس **طة بواس **طة ه **ذه
المواصفة القياسية .ويدعم زيجبي ثالث*ة أن*واع طبولوجي*ا االتص*ال .هم :مش ،نجم*ة وش*جرة .وتتم*يز تقني*ة زيج*بي بأنه*ا
ذات معدل بيانات منخفض واستهالك منخفض للطاقة وتكلفة منخفضة .منصة اردوينو لديها مواصفات جيدة ،ورخيصة
،وس**هلة االس**تخدام ،وق**د ظه**رت أص**ناف واس**عة من ال**دروع م**ع العدي**د من األغ**راض المختلف**ة مث**ل ؛ دعم إي**ثرنت و
تس**تخدم ه**ذه الدراس**ة أجه**زة استش**عار الحرك**ة والغ**از ودرج**ة الح**رارة كجه**از نه**ائي لكش**ف أي دخي**ل أو غ**از أو
حري **ق .يتم اس **تخدام جه **ازين زيج **بي ،واح **د منهم يس **تخدم كمرس **ل واآلخ **ر كجه **از اس **تقبال .اس **تقبال إلى Arduino
UNOومتص *الً بالس**لك إلى كم**بيوتر إلظه**ار اإلخ**راج باس**تخدام واجه**ة المس**تخدم الرس**ومية ؛ أيض**ا ،متص**ل اردوين**و
أونو إلى وحدة بلوتوث إلظهار اإلخ*راج على اله*اتف ال*ذكي .وأظه**رت النت**ائج أن النظ*ام المص**مم يمكن*ه إرس*ال واس*تالم
بيان*ات تص*ل إلى 100م*تر من المس*افة بين ج*انبي زيج**بي (جه*از االس**تقبال -المرس*ل) .تم بنج*اح تص**ميم وتنفي**ذ نظ*ام
2
Kirkuk University Journal /Scientific Studies (KUJSS)
Volume, Issue, 2018, pp. ( - )
ISSN –
. مستشعر درجة الحرارة، مستشعر الغاز، جهاز استشعار الحركة، اردوينو، زيجبي:الكلمات الدالة
1. Introduction
Home security is a worldwide concerned issue. The security system has been enhanced
through applying various ways, for example, by employing many security officers, using
innovative weapons, alarms, control system, producing electronic hardware and software and
many more, currently, many studies on smart systems of home have been carried out covering
all aspects; for instance, multimedia, lighting, security monitoring, temperature control …
etc., in a smart system of home, the tendency is towards the use of an automated system
helping users to monitor the situation of home; accordingly, simplifying and accelerating
daily works. Hence, the effects of human errors can be avoided by utilizing automatic systems
and then saving electricity [1]. The advantages of using Zigbee & Arduino controllers
providing low data rate transmission, low energy consumption, ease in setting up the network
and low costs together with smaller sensor size. Zigbee is the most widely deployed
enhancement to the IEEE 802.15.4 standard where the organization maintains, supports, and
develops more protocols for advanced applications in defining additional communication
features [2]. The enhancements consist of authentication with valid nodes, encryption for
security and data routing that allows mesh networking. With Zigbee, all nodes are able to
communicate with each other and can be handled by a single Zigbee, wirelessly. Zigbee
devices are restricted through a rate of 250 Kbps that make it suitable for low data rate
transmission. Zigbee has many advantages; for example, its battery can stay up to few months
depending on applications, making it perfect for install and forget devices such as small
household systems [3]. Arduino is an open-source platform used for building electronics
projects. Arduino consists of both a physical programmable circuit board (often referred to as
a microcontroller) and a piece of software, or IDE (Integrated Development Environment)
that runs on your computer, used to write and upload computer code to the physical board [4].
This paper presents the development and implementation of a low cost system for home
security using two type of controllers (Zigbee & Arduino) and microcontroller development
board connected with three sensors, buzzers, display unit, Bluetooth devices and GUI
(Graphical User Interface). The system proposed is analyzed in terms of detectable range and
results to prove that the system is able to work perfectly for indoor environments and up to
100 meters of distance between the transmitter and the receiver. The rest of this paper is
3
Kirkuk University Journal /Scientific Studies (KUJSS)
Volume, Issue, 2018, pp. ( - )
ISSN –
organized as follows; section 2 describes the methodology and approach, software and
hardware configuration and the experiment setup of the home security system using (Zigbee
& Arduino), followed by the results in section 3, then the discussion in section 4, in section 5,
the author concludes the findings of the paper. Finally, he illustrates the future work in section
6.
4
Kirkuk University Journal /Scientific Studies (KUJSS)
Volume, Issue, 2018, pp. ( - )
ISSN –
5
Kirkuk University Journal /Scientific Studies (KUJSS)
Volume, Issue, 2018, pp. ( - )
ISSN –
tratS
tnempoleved BCP
seY
rorrE
oN
htiw gnicafretnI
ecafretnI resU lacihparG
6
Kirkuk University Journal /Scientific Studies (KUJSS)
Volume, Issue, 2018, pp. ( - )
ISSN –
rosnes RIP
saG
rosnes
eeBgiZ
)rettimsnarT(
rosnes CTN
1hctiws timiL
ageM oniudrA
rewoP
ylppuS
TFTDCL
xeH
dapyeK
)a(
htooteulB
enohP
)b(
(b)
7
Kirkuk University Journal /Scientific Studies (KUJSS)
Volume, Issue, 2018, pp. ( - )
ISSN –
Hardware Circuit:
1. PIR Sensor:
The PIR (Passive Infrared) sensors allow you to sense motion, almost always used to
detect whether a human has moved in or out of the sensors range. They are small,
inexpensive, low-power, easy to use and don't wear out. For that reason they are commonly
found in appliances and gadgets used in homes or businesses. They are often referred to as
"Pyroelectric", or "IR motion" sensors. PIR are basically made of a pyroelectric sensor, which
can detect levels of infrared radiation. Everything emits some low level radiation, and the
hotter something is, the more radiation is emitted. The sensor in a motion detector is actually
split in two halves. The reason for that is that we are looking to detect motion (change) not
average IR levels. The two halves are wired up so that they cancel each other out. If one half
sees more or less IR radiation than the other, the output will swing high or low.
8
Kirkuk University Journal /Scientific Studies (KUJSS)
Volume, Issue, 2018, pp. ( - )
ISSN –
The PIR sensor itself has two slots in it, each slot is made of a special material that is
sensitive to IR. The lens used here is not really doing much and so we see that the two slots
can 'see' out past some distance (basically the sensitivity of the sensor). When the sensor is
idle, both slots detect the same amount of IR, the ambient amount radiated from the room or
walls or outdoors. When
a warm body like a human or
animal passes by, it first
intercepts one half of the PIR
sensor, which causes a
positive differential
change between the
two halves. When the warm
body leaves the sensing area, the reverse happens, whereby the sensor generates a negative
differential change. These change pulses are what is detected [9], as shown in Fig. 3.
PIR sensor’s circuit diagram is shown in Fig. 4. This sensor has three pins, they are:
“reference voltage pin (VCC)”, “ground pin (GND)” and the “output voltage pin”. Connect
pin (VCC) with 5V, ground to ground and connect the output to a digital input pin.
9
Kirkuk University Journal /Scientific Studies (KUJSS)
Volume, Issue, 2018, pp. ( - )
ISSN –
2. Gas Sensor:
Electrochemical gas sensors are gas detectors that measure the concentration of a target gas
by oxidizing or reducing the target gas at an electrode and measuring the resulting current.
The sensors contain two or three electrodes, occasionally four, in contact with an electrolyte.
The electrodes are typically fabricated by fixing a high surface area precious metal on to the
porous hydrophobic membrane. The working electrode contacts both the electrolyte and the
ambient air to be monitored usually via a porous membrane. The electrolyte most commonly
used is a mineral acid, but organic electrolytes are also used for some sensors. The electrodes
and housing are usually in a plastic housing which contains a gas entry hole for the gas and
electrical contacts.
The gas sensor’s circuit diagram is shown in Fig. 5. This sensor has three pins, namely:
“reference voltage pin (VCC)”, “ground pin (GND)” and the “output voltage pin”. Connect
pin (VCC) with 5V, ground to ground and connect the output to an anlage pin. RL is
adjustable resistance.
10
Kirkuk University Journal /Scientific Studies (KUJSS)
Volume, Issue, 2018, pp. ( - )
ISSN –
11
Kirkuk University Journal /Scientific Studies (KUJSS)
Volume, Issue, 2018, pp. ( - )
ISSN –
The circuit diagram of NTC (Negative Temperature Coefficient) Sensor shown in Fig. 6.
12
Kirkuk University Journal /Scientific Studies (KUJSS)
Volume, Issue, 2018, pp. ( - )
ISSN –
used in this research. Donut board was not connected to each hole as in the strip board. For
making the connection, solder method was employed to connect all components. The
development circuit diagram is shown in Fig. 7.
method a particular row is kept low (other rows are kept high) and the columns are checked
13
Kirkuk University Journal /Scientific Studies (KUJSS)
Volume, Issue, 2018, pp. ( - )
ISSN –
for low. If a particular column is found low then that means that the key connected between
that column and the corresponding row (the row that is kept low) is been pressed. For
example if row R1 is initially kept low and column C1 is found low during scanning, that
means key 1 is pressed. The simplified diagram of a typical hex keypad is shown in Fig. 8.
2.4. Bluetooth
Module
Bluetooth is a
standardized protocol for
sending and receiving data
via a 2.4 GHz wireless link.
It’s a perfect for short-range,
wireless transmissions between electronic devices.
14
Kirkuk University Journal /Scientific Studies (KUJSS)
Volume, Issue, 2018, pp. ( - )
ISSN –
Start
Switch to
Active
System No
Yes
Yes Sensor
Turn on Alarm
Detect
No
Enter
Password
times 3
Detect No detect
=
Pass word
False
True
Send data to
Graphical User
Turn off alarm
Interface
15
Kirkuk University Journal /Scientific Studies (KUJSS)
Volume, Issue, 2018, pp. ( - )
ISSN –
Zigbee connection diagram is shown in Fig. 10. To have successful transference of data
from Arduino, both Zigbee transmitter and receiver should be set up with the programming.
In order to read the port, “driver microchip 210x for USB port” should be installed in the
computer. Then, “XCTU software” is required to run the programming with Zigbee.
16
Kirkuk University Journal /Scientific Studies (KUJSS)
Volume, Issue, 2018, pp. ( - )
ISSN –
The set up for the Zigbee data transfer is done by opening the modem configuration at the
up right corner of the window XCTU. This step is very important to make sure that the data
has been transfer to the exact location. There were four items that need to be considered. First
is PAN ID. This is to show the location number of the port. The value of the ID must be the
same. As shown in Fig. 13, the ID for this Zigbee is 111. Then set the destination address
high as 0 and the destination address low as FFFF. Serial interfacing will also be the most
important things in this step. As we set the bound rate at the Arduino at 9600, the interfacing
data rate also must be 9600.
17
Kirkuk University Journal /Scientific Studies (KUJSS)
Volume, Issue, 2018, pp. ( - )
ISSN –
and vice versa. Therefore, both of the Zigbee can be used as the receiver & transmitter
terminal.
Fig. 15 Test the Connection of Both Zigbee.
3. Results
The prototype of the home security system is presented and the performance analyses of
the sensors for various distances of the completed home security system using Zigbee &
Arduino controllers. As shown Fig. 16 & 17 the system consists of two parts as a transmitter
side consist of: power supply, hex keypad, two limit switches, TFT LCD, buzzer and three
sensors namely, motion detector circuit gas or fire detector and temperature detector,
connected to Arduino Mega. Motion, gas and temperature sensors as the end device for
detecting any intruder, gas or fire. Two Zigbee devices are used; one of them is used as a
transmitter and the other as a receiver. Receiver side consist of a Zigbee coupled to the
Arduino UNO and connected by wire to a computer to show the output using graphical user
interface; also, Arduino Uno is connected to a bluetooth module to show the output on a smart
phone, which also behave as transmitters.
18
Kirkuk University Journal /Scientific Studies (KUJSS)
Volume, Issue, 2018, pp. ( - )
ISSN –
PIR Sensor
Gas Sensor
NTC Sensor
TFT LCD
HEX Keypad
Limit
Switch2 Limit
Switch1
Arduino Mega
Buzzer
Power Supply
XBee
(Zigbee)
Bluetooth
Arduino Uno
XBee
19
Kirkuk University Journal /Scientific Studies (KUJSS)
Volume, Issue, 2018, pp. ( - )
ISSN –
When the system is activated and if the window or the door opened or any movement is
detected on the motion sensor, an alarm will be triggered to inform the house owner. The
responses will be recorded on the GUI. Three types of messages will appear on the personal
computer, which are ‘Window is detected’, ‘Door is detected’ or ‘Motion is detected’
depending on the signal received as shown in Fig. 18.
Fig. 18 Window Sensor Detected, Door Sensor Detected or Motion Sensor Detected.
Then as shown in Fig. 19 if any gas or smoke is detected through gas sensor, an alarm will
be triggered to inform the house owner. The responses will be recorded ‘Gas is detected’ on
the GUI.
20
Kirkuk University Journal /Scientific Studies (KUJSS)
Volume, Issue, 2018, pp. ( - )
ISSN –
Fig. 19 Gas
Sensor Detected.
Finally if
any abnormal increase in environment temperature is detected through NTC thermister
sensor, an alarm will be triggered to inform the house owner. The responses will be recorded
‘Fire is detected’ on the GUI with display the temperature shown in Fig. 20.
21
Kirkuk University Journal /Scientific Studies (KUJSS)
Volume, Issue, 2018, pp. ( - )
ISSN –
But other previous models/kits have used only one or two types of sensor, or its model/kit
might be made separately, each model for a specific situation/status. Some have used RF like
Wi-Fi or Bluetooth, while others have used wired systems.
5. Conclusion
The implementation of Home Security System using Zigbee & Arduino standards with
Sensors is done successfully. The communication is properly done without any interference
between different modules in the design. It is found that the implemented design in this study
provides portability. In addition, data transmission is performed with low power consumption.
By using .NET technology, the sensor information is read successfully from serial port,
operations are performed, and the information is displayed in the GUI.
References
[1] Mohammad Syuhaimi, Ab-Rahman and Mohd Ariff Razaly "A Review of Security
System for Smart Home Applications", Journal of Computer Science, 8(7), 1165 –
1169 (2012).
22
Kirkuk University Journal /Scientific Studies (KUJSS)
Volume, Issue, 2018, pp. ( - )
ISSN –
[2] Norlezah Hashim, Mohd Amir Hafifi Abdul Razak and Fakrulradzi Idris, "Home Security
System Using Zigbee", Jurnal Teknologi (Sciences and Engineering), 74(10), 29 – 34 (2015) .
[3] Nidhi Patel, Hiren Kathiriya and Arjav Bavarva, "Wireless Sensor Network Using
Zigbee", International Journal of Research in Engineering and Technology, 2(6), 1038 –
1042 (2013).
[4] Dr. Subhi R. M. Zeebaree and Hajar M. Yasin, "Arduino Based Remote Controlling for
Home: Power Saving, Security and Protection", International Journal of Scientific &
Engineering Research, 5(8), 2229 – 5518 (2014).
[5] Subhankar Chattoraj, "Smart Home Automation based on different sensors and
Arduino as the master controller", International Journal of Scientific and Research
Publications, 5(10), 1 (2015).
[6] Fei Ding Guangming, Song Jianqing Li and Aiguo Song, "Remote Measuring and
Control Key Lab of Jiangsu Province", School of Instrument Science and Engineering
Southeast University, China, IEEE Conf., 1566, 40 (2009).
[7] Gutierrez, Jose .A, “Wireless Medium Access Control (MAC) and Physical Layer
(PHY) Specifications for Low-Rate Wireless Personal Area Networks (LR-
WPANs)”, 1st Edition, The Institute of Electrical and Electronics Engineers, New York,
USA (2003).
[8] Ajinkya Kumar Jadhav and Snehal Gaherwar, "Development of Wireless Ordering
System for Hotel", Certified Journal, 5(1), 2250 – 2459 (2015).
[9] Zipporah Tarus, "PIR Sensor Based Security System", Bachelor of Engineering Thesis,
University of Applied Sciences, Helsinki Metropolia, (2017).
[10] https://www.arduino.cc/en/Guide/Introduction.
[11] http://www.resistorguide.com/ntc-thermistor/.
AUTHOR:
Mohammed Fakhrulddin Abdulqader: received B.Sc. in Computer Software Engineering
from Technical Faculty Kirkuk / Kirkuk-Iraq in 2003 and M.S. degrees in
Computer Engineering from Sam Higginbottom Institute / Allahabad-India, in
2014. During 2004-2006, he worked as an engineer in Ministry of Kirkuk
23
Kirkuk University Journal /Scientific Studies (KUJSS)
Volume, Issue, 2018, pp. ( - )
ISSN –
University, then in 2005 joined to the Engineering College / Kirkuk University. He now
lecturer in Engineering College / Kirkuk University / Kirkuk-Iraq.
24