Remote Control System of Smart Appliances Based on Wireless Sensor Network

Remote Control System of Smart Appliances Based on Wireless Sensor Network Tengfei Zhang1, Qinxiao Li1, Fumin Ma2 1. College of Automation, Nanjing Un...
1 downloads 2 Views 341KB Size
Remote Control System of Smart Appliances Based on Wireless Sensor Network Tengfei Zhang1, Qinxiao Li1, Fumin Ma2 1. College of Automation, Nanjing University of Posts and Telecommunications, Nanjing, Jiangsu, China 210023 E-mail: [email protected] 2. College of Information Engineering, Nanjing University of Finance and Economics, Nanjing, Jiangsu, China 210023 Abstract: Diversification of remote control mode is the inevitable trend of development of smart appliances. In this paper we designed and developed a remote control system of smart appliances based on ZigBee wireless sensor network, realizing the diversification of remote control mode of smart appliances. The ZigBee technology is used to form a control network of household appliances within the house, two remote control networks of Internet and SMS are set up with the network interface module and GSM module. Status of the home appliances can be queried and controlled through either the remote PC interface or mobile phones. The experimental results show that: the system is reliable and can realize the remote control and inquiry of household appliances. The system has the advantages of convenient in control, flexible in adding new devices. Key Words: Smart appliances; Remote control; Wireless sensor network

1 INSTRUCTIONS With the development of science and technology, Modern home environment is paid more and more attention. The number of functions has been growing; nevertheless smart appliances have formed "isolated islands” of the information, which become the bottleneck in the development of smart appliances. In additionˈoperation near the appliances is required in traditional control mode, which limits the scope of activities. Reference[1] sums up the development status and analyses exiting problems of remote control system of smart appliancesˈand then puts forward that the future trends of system will be reflected in the following three aspects: Networking technology from wired to wireless, diversification of remote control mode, energy-saving and smart will lead the new trend. Therefore, diversification of remote control mode is the inevitable trend of development of smart appliances. It's an important part of smart home. Remote control system of smart appliances mainly consists of two parts: household internal control network and remote control network. Traditional household internal control network is generally implemented through wiring. This method is not only troublesome but also has poor scalability. Wireless network technology becomes new trends with its simple and convenient networking. ZigBee technology characterizes good security, high reliability, Foundation˖the National Natural Science Foundation of China under Grant No.61105082; the Natural Science Foundation of Jiangsu Province No.BK2012470; the Natural Science Foundation of Jiangsu Province Education Commission No.11KJB120001; Qing Lan Project of Jiangsu Province.

c 978-1-4673-5532-2 2013 IEEE

low cost, low power consumption, large network capacity. With these features, ZigBee is widely used in smart home system. Traditional remote mode in reference [9] uses the PC as a local server, which has a high cost. Moreover this method requires PC in the state of power on and communicating, in addition, hardware and software that may interfere with communicating tasks can not be run on the PC. We have developed a remote control system of smart appliances based on wireless sensor network, applying the rapid developing mobile network and Internet to the field of remote control. The system uses a high-performing, low-costing, low-consuming chip STM32 as information processing center, without the high-costing PC as a local server. ZigBee technology is adopted to form household internal control network instead of the cumbersome wiring. This method requires no wiring, has a short installation period and is convenient to move and add network node. Traditional key an infrared control is included but reformed to make a diverse and various control modes. Each remote control mode has account login and information matching settings to add to security of the system.

2 OVERALL DESIGN Remote control system of smart appliances consists of two parts: household internal control network and remote control network.Fig1 is the overall structure of the remote control system. According to the control signal, smart appliances can be divided to two types: Infrared controlled, such as the air conditioner; Relayed controlled, such as the light.

3704

Household internal wireless sensor network adopts ZigBee technology and consists of ZigBee coordinator, the first or second type of ZigBee node, and the first or second types of function driver module (including the relay). ZigBee coordinator establishes ZigBee wireless sensor network on the basis of ZigBee protocol. ZigBee node is embedded in smart appliances with the function driver module. ZigBee wireless sensor network can be bidirectional communication. While collecting operating parameters of smart appliances and uploading them to the information processing center, it can also start function driver module to change operating parameters of smart appliances according to the control command given by the information processing center. Considering the convenience of close operation, traditional key and infrared control are included in the whole system. The key is connected to ZigBee node and the node also replaces the infrared receiver. Remote control mode adopts SMS and Internet. As the interface with outside information, GSM module and Internet interface module are the gateway from household to outside and they assume diffident protocol conversion task between household and outside. GSM module mainly adopts Siemens TC35i. It communicates with information processing center through USART, and uses AT commands to send messages and read the information in SIM card. Internet Interface adopts ENC28J60.It communicates with the host computer through TCP/IP protocol and with information processing center through SPI. Remote control by SMS is simple to operate, only send a message such as "open light" to the designated number, and then the remote light in household will be on. Or send a message such as "inquire about air conditioner" to obtain operating parameters such as on/off and temperature of air conditioner. When operating parameters of smart appliances are changed through other method, mobile phone will received an attention message, which can be close or open through send a message such as "close/open attention". This attention method is set to make up for non-real-time display of remote information for inquiring regularly is a waste of money. When operating smart appliances through any other method, if SMS attention is open, mobile terminal will be informed. Otherwise shied

mobile phone from the change and it can only send a message to obtain it. Internet control method mainly depends on the host computer interface to operate smart appliances in a remote distance. The interface consists of three parts: user’s login information, parameters' real-time display, remote control button. Users can refer to the parameters and control remote appliances with the button in the host computer interface. In summary, it can be seen that the remote control system we have developed includes the following control method: Key, infrared control, SMS, Internet. The system is compatible with traditional close control and integrates with remote control.

3 HOUSEHOLD INTERNAL NETWORK BASED ON WIRELESS SENSOR NETWORKS As wireless transmission technology in smart home, the most important problem to concern is power consumption, cost, network capacity and security. ZigBee devices is low-power-consumption with low transmission rate, 1mW transmit power and sleep mode in spare time. ZigBee wireless sensor network can support up to 65,000 nodes. Despite limited transmission distance and bandwidth, 1~100m is sufficient to meet the needs of general families and 20~250KBPs bandwidth is also enough to deal with home-related information such as security, temperature and humidity. All above makes ZigBee technology has unique advantages in establishing household internal wireless networks. 3.1 Network Topology According to communicating ability, devices in ZigBee network can be divided into full function device (FFD) and reduces function device (RFD). According to assigned tasks, devices can be divided into PAN coordinator, coordinator and general device. There is star, mesh and cluster for network topology. In a star network, all the devices communicate with the center device-PAN coordinator. This type of topology is mainly used in small scope indoor application such as home automation, personal health care and so on. Our system adopts a star topology, in other words, a FFD is used as coordinator communicating with all the child nodes. All the child nodes communicate only with

2013 25th Chinese Control and Decision Conference (CCDC)

3705

the coordinator. Data connected by the nodes just waits for coordinator to process. Child node should only execute instructions from the coordinator. Coordinator is responsible for the establishment of the network and allocation of address numbers for the node to join. Here, we adopt 16 bit short address, to conserve bandwidth. 3.2 Formation of ZigBee Network In a star network, coordinator and nodes share the same hardware. ZigBee module adopts CC2430 from Chipcon company. It combines the industry-leading RF 2.4GHz transceiver, can improve performance to meet the requirements of low-cost and low-consumption in ZigBee-based 2.4GHz ISM band applications, and support quick formation of ZigBee node. The structure of the module is shown in fig2.

Fig3 is the structure of hardware in household internal wireless sensor networks. It consists of one ZigBee coordinator, two ZigBee node controllers and function driver circuit including two types of close control methods.

In fig3, appliance 1 is formerly controlled by infrared,such as air conditioner, it can also be controlled by key. Remote control signal and the traditional infrared signal comes together at ZigBee node 1.Build a list of status for appliance 1and maintain it due to real time control signal. Then when the coordinator inquires, the node only need to return part of the list. Appliance 2 is formerly controlled by relay, such as the light. ZigBee node 2 receives remote control signal and traditional key signal and produces signal directly controlling the relay. 3.3 Programming of Zigbee Network Initialize the devices in ZigBee network. Set the status to null and make it detecting the environment to decide whether to rejoin or join existing network.Fig4 is the network establishing flow chart of the coordinator. 3706

In ZigBee protocol, networks are distinguished by a14-bit personal area network identifier(PAN ID).There are 16 channels at the rate of 250Kb/s in 2.4GHz band. Channel spacing is 5MHz.At the start of establishing a network, the network lay will request the MAC layer to effectively scan the energy of predetermined channel or a default one by the physical layer in order to find possible interference. Then the network layer management entity actively scans to check up PAN descriptor and choose a suitable network from the rest of the channel. Next step is determining PANID. If ZDAPP_CONFIG_PAN_ID is defined as 0xFFFF, the coordinator will create a random PANID (0~0x3FFF)

2013 25th Chinese Control and Decision Conference (CCDC)

according to its IEEE address. Otherwise PANID will be determined by ZDAPP_CONFIG_PAN_ID. ZigBee node detects an existing network's PANID and requests to join in. Work flow chart of ZigBee coordinator is shown in Fig5.After establishing the network, the coordinator constantly check whether there is child node to join, remote control command, connects operating parameters from the nodes and sends operating parameters to information processing center. Start Initialize the device Establish a network

Child node to join?

Y

Allocate ID for the node

N

Remote control order?

inquire Broastcast control control/inquire˛ command

Y

control Broastcast require command

N

Collect operating parameters of appliances

Send parameters to information processing center

Fig5 Work flow chart of ZigBee coordinator

Work flow chart of ZigBee node is shown in Fig6.After joining the network, ZigBee node constantly checks whether there is a remote control command, key/infrared control command ˈ connects operating parameters of smart appliances, inquires changes in parameters and sends the changed parameter to the coordinator.

4 REMOTE CONTROL OF SMART APPLIANCES BASED ON STM32 AND GSM 4.1 Design of SMS Transceiver Circuitry GSM module adopts Siemens TC35i.Fig7 is its structure of hardware.

TC35i is connected to STM32 through USART and STM32 will give TC35i the start signal IGT.

2013 25th Chinese Control and Decision Conference (CCDC)

3707

4.2 Programming of Remote Control by SMS First of all, initialize the TC35i module. To start TC35i, give IGT pin a low level pulse lasting longer than 100ms, and the decline duration of the level may not be longer than 1ms. TC35i must establish AT connection before sending AT command. It means that TC35i can work properly when the system receives "OK".Fig8 is the flow chart of the initialization.

USARTx is configured as follows: BAUDRATE =9600 baud, word length=8, one stop bit, no parity, disabled hardware flow control (RTS and CTS signals), open the receiving and transmission. Operation on TC35i must use AT command. The command begins with AT and ends with enter "\r". For example, the handshake signal "AT\r". Command fed back by TC35i begins with "\r\n" and ends with "\r\n". Moreover, the string in the feedback can also include "\r\n".

5 REMOTE CONTROL OF SMART APPLIANCES BASED ON STM32 AND INTERNET 5.1 Design of Internet Interface Circuitry Due to rich on-chip resources of STM32, Internet interface chip ENC28J60 adopts simplified independent media interface to connect to external physical layer. The structure of the module is shown in fig10. STM32 provides the communication clock (SCK). ENC28J60 is connected to STM32 by two interrupt pins (INT and WOL) and SPI pins (SO, SI, SCK, CS).The data transmission rate is up to 10Mb/s. STM32

ENC28J60

CS

TCP/IP

SI

SCK INTX

SO SCK

TX/RX buffer

MAC

PHY

Ethernet transformer

RJ45

INT WOL Fig10 Hardware structure of Internet Interface module

STM32 communicates with TC35i through USART interrupt.Fig9 is the main flow chart of STM32 receives and sends messages. USART interrupt will change system server.

5.2 Programming of ENC28J60 Communicating with the Internet Open source uIP software package provides a solution to establish a TCP/IP protocol stack for embedded microprocessors. It supplies the Internet with a series of necessary agreements. uIP1.0 version realized important protocols that are according with IEEE802.3,such as ARP, ICMP, IP, TCP, UDP and so on. uIP1.0 is grafted onto ENC28J60 controlled by STM32 to realize a simple server. Then remote smart appliances can be controlled by host computer through TCP/IP.Fig11 is the flow chart of its main program. TCP, http listening port number is set to 1200, 80 respectively. IP address is 192.168.0.15. Fig12 is the flow chart of reading Internet data through interrupt trigger.

6 DESIGN OF HOST COMPUTER INTERFACE Host computer interface is developed using NI LabView. TCP listener created by TCP listener function is always waiting for connecting with specified port. Port number is set to 80, and distance address is 192.168.0.15. Fig13 is the functional structure of the interface.

3708

2013 25th Chinese Control and Decision Conference (CCDC)

7 CONCLUSION On the basis of thorough research of ZigBee protocol, TCP/IP protocol and GSM communication technology, we design and develop two types of remote control method using STM32 based on the high-performing, high-code-density kernel as the information processing center and adopting ZigBee module to form household internal control. We also develop a succinct functional interface in host computer.

References [1]

[2]

[3]

[4]

[5]

[6]

[7]

[8]

[9]

Han Jianghong. Intelligent home system and technology[M] Hefei: HeFei University of technology press, 2005 Liang Ming, Li Xuerui, Shi Yonghua. Design of smart home system based on ZigBee [J].Modern Electronics Technique, 2012, 35(17): 116-119 Wan Wenbing, Shi Yong. Design and Research of Smart Swith Control System Based on ZigBee [J].Embedded Systems,2010, 32(3): 57-59 Zhou Denglong, Chen Shuo. Design of intelligent system based on ZigBee wireless communication technology [J]. Modern Electronics Technique, 2012, 35(17): 192-194 Qu Dao,Yang Jifeng, Chen Wei. Design of Intelligent Mobile Monitor System Based on ZigBee and Android [J]. Microcontrollers & Embedded Systems, 2012,(6): 10-15 Qin Shuanglong, Ruan Tianyu. Intelligent Measurement and Alarming System Based on the Technology of ZigBee and GSM [J]. Electrical Automation, 2012,34(4):65-68 Li Wenxue, Chen Aiguo, He Lei, Gu Xiaofenng. Temperature Monitoring and Control System Based on ZigBee and GSM Technologies [J]. Micro Computer Information, 2012, 28(6): 79-81 Li Kaiguo,Kang Zhiliang, Ding Wuwei, Shen Mao. Design of Appliance Control System based on TCP/IP Protocol [J]. Measurement and Control Technology, 2011, 30(7): 41-45

Nan Zhongliang, Sun Guoxin. Design of Smart Home System based on ZigBee Technology [J]. Electronic Design Engineering, 2010, 18(7): 117-119

2013 25th Chinese Control and Decision Conference (CCDC)

3709

Suggest Documents