Design of intelligent house system based on Yeelink

In order to monitor the security situation of house in real time, an intelligent house remote monitoring system is designed based on Yeelink cloud services and ZigBee wireless communication technology. This system includes three parts, ZigBee wireless sensor networks, intelligent house gateway and Yeelink Cloud Services. Users can access Yeelink website or APP to get real time information in the house, receiving information including gas concentration, temperature. Also, remote commands can be sent from mobile devices to control the household appliances. The user who can monitor and control the house effectively through a simple and convenient user interface, will feel much more safe and comfortable.


Introduction
In the 21th century, the quality of people's life has been gradually improved, which leads to the promotion of living environment requirements and the aspiration of "lazy man" mode.In this situation, people are pursuing a more convenient and intelligent life in a higher technology way.Therefore, intelligent house system arises in consequence.
Intelligent house system can help household to perceive the environment of house with accuracy and control the domestic appliances with convenience.For instance, it could monitor the temperature and humidity in the house, and then control the running of conditioner to make the households feel comfortable.Actually, China had introduced intelligent house system in the 1990s, however it was a flash in the pan.Customers had a common complaint about its disadvantages, such as low intelligence, dense wiring, high cost and delayed service.In recent years, intelligent house system has greeted a bright spring again with the rise of the internet of things.
Because the ZigBee technology has been matured, some researchers use it to achieve the wireless of intelligent house.W. Shao etc. utilized the microprocessor (MSP430F169) and the ZigBee chip (CC2420) to control infrared node for realizing the control of some domestic appliances in the year of 2012 [1].In the year of 2015, T. Zhang etc. adopted Z-STACK protocol stack of TI company, in the developmental environment of IAR, to structure house wireless sensor network in the control of sensors by CC2530 chip as the core [2] .In the same year, Z. Z. Fang realized the intelligent control of curtain based on CC2530 and analyzed ZigBee network topology in depth [6].
With the spread of 3G network and WIFI network, some researchers applied these technologies to develop remotely accessible intelligent house system.In the year of 2015, H. X. Yu etc. sent monitor image and alarm information to mobile terminals timely by multimedia message and short message of 3G network, and then sent and received commands by mobile terminals to achieve the remote intelligent control of house [3].L. G. Su etc. obtained working condition of various kinds of sensors on all nodes by intelligent house gateway, focus on controlling all kinds of appliances, and realized remote control by mobile phone terminal [4].
The spread of cloud services technology makes more and more researchers to study this aspect.This topic is to utilize the combination of ZigBee wireless sensor network and Yeelink, which makes users to check environmental data of house, control the running of appliances anytime and anywhere, and enquire data in cloud storage.

Solution To System
The integral block diagram of intelligent house system in this paper is shown as Figure 1.The top layer is "customer layer".Customers can use mobile phone, tablet PC such kinds of intelligent device to login in cloud ITA 2016 platform, browse sensor information and send control commands.The middle layer is "family core network".And STM32 controller is the core part, which can read and send data to the ZigBee coordinator by UART.The bottom layer is "ZigBee wireless sensor networks".It mainly detects indoor condition using sensor, then sends collected data to ZigBee coordinator, and transmits controlling instruction to household appliances to the end of network.

Related operations of cloud platform
Yeelink is a platform of "internet of things" which opens to all developing users, helping the user has his own "internet of things" quickly.This platform which has unique designed data server supporting many users to access and store their mass sensor data consequently.Furthermore, the massive sensor data is kept on internet in safety.Based on these advantages, this paper chooses Yeelink as the data platform of intelligent house system.As shown in Figure 2, in terms of system settings, we register account on Yeelink website, then add STM32 as the device to this account, and add links to all kinds of sensors and household appliances.All the added devices and sensors have independent ID by which it could access and storage data in accurate way.

Design of Family Core Network
In terms of hardware, we choose STM32F103 as the core processor.It is integrated inside of 128KB FLSH, four timers, 20KB RAM and plenty of I/O ports, which are qualified to the software and hardware resources needed in this intelligent house system.In the design of circuit, there is W5100 module linked to STM32 peripheral through SPI interface, thus externally expanding the Ethernet interface.In addition, this processor links ZigBee coordinator module in wireless sensor layer by UART interface.
The schematic of the hardware is shown in Fig. 3.The software design of family core network mainly focuses on STM32 programming with the following functions: peripheral hardware initialization, communication with W5100 via SPI port, communication with ZigBee coordinator via UART interface.The communication described above follows the frame format designed in this system.W5100 is initialized to TCP client mode and the network parameter is set as required.And STM32 calls the "data sending function" to make the W5100 send one frame of data to Yeelink platform.Furthermore, STM32 will not send another frame until it receives the interrupt signal from W5100.
The main process is shown in Fig. 4.

Sensor Network Design
The hardware of sensor network design is constituted of ZigBee modules and sensors.The ZigBee modules is constructed mainly with chip CC2530.And there are kinds of sensors such as: MQ2(gas sensor), DS18B20 (temperature sensor), human body sensor, etc.
The software of this part has two main functions: on one hand, ZigBee router will automatically upload information from sensor to coordinator in a fixed period.On the other hand, router will send data to coordinator when receiving a data requisition from the coordinator.
We use IAR Embedded Workbench to develop software and read data from sensor that is linked to ZigBee modules.If the signal from sensor is a digital signal (such as DS18B20), it is only need to connect the output pin of the sensor to the I/O pin of CC2530.If the signal is an analog signal, then needs an A/D converter to sample the signal.

I. Results
Figure 7 The photo of experiment boards Fig. 7 shows the photo of experiment boards.In this experiment, MQ2 gas sensor is applied to read carbon monoxide concentration which is sent to Yeelink cloud

Conclusion
A set of intelligent house remote monitoring system is designed and realized based on Yeelink cloud services and ZigBee wireless communication technology.The three layers of this design: ZigBee wireless sensor network, intelligent house gateway and Yeelink cloud services, are introduced in this paper.With this intelligent house system, the users can view the environmental information of house, receive alarming like gas concentrations exceeding in time, and even send remote commands to the household appliances through a simple and convenient user interface.

Figure 1
Figure 1 Block Diagram of Intelligent House System

Figure 2
Figure 2 Device Management

Figure 3
Figure 3 Hardware Design Figure 4 Software Process

Figure 5 Figure 6
Figure 5 ZigBee Software Configure

Figure 8
Figure 8 Experimental Data services by STM32 and W5100.Users can browse gas concentration data on Yeelink website or mobile terminal APP.Fig.8isscreenshot of viewing data from Yeelink website and mobile terminal.