The Design and Realization of Household Intelligent Security System

It is known that Smart home has brought great convenience to the lives of humans. However, we have attached quantities of interest in its security as the development of technology goes on. According to the security requirements at the moment, we introduce the scheme of smart home security system based on ZigBee, and design system hardware and software process. By applying a STC89C52 microcontroller, our system is able to accurately detect and give alarms automatically to house fire, harmful gases and thefts.


Introduction
With the rapid development of social progress and science and technology, people's demands on the quality of life are becoming higher and higher. They want it be more humane as well as intelligent, which makes smart home come into being. While human beings enjoy the convenience brought from smart home, some potential safety hazards should not be neglected, for example, fire caused by a short circuit due to the use of high power home appliances, gas poisoning and exploration and thefts, which new commands for home safety has been proposed [1].
At present, the majority of smart security systems in the market are wired connection, which has influenced the appearance and space utilization of the home wiring [7]. Here, we introduce a system taking STC89C52 chip as control core, with CC2530 coordinator, MQ-2 smoke sensor, DHT11 temperature and humidity sensor, HC-SR501 infrared sensor, 12864 LCD, alarm module and so on. It is of high reliability, small size, which is able to give alarms and process to a fire, combustible gas and illegal invasions.

Overall System Design
ZigBee is a low power protocol based on IEEE802.15.4 standard, which is a kind of short distance, low power wireless communication technology. It outperforms in low power consumption, high reliability, large network capacity, high network stability. In addition, it can also set several levels of security, facilitating the users according to their personal needs. Also embedded technology is another advantage of ZigBee over other wireless devices [2,5,6]. Consequently, it is adopted in our smart home security system.

STC89C52
Residential Gateway Smart home security system is mainly composed of STC89C52 master chip, DHT11 temperature and humidity sensor, MQ-2 smoke sensor, HC-SR501 infrared sensor, CC2530 coordinator, 12864 LCD, alarm module and so on. The overall structure diagram of the system is shown in figures 1.

Master control module
The system uses STC89C52 as the master chip, which has 8K bytes of programmable Flash memory, 512 bytes of RAM and 32 bit I/O interface and other standard functions. As the main control module of the system, it is mainly responsible for the analysis and processing of the collected data. When the dangerous signal is detected, the buzzer gives alarm signals. And the information is passed to the users through the Internet network, assisting the circuits of other modules together.

Temperature and humidity sensor
DHT11 is a widely used digital temperature and humidity sensor, the working voltage is 3~5.5V, the measurement range is 20-90%RH, the temperature is 0~50 with high resolution.
DHT11DTH11 uses a single row 4 pins, pin 1 for power supply, pin 2 for data port, pin 3 is left vacant, pin 4 for ground, and it can be directly connected to the I/O CC2530 port. To get a more accurate result, a 4.7KΩ pull-up resister is connected between data terminal and power supply while the length of the connecting wire is less than20m [3]. Its circuit is shown in figures 2.

MQ-2 Smoke sensor
MQ-2 smoke sensor is designed following the characteristics that its electrical conductivity is sensitive to the combustible gas. The pin 4 of MQ-2 is connected to pin 2 of U1A, and the outputs a DC signal varying with the smoke concentration. U1A is a comparator, the threshold voltage of the comparator Rp can adjust the sensitivity of the alarms. When the smoke concentration is higher than the threshold voltage, U1A outputs low level (0V), and LED light alarms; otherwise, U1A outputs high (VCC), LED goes out. The circuit diagram of the module is shown in figures 3.

HC-SR501 Infrared sensor
In our system, HC-SR501 human sensing module is applied as an infrared sensor, which has high sensitivity, reliability, at a working voltage in 4.5~20V. It is already known that the central wavelength of the radiation of the human body is about 10um. By adding a Finel lens on the probe, the wavelength passing through it is suitable for human detection range. The infrared rays released in human bodies produce weak signals via Finel lens. The weak signal is processed by the filter amplifier circuit, which is transmitted to the MCU. Its work flow is illustrated in figures 4.

CC2530 Coordinator
CC2530 is a system on chip (SoC) that can be used in ZigBee, building a strong network node at a low cost. It has low power consumption of the core, 32/64/128/256KB programmable flash memory, RAM 8KB and excellent RF transceiver. Besides, its radio frequency signal is transmitted by differential method, which can enhance the signal level, reduce the scattering of signal and reduce the noise. It can also be isolated from the power supply system of the circuit board, ensuring a stronger signal rate and anti-interference ability.

12864 LCD
The main function of the 12864 LCD module is displaying information of collected temperature and humidity on the screen, and users can readily understand the environments in the home, adjusting temperature and humidity in time to achieve a comfortable living environment.

The alarm module
In an alarm module, when the microcontroller transmits a low level signal, the buzzer will send an alarm signal after confirmation, informing the user of indoor smoke concentrations over normal concentrations or illegal invasion in order to prevent the occurrence of the accident in time.

Software Design
System software is mainly composed of three parts, respectively detection, control and alarm. When the system is initialized, sensors in the system begin to work, and the temperature and humidity in the home is detected constantly. When the detection value exceeds the normal setting, the system gives the following reactions, such as opening the fan, starting the heater, and the alarm. IF the infrared sensor detects an illegal invasion, an alarm will be sent to the user through a buzzer. The software flow chart of the system is shown in figures 5.

System Test
As shown in figures 6, The overall of the system is based on STC89C52 type microcomputer as the core control. The information collection module is composed of Infrared sensor, vibration sensor, combustible gas sensor, temperature and humidity sensor. While the wireless communication module mainly contains NRF24L01 module and GSM SMS module. The mainframe and vice machines achieve information exchange through wireless communication module. The GSM module is attached to the host machine, which forms an intelligent home security system, with functions of anti-theft, fire, indoor multi-point prevention and remote alarm. After the system boots, the indoor temperature and humidity collected by the sensors will be showed on the LCD1602 liquid crystal display. Meanwhile, the sensors detect flammable gases, fire and human illegal intrusion signals, if these values has been beyond the threshold, they will be transformed into electrical signals and transmitted to the single-chip for post-process, and the microcomputer give alarms according to different cases. The employment of single-chip makes the system has the advantages of simple operation, stable function, low cost, low power consumption, high practical value and wide application.

Temperature and humidity sensor module test
The temperature measurement range of DHT11 sensor is 0~50. Under the experimental conditions, when the ambient temperature is 20, the temperature and humidity module is tested, the test results are 20 times, and the success probability is then calculated, the number of warning times of the alarm is reach 85%. While replaced with 40°C , the temperature and humidity module was tested, the test was 20 times, the success probability is figured out, and the number of warning times of the alarm now reach 100%.The test result is related to the setting temperature threshold.

Smoke sensor module test
For the MQ-2 smoke sensor module, we use the burning paper method to detect the smoke sensor in the indoor environment. The test was carried out in four different distance, and then the statistical time was obtained by different data. Its sensitivity characteristics are shown in figures 7. From the figure 7, the MQ-2 smoke sensor module is sensitive to different gases. It can be used in gas leakage detecting equipment in family and industry.

Infrared sensing module test
Under the experimental conditions, the maximum distance of infrared induction module of the human body is tested individually. In the interior, in the range of 2 meters, it can detect a person; in the 5 meter range from the right and left direction can be detected, from the front into the can not be detected.

Conclusion
In this paper, we have presented a low cost, low power smart home security system through the system design, hardware structure, software flow and other aspects. The system uses ZigBee as the transmission medium, and the security function is realized through the single chip microcomputer. With the continuous progress of science and technology and the diversification of smart home appliances, smart home security system development prospects will be more ideal.