MATEC Web of Conferences 34 , 0 4 0 1 0 (2015) DOI: 10.1051/ m atec conf/ 201 5 3 4 0 4 010 C Owned by the authors, published by EDP Sciences, 2015 The Embedded Smart Home Control System Based on GPRS and Zigbee Wanli Zhang 1 2 1,a 1 , Guoxin Li , Wei Gao 2 Department of Electrical Information and Engineering, Changchun University, China Department of Information Engineering, Changchun University of Finance and Economics, China Abstract. With the development of the Internet of Things and mobile Internet, smart home appeared a new opportunity, the development of wireless communication, ad-hoc network technique, high reliable connection, large scale networking, repair itself as a new developing direction of smart home. This paper discussed hardware and software design of the embedded smart home control system based on GPRS transmission network and Zigbee technology. This paper also expounds the composition structure and working principle of the system. Through the Zigbee technology to realize the ad-hoc network among the main controller and Zigbee terminal nodes, realizes the branch node information acquisition and command transmission. Through the GPRS network mobile client can realize information collection and remote monitoring of household facilities. 1 Introduction Smart home is a house as a platform, the use of comprehensive wiring technology, network communication technology, security technology, automatic control technology, audio and video technology to integrate the life related household facilities, to build efficient management system of residential facilities and the family schedule things, and improve home security, convenience, comfort, and realize environmental protection and energy saving living environment. The emergence of the Internet of things has injected new vitality to the development of smart home, brought new features. Wireless communications, ad-hoc network technique, high reliable connection, large scale networking, repair itself as a new developing direction of smart home. Zigbee is a recently developed a kind of short-range wireless communication technology, because the Zigbee has close range, low power consumption, low data rate and low cost etc., make it particularly suitable for family Internet of things. In this paper, based on the Zigbee technology, build the home wireless local area network (LAN), through the master controller for information acquisition and command transmission node equipment.[1] To meet the demand of mobile client remote wireless monitoring, this paper combines Zigbee technology and GPRS technology, namely the family combined external and internal wireless network mobile Internet, using the technology mature and stable GPRS network has realized the remote wireless control of smart home system, improve the security of smart home system and control of convenience. a 2 The overall system design The embedded smart home control system based on GPRS and Zigbee is mainly composed of GPRS wireless network, main controller, Zigbee wireless network of three parts. The main controller can realize the function of the gateway, also connect GPRS wireless network and Zigbee wireless network, the system block diagram is shown in Figure 1: Figure 1. The system block diagram Zigbee wireless network realize family facilities information collection, management and control. Due to family node is less, so the Zigbee wireless network to take star network topology, including Zigbee coordinator and several Zigbee terminal nodes.[2] Each terminal node corresponding to a kind of household facilities or sensors, Corresponding author: wanlizhang@126.com This is an Open Access article distributed under the terms of the Creative Commons Attribution License 4.0, which permits XQUHVWULFWHGXVH distribution, and reproduction in any medium, provided the original work is properly cited. Article available at http://www.matec-conferences.org or http://dx.doi.org/10.1051/matecconf/20153404010 MATEC Web of Conferences realize the control of facilities and information acquisition. Data information is exchanged between Zigbee coordinator and main controller, and main controller send queries or control command to the end nodes by Zigbee coordinator, according to monitoring and controlling each household node. Using the masterslave control mode, convenient and free to join or remove the terminal equipment. The user mobile phone terminal exchange information with system through the GPRS network. GPRS module will receive the information is passed to the main controller, the main controller to decrypt information, perform user request, perform monitoring and controlling task. 3 The hardware design 3.1 Selecting main controller In order to improve the function of the system, to reduce the cost of the system, main controller select STC12C5A60S2 microcontroller. The running speed of STC12C5A60S2 single-chip computer is 8 ~ 12 times than the standard of 51 kernel single-chip computer; There are 8 road 10 bit AD; With SPI interface; Have 1k bytes of internal extension RAM; And a serial interface more than standard of 51 kernel single-chip microcomputer; Add the two timers, PWM function; A watchdog timer. In connection with the Zigbee module microcontroller through the SPI interface. SIM900A via a serial port connected to the microcontroller, through MAX232 achieve level transformation. Single chip microcomputer minimum system is shown in Figure 2: TXD RXD 11 10 P10 P11 P12 P13 SS MOSI MISO SCLK 1 2 3 4 5 6 7 8 +5V S1 SW-PB C3 + 30uf R2 9 1k R1 200 29 14 15 TXD RXD P10 P11 P12 P13 P14 P15 P16 P17 RESET PSEN P00 P01 P02 P03 P04 P05 P06 P07 P20 P21 P22 P23 P24 P25 P26 P27 T0 ALE/P T1 RD 31 R11 19 18 +5V 2.0K EA/VP WR X1 X2 IN T0 IN T1 STC12C5A60S2 39 38 37 36 35 34 33 32 21 22 23 24 25 26 27 28 U2 P00 P01 P02 P03 P04 P05 P06 P07 9 RXD 12 10 TXD 11 3 C4 1uf P24 P25 P26 C5 1uf +5V C6 1uf 1 2 16 R-OUT2 RR-IN2 R-OUT1 RR-IN1 T-IN2 T-IN1 CAP 1- RT-OU T2 RT-OU T1 CAP 2- CAP 1+ CAP 2+ CAP + CAP- VCC GND 1 6 2 7 3 8 4 9 5 8 13 7 14 5 C7 1uf 4 6 15 MAX232 30 17 16 12 13 U3 S1 SW-PB S1 R20 VCC P24 P25 P26 P00 P01 P02 P03 P04 P05 P06 P07 10K SW-PB 30pF C1 S1 XTAL 11.0596MHz SW-PB S1 30pF C2 DB9 C8 CAPACITOR SW-PB VCC 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 VSS VCC V0 RS R/W E DB0 DB1 DB2 DB3 DB4 DB5 DB6 DB7 BLA BLK LVTTL serial ports, and hardware flow control, support 5 v ~ 24 v ultra wide scope of work, make its can be very convenient to connect with the main controller, which provide users mobile phone with voice, SMS and GPRS data transmission, and other functions. In this system ATK-SIM900A connect to the main controller through RS232 serial port. 3.3 The design of the Zigbee coordinator This design chooses CC2530 as Zigbee network master control chip. TI company CC2530 chip, which is used in the manufacturing of IEEE802.15.4 and Zigbee or RF4CE, provide a real SOC solutions. [3]It can use very low cost to form a powerful network node. CC2530 realizes the Zigbee protocol stacks, internal also integrates enhanced 8051 CPU. Peripheral circuit is rich, including the commonly used general I/O mouth, SPI interface, A/D conversion, serial port and so on. 3.4 Zigbee node controller design CC2530 can not only as the Zigbee network master control chip, can constitute a Zigbee node controller. Because CC2530 periphery circuit is rich, fully meet the needs of the furniture control facilities. [4]As a result, the node controller takes 2530 as the core, plus some sensor, relay, and drive circuit. Circuit will be different due to the facilities. 4 The software design This system software design part mainly includes the main controller software design, Zigbee coordinator software design and Zigbee terminal nodes software design. GPRS module is mainly responsible for short message transceiver, and through a serial port sent to the main controller. [5]The processing of short messages will be completed in the main controller. Main controller using the AT command set send various commands to the GPRS module. Main controller uses the SPI interface for data exchange between Zigbee. 4.1 Main controller software design Main controller is mainly responsible for GPRS module initialization, key processing, data acquisition and display. [6]When the alarm information appears, send short message to the user or alarm center through GPRS module. Short message is read and processed through interrupt. The main program flow chart and the interrupt program flow chart are shown in Figure 3: 1602 Figure 2. Single chip microcomputer minimum system 3.2 GPRS module This system adopts the ATK-SIM900A-V12 module. The module is ALIENTEK launched a high-performance industrial GSM/GPRS module. ATK-SIM900A module has onboard SIMCOM company industrial-grade dualband GSM/GPRS module, and work on the doublefrequency: 900/1800 MHz, can realize voice, SMS, data and transmission of fax information on low-power. ATKSIM900A module supports RS232 serial port and 4.2 The coordinator software design The coordinator role is largely responsible for the entire Zigbee network create, manage, and sensor data forwarding. On the electrical coordinator will scan all wireless channel, choose a free channel to create a network. [7]Distribute network address to collection 04010-p.2 ICMME 2015 nodes which apply to join the network, and through a binding table to maintain communication relationship with all acquisition nodes. And the received data is sent to the main controller. The coordinator flow chart is shown in Figure 4: But no matter which control facilities, its working process is the same. Receiving coordinator of command, explaining the command execution, then the acquisition of data or the results will be sent to the coordinator. [8]Zigbee terminal node program flow chart is shown in Figure 5: Figure 5. The Zigbee terminal node program flow chart 5 To summarize This paper studies the embedded smart home control system based on GPRS and Zigbee. Zigbee is a low rate wireless communication technology of short distance. Main advantage in low power consumption, low cost, low latency and network capacity is big, and adopts wireless ad-hoc network method, provided great convenience in adding or removing for household facilities, avoiding the cumbersome wiring. With the popularity of smart phones, real-time dynamic understanding of household facilities, through a mobile operator to remote control of household facilities, not only improves the security of household, but also has brought great convenience to people life. Figure 3. The main program flow chart REFERENCES 1. 2. 3. Figure 4. The coordinator program flow chart 4. 4.3 Zigbee terminal node software design Different Zigbee terminal nodes control different household facilities, so software design will be different. 5. 04010-p.3 Al-Ali A R, Imran Zualkernan, Fa-di Aloul. A mobile GPRS-Sensors array for air pollution monitoring. IEEE Sensors Journal, 10(10): 16661670. ( 2010) Jun D, Kang J, Kim J, et al. A body sensor network platform with two-level communications. IEEE International Symposium on Consumer Electronics TX Irving, (2007) Kwon J W, Park Y M, Koo S J, et al. Design of air pollution monitoring system using ZigBee networks for ubiquitous-city. International Conference Convergence (2007) Chung W, Yang C H. Remote monitoring system with wireless sensors module for room environment. Sense Actuators B, 113( 1) : 35-42(2009) Wen-Tsai Sung; Chia-Cheng, Hsu.Intelligent environment monitoring system based on Innovative MATEC Web of Conferences 6. 7. 8. Integration Technology via Programmable System On Chip platform and ZigBee network.IET Communications, 7(16):1789-1801(2013) Byun, Jinsung; Jeon, Boungju; Noh, Junyoung; Kim, Youngil; Park, Sehyun.An intelligent self-adjusting sensor for smart home services based on ZigBee communications. IEEE Transactions on Consumer Electronics, 58 (3):794-802(2012) Han, Dae-Man; Lim, Jae-Hyun.Design and implementation of smart home energy management systems based on zigbee.IEEE Transactions on Consumer Electronics, 56 ( 3):1417-1425(2010) Han, Dae-man; Lim, Jae-hyun.Smart home energy management system using IEEE 802.15.4 and zigbee.IEEE Transactions on Consumer Electronics, 56 ( 3): 1403-1410(2010) 04010-p.4