Smart home system control methods are mainly wired network and wireless network. Wired mode, as the name implies, requires laying cables to form a network. This kind of networking method is relatively traditional, has a long history, relatively mature technology development, and high reliability. However, due to the cumbersome wiring caused by the need for physical wiring, the wiring is easily damaged, and the scalability and mobility are inevitable problems. The wired network method will gradually be replaced by the wireless network method. The wireless network relies on its good mobility and scalability, no additional wiring and no distance control, so that it can control the controllable points flexibly and fluently. This feature is more in line with the communication requirements of the home network, so it is based on Smart home systems based on wireless network technology have attracted more and more attention. At present, wireless network technology has penetrated into all aspects of human life. There are many kinds of wireless methods, and the more widely used wireless technologies include Bluetooth, infrared technology, ultra-wideband and so on. Various technologies have their own characteristics. Among them, the emergence of the emerging ZigBee technology fills the gap in the low-speed end wireless communication technology, and can well solve the problems encountered in the design of smart home systems. ZigBee technology is a low data rate wireless communication technology that can be applied to almost all industries.
XBee wireless technology is a wireless module based on the IEEE 802.15.4 standard wireless protocol and compatible with the ZigBee protocol. As an emerging wireless communication technology, it is a power-saving, long-distance, short-delay, low-power data transmission module, mainly used in smart home, remote control, wireless meter reading, wireless detection and other aspects. This article mainly takes smart opening/closing curtains as an example to illustrate that smart homes are different from ordinary homes in that they not only have the living functions of traditional ordinary homes, but also attract more attention due to the use of XBee wireless technology, which makes smart homes smart and active, and optimizes and upgrades life. the way.
2 System functionThe smart home based on XBee wireless technology mainly realizes the monitoring of the home environment through a wireless remote control module (XBee module). The intelligent curtain control system in this article is designed in accordance with point-to-point communication. Use the dedicated software X-CTU to configure any XBee module as the coordinator API end of the coordinator as the control end. Its function is to send data to any XBee module configured as the terminal router API end, control the work of each terminal node, and pass RS232 The serial port is connected to the host computer monitoring interface, so as to realize the remote control of each terminal node. This text mainly realizes the opening and closing of the intelligent curtain, its system function block diagram is shown as in Fig. 1.
Figure 1 System functional block diagram
3 hardware designSmart curtain hardware mainly adopts an industrial computer (tablet computer) with RS232 serial port or USB interface to switch level converter, Arduino controller, relay, electric curtain (including guide rail), etc. Among them, the most critical part of communication lies in the design of the communication module. The design of the communication module in this article mainly uses a mini ZigBee transceiver module XBee Series 2 module produced by the wireless communication component manufacturer MaxStream. Two XBee modules are required, one is installed on the PC (host computer) to control the sending end, and the other is used as the wireless receiving end of the Arduino controller. The specific hardware requirements list is shown in Table 1.
Table 1 Hardware requirements table
3.1 The host computer controls the hardware design of the sender
The host computer switches the three switch states of the curtain (open the curtain, close the curtain, stop the curtain), and send control information through the serial port to the XBee module (coordination end node A) connected to the host computer USB according to a certain communication protocol, and then wirelessly The network sends control information to the XBee module (terminal node B) of the Arduino wireless receiving end. The upper computer mainly realizes the three functions of switching, judging and sending. The main content of the coordinating end node A end instruction includes the address of the end node B module, and the information to be sent to the end node B module.
In order to coordinate the two XBee modules of end node A and end node B to send messages to each other. Use the XBee USB adapter to configure the XBee module, configure one of the module nodes to coordinator API (coordination end node) mode through the software X-CTU, and configure the others to router API (terminal node) mode to ensure these two nodes In the same network. In this way, the two nodes can transmit data according to the XBee communication protocol.
3.2 The hardware design of the wireless receiving end of the Arduino controller
The Arduino controller is a Simple i/o platform based on the original code, and has the characteristics of simple and easy-to-understand development language and development environment. It uses a high-speed microprocessor controller (ATMEGA328), which can be easily connected with various sensors and electronic components.
Arduino main performance description:
Ø Digital I/O Digital input/output terminal is 0-13.
Ø Analog I/O Analog input/output terminals total 0-5.
Ø Input voltage: no need for external power supply or external 5V-9V DC voltage input when connected to USB.
Ø Output voltage: 5V DC voltage output and 3.3V DC voltage output and external power input.
Using the above characteristics of the Arduino controller, this article directly connects the terminal node XBee module to the Arduino controller at the receiving end. When the XBee receives the control information, the Arduino controller outputs a 5v DC voltage for the relay to pull in. Control the opening and closing of smart curtains.
Figure 2 Arduino controller
4 Software designFor the smart curtain function based on XBee wireless technology, the software design to realize this function through program remote control mainly includes two parts: one part is the program of the wireless sending module in the tablet computer (upper computer) of the mobile smart robot.
The other part is the program of the wireless receiving module in the remote data controller Arduino (lower computer). The former is written in the object-oriented visualization language VC++, and the latter is written in the Arduino language.
The user can remotely control the forward and reverse rotation of the curtain motor by operating the upper computer control interface buttons (open the curtain, close the curtain, stop the curtain), and realize the switch operation of the smart curtain. When the mouse moves to a certain area, the corresponding control instruction is called, and then the movement of the electric curtain is controlled remotely through the control system. Among them, when the curtain switch ends, the drive signal is automatically cancelled to stop the curtain movement. When the curtain needs to be parked in any state, just press the button to stop the curtain during the movement of the curtain.
4.1 The software realization of the upper computer control interface
The communication between the host computer and XBee (coordinator API end) is completed through serial communication.
First use the ND command to find the node information in the network, and the data bit sent: 0x7E 00 04 08 09 4E 44 5C, to ensure that the coordinating end node and the end node are in the same network.
Secondly, using the communication protocol between the XBee modules of the wireless network, the coordinator API side sends the relevant character defined by itself to the router API side (take opening the curtain as an example to send the character K). The specific data is shown in Table 2.
Table 2 Send data
According to the above communication protocol, a Windows-based human-computer interaction control interface is developed on the host computer PC, which is used to correspond to the movement and click of the mouse. It is mainly responsible for interacting with the user and feedback the status information of the home appliance. The control interface is shown in the figure. 3 shown.
Figure 3 Control interface
As shown in Figure 3, the monitoring interface of the smart curtain is composed of six buttons and two text boxes. Among them, the mode switch button in the communication mode box is used to switch the control mode of the smart home to the Internet of Things mode or the GSM mode, and the text box is used to display the current control mode. In the smart switch box, the two buttons on the left are to control the working state of the light, and the three buttons on the right are to control the working state of the curtains. The text message mode box is to display the specific content of the message. This article mainly introduces the control of smart curtains under the wireless network Internet of Things mode, so the GSM control method will not be introduced here.
4.2 Software realization of wireless receiving end
The wireless receiving end is mainly composed of Arduino controller, XBee module (terminal node) as router API end, relay and electric curtain. When the terminal node receives the corresponding character, the Arduino controller outputs 5v. The specific software flow chart is shown in Figure 4 (take opening curtains as an example for illustration).
Figure 4 Software module design of lower computer
5 concluding remarksThis article has completed the hardware design and software design of the smart home monitoring system of the smart mobility robot, and has been debugged to verify the effectiveness and practicability of the designed system. Its innovation is to introduce the Xbee module into traditional home appliance communication control. Compared with the previous wired home appliance communication control, it eliminates the difficulty of integrated wiring, saves costs, and increases the flexibility of controllable points. This article only gives an example of point-to-point. According to this idea, a large area smart home can be realized with a little expansion. With the development and maturity of wireless communication technology, wireless communication will inevitably be more and more widely used in future smart home technologies, and has broad application prospects.
Power Charger,Portable Charger,Portable Power Bank,Portable Battery Charger
Shenzhen Jinziming Electronic Technology Co.,LTD , https://www.powerchargerusb.com