Design and Implementation of Home Security System Using Zigbee and Arduino Controller With Sensors

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.


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 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.

Statement of Problem:
The system of security monitoring involves data transmission system, fast receiving data and accurate at a certain distance to facilitate placing devices freely at significant locations for the receiver of data display. This means that this system has to be transportable and used easily.
Concerning display system, it should be straight forward and understandable enabling users to take important immediate action. The system should not be hacked by any person, regardless of different ways comprising: on input source power, data transmission content, receiving data content and the location of main processor of security sensor device [3]. Also, there is a number of important characteristics that must be contained in this system, including: resistance to water and high temperature and durable to avoid failure of transmission and receiving processes of data. There are some problems exist in several security systems concerning the use of sensor devices. Limitations in the security system will be caused by these problems. Inevitably, extensive use of sensors is required for home security system due to their importance in security systems. Sensors should be sensitive to human motion and working on the most appropriate range, i.e., not too close or too far, to detect movement. In addition, they must be consistent with the human nature [5,6]. According to this situation, a new intelligent household monitoring system designed in this research. Several high-precision wireless sensor terminal nodes are adopted with Zigbee protocol. On the basis of "Open System Interconnection (OSI) model", Zigbee protocol had been developed and built on "IEEE standard 802.15.4" which defines "the physical and Medium Access Control (MAC) layers" [7]. Three communication topologies types are supported by Zigbee, they are: star, tree and mesh topologies. Operation of Zigbee wireless device requires very-low power consumption making it the most preferable wireless device to be used in Wireless Sensor Network (WSN). Zigbee has multi-hop capability of communication; therefore, it provides an unlimited communication range [8]. -The remote station of monitoring is represented by GUI, while the controlling device is represented by microcontroller. Though monitoring and controlling of devices can be done remotely from any part of the world wherever Internet access is available, additional cost is incurred by this system because of computer requirement [6].
-Supplier dependency due to the need of using separate systems for different appliances of companies [8].

Methodology and Approach:
The basic flowchart of research methodology and approach is shown in Fig. 1. This research comprises two parts, namely hardware and software. The implementation of hardware requires designing research circuit and the development of a PCB. The implementation of software involves code writing besides programming the "Arduino and Zigbee". After completing both parts, the next process is to test and debug the system. The block diagram of the proposed security system of home is shown in Fig. 2 is section discusses the design and function of components connected to Arduino for constructing the security system. Moreover, it describes the process of making the circuitry connection between microcontroller and components.

 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, lowpower, 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.

3.
Can distinguish between object movement and human movement.
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. 5. 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. 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.  Buzzer is an audio signaling device. The typical uses of buzzers are for alarms, timers and confirmation of user input such as a mouse click or keystroke. The project used an electronic type of buzzer which is a piezoelectric element that driven by an Arduino microcontroller signals.

The development of Circuit Board:
This research utilized donut board. Before connecting all components on the board, and for the purpose of ensuring the functional connection between each component, bread board was 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. identifies which key is pressed by a method known as column scanning. In this method a particular row is kept low (other rows are kept high) and the columns are checked 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.

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.

Software Implementation:
This section discusses the methodology to interface the sensor and hardware module. The most significant part is to enable the analog sensor to send analog data to Arduino, and then to transfer data to the GUI. 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.    The last step is to test the connection between two Zigbee. As shown in Fig. 15, the writing in blue color is the data transfer at COM40. Meanwhile, the red color in COM44 is the receiver and vice versa. Therefore, both of the Zigbee can be used as the receiver & transmitter terminal.

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.  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. 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. 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.