Design of Electronic Remote Control System Based on Wireless Sensor

— A wireless remote sensing system based on wireless sensor network solution is proposed, to achieve the remote control of home appliances. The remote control system uses STM32F103 chip as the main controller of the smart home system, and applies the CC1110 radio frequency module as the communication node of the home wireless sensor network. Through the Simpli-ci TI network protocol, these nodes together are put forward to form a small home LAN. Then, combining with GPRS wireless communication technology and Web Internet technology, these nodes to the remote server are collected. The results showed that through the user's mobile terminal access, it can form a wireless remote monitoring system. The conclusion is drawn that an intelligent home remote monitoring system based on wireless sensor network is feasible and it has good performances.


Introduction
elaborates the remote control system from the aspects of hardware design and software design. The hardware mainly includes the choice of the main controller and the design of the node, and introduces the hardware schematic diagram of the terminal sensor CC1110 and the GPRS wireless communication module SIM900A. The design of the software is described from the functional requirements and the overall framework design respectively. Finally, we test the function of the system.

State of the art
In foreign countries, the smart home industry started early, and the function of the product is very comprehensive. Among them, the more well-known companies are the United States Honeywell (Honeyewll) and Control Company. Honeywell is a diversified home multinational company. It combines the smart home system with Internet technology. In the Wifi gateway for the nuclear control platform, it implements a variety of application functions, including: home security features, remote meter reading function, information dissemination function, access control functions, video intercom function, home appliances remote monitoring function and so on. Through the intelligent home control platform, it can provide users with a variety of security, comfort, efficiency, information and other new services [5]. Control4 is a US company that engaged in smart home product development. It developed a set of wired and wireless series of monitoring products. Because of the advanced control methods, the construction workers can even complete the installation of the complete system in just a few hours. In addition, customers can flexibly configure the Control4 system to suit their unique lifestyle [6]. In the United States, Japan, Korea, Germany, France and other countries, intelligent home system has a very wide range of applications market.
Although smart home has many obvious advantages, its overall price is high. A Control4 control host will cost seven or eight thousand dollars, which does not include a variety of peripheral switch module configuration. Because the cost is too high, the average family often cannot afford it. Therefore, it can only be used in some high-end residential and villa area. Smart home industry in the domestic start late, but its development is quite fast. At present, there are many kinds of smart home products in domestic. Among them, the representative companies are home treasure, Haier, TCL and so on. However, these companies' smart home products do not have a unified control interface standard. The manufacturers of products are not compatible with each other, leading to the promotion of intelligent home products and application is very limited. Until now, there is no smart home product to occupy the domestic market share of 15%. In the development process of the smart home industry, the industry standard has become the bottleneck of the development of smart home, which will also be the key issue of the future development of smart home [8].
The main goal of intelligent home monitoring system is to meet the needs of people's lives, and provide a variety of practical functions, to achieve safe, reliable and intelligent home control [7]. It includes the functions of lighting, home appliance control and home security. The users can observe live photos at home in real time [8]. Once the abnormal situation occurs, it can also receive the alarm information which is set by the system, and start the security program [9]. The function of the control system mainly includes the following five parts: (1) Household electrical equipment switch control function The system terminal MCU gets the status of different electrical information using the analysis of data. Through the IO port control solid state relay opening and closing, so as to control the home electrical equipment switch.
(2) Wireless LAN networking The wireless communication node adopts CC1110 module and Simplici TI network protocol stack to realize networking. By cascading the device nodes to form a serial network topology, the maximum number of cascading support 4 jump, and the network capacity supports 255 network nodes of the wireless LAN.
(3) Remote mobile monitoring and access Internet functions The system uses ST's STM32F103 low-power ARM controller and Simmon's SIM900 RF module to form a wireless gateway. The successor node wireless module connects all terminal nodes in the wireless LAN through the GPRS / GSM wireless gateway to the Internet network, so as to realize the information communication between wireless local area network and external network. The users can also use the mobile terminal to monitor each wireless network node in real time [10].
(4) Camera shooting function In the room to install a number of cameras, each camera is connected with a wireless network node, through the GPRS gateway access to the Internet network [11]. When the monitoring system detects the abnormal signal, or receives the user's remote control signal, it will start the camera function, after the photo saved in the SD card. At the same time, the photos will be sent to the remote server through the Internet network [12].
(5) Security alarm function Once the thieves into the house, the body sensor detects abnormal signals, and trigger the camera system to take pictures. Through the wireless sensor network and GPRS network to shoot the thieves or accident scene pictures, and then send to the remote server, while informing the owner of the phone. The owner can immediately log on to the Web server to view the picture, and according to the pictures taken in a timely manner to take effective measures or alarm, it played a very good security effect.
In summary, these smart home products do not have a unified control interface standard. The manufacturers of products are not compatible with each other, leading to the promotion of intelligent home products and application is very limited. In this paper, we propose a wireless remote sensing system based on wireless sensor network solution, to achieve the remote control of home appliances. The remote control system uses STM32F103 chip as the main controller of the smart home system, and applies the CC1110 radio frequency module as the communication node of the home wireless sensor network. Through the Simplici TI network protocol, these nodes together are put forward to form a small home LAN. Then, combining with GPRS wireless communication technology and Web Internet technology, these nodes to the remote server are collected. The results showed that through the user's mobile terminal access, it can form a wireless remote monitoring system.

Method
The system includes wireless LAN, remote PC monitoring and user smart phone monitoring. The system frame is shown in Figure 1.

3.1
System hardware design The hardware system includes CC1110 wireless module, SIM900 GPRS module and a STM32F103 control chip, the hardware system block diagram shown in Figure  2. Hardware design of CC1110 wireless communication module: In the design of the system, we use ADI's ADP3300-3.3 chip as a power management chip. This chip has a wide power input range, it can reach 3 ~ 12V, and the output voltage is 3.3V [3]. Regardless of the use of batteries, USB or other means of power supply, the basic can meet the CC1110 power requirements. In the radio frequency (RF) transceiver module of the inside CC1110 chip, it contains a modem. In addition to the high sensitivity of the configuration function, it also supports a variety of modulation methods, and has a very high data transfer rate, and the maximum can reach 500kb / s [3]. The error correction of the modem can effectively reduce the bit error rate of digital signal transmission and improve the reliability of signal transmission.
The design of CC1110 hardware circuit mainly includes: CC1110 chip, RF matching circuit and related peripheral components. 26 MHz crystal oscillator provides the clock frequency of the system, if it is considered that the internal RC oscillator chip cannot meet the requirements of precision, we can use 32.768 K Hz crystal, for the sleep timer. The radio frequency matching circuit is mainly used to match the RF module input / output impedance, so that the input / output impedance is 50. Thus, it can provide the required DC bias voltage for the low noise amplifiers and power amplifiers inside the CC1110 chip. The system uses BALUN circuit to achieve impedance matching function, which is composed of L122, L131, C124 and C131. The CC1110 radio frequency signal in the 433MHz band using differential signal transmission, and its best differential impedance is (116 + j41) [5].
Hardware design of GPRS remote wireless communication module: SIM900 communication module operating frequency is GSM / GPRS 900 / 1800MHz, the module integrates a variety of network communication protocols, including: TCP protocol, UDP protocol, HTTP protocol and FTP protocol. It can achieve the realization of voice, SMS, data and other information remote transmission. The SIM900A physical space is very compact size, and the volume is only 24 ! 24 ! 3mm. It is very suitable for large size space requirements of a variety of smart home appliances and smart handheld terminal applications in the design. It belongs to dual frequency GSM / GPRS module, at the same time, its internal integrated a powerful ARM926EJ-S chip processor, so as to ensure the stability of the SIM900 [4].

System software design
Design of wireless LAN software system: In this section, we introduce the software design of wireless sensor network, which mainly describes the system software design of STM32F103 main controller and CC1110 network node.
1. The design of controller software for STM32F103 The main controller is realized by a STM32 ARM controller running RT-Thread embedded real-time operating system, which includes five functional modules, and they are image acquisition module, GPRS data transmission module, telephone alarm module, mobile phone Bluetooth interface module and the central node control module. The overall functional framework and software design process are shown in Figure   According to the functional analysis requirements, we use the modular form to achieve the functions of the various parts of the terminal controller. The terminal controller application software framework is shown in Figure 4. (2) receiving a request message for the terminal node device and the extended node device; (3) analyzing the control message of the main controller, extracting the destination address, sending the monitoring command of the main controller to the corresponding terminal node device and the extended node device; (4) sending a request message to the host controller for the endpoint node device; (5) initialize and register the Simplici TI network protocol. According to the central node equipment function analysis, the software design block diagram is shown in Figure 5.  The terminal node device mainly completes the following five basic functions: (1) initializing and registering the Simplici TI network protocol; (2) receiving the control message of the central node device and the extended node device; (3) receiving the alarm message of the terminal controller; (4) forwarding the control message to the terminal controller; (5) sending an alarm message to the central node device and the extended node device. The terminal node device software design block is shown in Figure 6.  The design of the Web server software: The Web server mainly realizes the communication between the terminal hardware system and the user's mobile terminal, and stores the image data collected by the terminal hardware system in the remote database for the mobile phone client. In this software, you can check the network status, send a data transfer command, and notify the terminal to send data to the center. Respond to the query request of the mobile client and display the query result by image. The main function modules of the monitoring software design mainly include the network communication module, the image data upload module, the database module and the alarm monitoring module. The organization form is shown in Figure  7. 1. The selection and design of the servlet container Tomcat is a very powerful SUN developed by the Servlet container, and the container is completely written in Java language. Tomcat is stable, reliable, and efficient. It is not only a Servlet container, but also can act as a Web server to use, to achieve the control platform, security domain and tomcat valve management functions [6].
Tomcat acts as a servlet container running on the server, and its primary task is to receive and resolve the client's request message, then forward the message to the corresponding servlet, and finally return the response to the client. When Tomcat acts as a servlet container, it includes three modes of operation: Servlet containers that run independently, Servlet containers in the Web server process, and Servlet containers outside the Web server process.
2. Database module design The system uses My SQL database to manage the underlying hardware upload image data, and to achieve its increase, delete, change, check and other related operations. The database module is the memory management module of the monitoring software. It mainly completes the establishment of the data table, performs the read and writes operation to the data table and the database maintenance function. Taking into account the ease of use of My SQL and programming requirements, all data are stored in the database format, the database access using DAO database interface.
3. Photo upload server-side design To achieve the server-side file upload, in this article, we use the Apache commonsfile upload tool category. In addition, we also need a commons-io package, and then add them to the class path, and make full use of these two components. The specific implementation of the file upload block diagram is shown in Figure 8.

Experiments
In this section, we test and validate the functional modules in the wireless sensor remote control system.

Server setup and image information upload function test
We use Servlet + JDBC technology to achieve the server, and the implementation of the program is shown in Figure 9. In the test, first enter the URL in the browser search bar: http://localhost:8080/Camera Hub/. Then, select the camera in the drop bar click to select the picture, and then click upload. Finally, click to view all the cameras. The picture upload successful indicates that the server has been successfully built and the image information upload function test passed.
2. GPRS module image data upload server function test In this paper, the GPRS module that we designed uses the SIMCOM Company's SIM900A module, and through the computer's serial to debug the software. Based on the AT command of the HTTP protocol to send the GPRS module, and then send the picture data. The concrete realization scheme is shown in Figure 8. SIM900 GPRS module through the serial port connected with the PC machine string, PC through the serial port debugging tool to set the communication parameters: the baud rate is 115200, the data bits is set to 8 bits, the arity bit is set to "no", and the stop bit is set to "1".
Through the SIM900 GPRS module AT command to achieve HTTP network protocol flow is as shown follows. Through the serial port software input instructions and parameters, each instruction followed by a new line carriage return: AT+CSQ AT+CREG? AT+CGATT? AT+SAPBR=3,1,"CONTYPE","GPRS" AT+SAPBR=3,1,"APN","CMNET" AT+SAPBR=1,1 // Open the bearer to connect to the server AT+HTTPINIT // Initialize the HTTP protocol AT+HTTPPARA="URL","125.89.69.239:2376/Camera Hub/fileupload" // configure the IP address, port number, and connection directory of the remote HTTP server AT+HTTPPARA="CONTENT","multipart/form-data;boundary=-----------------------------70086703017284350872040928184" // configure the connection parameters of the remote HTTP server, including the data type and the border character declaration AT+HTTPDATA=7140,50000 //7140 refers to the total length of data to be sent next, here is 7140 bytes When the module returns DOWNLOAD, enter the required data submitted by HTTP. This includes three TXT files, in the order of HTTP header files: 1.txt JPG picture of the binary data file. 2. txt and HTTP border tail file. 3. txt. It should be noted that in the second step, the data should be 2.txt COPY out and then stick to the serial debugging tool to send the area, and finally sent in hexadecimal.
AT+HTTPACTION=1 // Perform an upload operation. AT+HTTPREAD// Displays the response information received from the server. Finally, the picture that upload to the server shows a successful upload, so far, GPRS wireless communication module upload picture data to the remote HTTP server function test has been completed.

Mobile phone browsing remote server image information test
Tomcat Web Server Servlet + JDBC the user remotely accesses the server with the phone MySQL database The test program is shown in Figure 11. According to the previously deployed Tomcat Web server, here we start the HTTP server, and through the mobile terminal to access the remote server addresses: 125.89.69.239:2376/Camera Hub/cameras.jsp The IP address is the external network IP, which supports the remote access. The results show that the phone can successfully access the URL, and normal browsing upload pictures, so the test passed, and the test results are expected to achieve the desired design goals.
Through the wireless sensor remote monitoring design functional testing, including server building and picture information upload function test, GPRS module image data upload server function test and mobile phone picture information test, through the verification, the test results have reached the expected design standards and requirements.

Conclusions
In this paper, we realize an intelligent home remote monitoring system based on wireless sensor network. The remote control system uses STM32F103 chip as the main controller of the smart home system, and uses the CC1110 radio frequency module as the communication node of the home wireless sensor network. Through the Simplici TI small network protocol stack, we realize the wireless network of multiple node modules. The protocol stack has the advantages of long charging time and simple network structure. As the CC1110 RF module in the 433MHz band has a good partition communication capacity, it is particularly suitable for smart home applications. In the choice of the main controller, we select the ARM controller STM32F103 chip of the STMicroelectronics. The controller is very compact and powerful, and it can run embedded real-time operating system RT-Thread, especially for the monitoring needs of the public family. In the design of the wireless gateway, the system uses SIMCOM's cost-effective GPRS module SIM900A as the communication interface between the wireless sensor network and the Internet. The GPRS module supports the network protocols of TCP, UDP, HTTP and FTP. We use its TCP protocol as a communication protocol with the remote Web server, which has high stability and compatibility, as well as providing a good solution for subsequent functional expansion of the system. With the continuous development of wireless communication technology and the popularity of 4G networks, the general image monitoring has been unable to meet the needs of most users. Therefore, the mobile video surveillance system has already become an important development trend of the intelligent home. According to the design of the remote monitoring program, we use the UDP protocol and FTP protocol to realize the video communication between the mobile terminal equipment and the remote server. In addition, the system still has many shortcomings. For example, the Web services remote access interface is not friendly and beautiful, this issue should continue to improve and perfect. Due to the immaturity of power control technology, the lack of encryption and other related measures, the design of the communication model is relatively simple. For the large amount of data transmission and processing of video information, STM32 controller appears to be inadequate. Therefore, we should come up with a designing scheme combined the ARM and the FPGA.