Smart Home is the use of advanced computer technology, embedded systems and network communications technology, the home of a variety of equipment ( such as lighting systems, environmental monitoring, security systems, network appliances ) through the home network to connect together, since the United States in 1984 After the emergence of real intelligent buildings, foreign countries have nearly a decade of research history, and domestic research in this area is relatively late, from 2003 years only gradually applied to the high-end market, and standards vary. Because the system of smart home has many advantages, such as safety, convenience, high efficiency, fast and intelligent, so that the development and construction of intelligent home become the inevitable trend of world science and technology development.
At present, there are many wireless technology used in the market, there are Bluetooth,WLAN technology, due to complex protocol, high cost, power consumption, etc., so in the home system control promotion is very difficult, so this paper proposed wireless smart home design is based on ZigBee Wireless Module technology, because ZigBee Digital Transmission Module Low power consumption, low cost, easy to network and maintenance, the use of cluster network at the same time will have a unique advantage of self-healing, can overcome the malpractice of network paralysis caused by accident.
1 Structure of the system
The intelligent Home system designed in this paper mainly divides the smart home into three large parts, with the Android TV set as the upper computer part, the CC2531 chip with USB function as the central transmission part ( that is usb-dongle), with the CC2530 chip as the Terminal control module, the Terminal control module is divided into three parts, namely, security Control module, intelligent control module and Energy Metering statistics Module 1 shows.
Figure 1 The entire system is designed
2 How the system works
2 . 1 initialization of the common ZigBee wireless module
Start the hardware, enter the initialization process, the first is to shut down all interrupts, then the hardware circuit board related hardware equipment inspection and configure the system clock, and then perform voltage stability detection, set ADC3 to a standard operating voltage value, through the circuit board ADCL Read the operating voltage of the externally supplied board and compare the ADC3 to see if the voltage is stable, then initialize the board IO Port, and the stack is zeroed. If the voltage is not stable or the battery is low or other original hardware circuit can not work, there will be a different way of protection circuit reset, if it can work, then start to configure the basic operation of the IO port, followed by the initialization of the hardware driver layer, This includes: initialization of the timer, initialization of theADC , initialization of theDMA , initialization of theLEDs , and so on. Then is the initialization process of nonvolatile flash, erasing all the NV regions, then the initialization of the MAC , the initialization of the extended address, the full check of thez-stack , if an item exists or does not exist, writes NV inside, then is the operating system startup initialization, open interrupt, the final use of the circuit board configuration,( the results of the start display on the LCD ), the initialization of the energy metering module, the initialization of the Infrared control module, Initialization of the timing module, enter the operating system to start working.
2 . 2 Establishment of the entire network
The first is to start the TV, turn on the TV above the smart home control interface, send the command to join the network, start to create the entire smart home network. ZigBee Digital Module coordinator after receiving the command, began to establish a network, when the network was established, in the time the coordinator allowed to join, start to start ZigBee Wireless module terminal equipment, terminal equipment Discovery Network, and send the request to join the network, After the coordinator receives the request to join the network, starts to confirm the information, sends the confirmation to join the network, the terminal equipment receives the confirmation request which joins the network, then follows the ZigBee agreement, sends own long address, the short address information to the Coordinator, the Coordinator receives the message to pass after The USB interface is passed to the TV. The whole system starts to go into normal working condition.
3 The role of the co-apoptosis device
The coprocessor plays a central role in the whole network, connecting the TV set as the host computer, receiving the command of the TV through the USB interface, and analyzing the commands received, according to the analytic commands, the protocol of the smart home designed by this system is sent to the corresponding nodes. and receive several terminal nodes upload data, and then sent to the TV. For the specific process, please See flowchart:
Figure 2 TV Send command let the coordinator set up the network
4 Work Flow of energy metering and statistic module
The energy metering module is a CSE7780 chip,RX8025,BL8023 , and CC2530 chip with a power metering,RTC clock and ZigBee Communication module, this module has a main function:l measure the amount of electricity measured in real time and passed to the coordinator. 2 The measured data is stored in the EEPROM , according to the requirements of the TV, to view the information of the one-month charge per day or to view a year of electricity information read out to the TV. 3 perform RTC timings and provide a time message to the entire module. From the coordinator to receive the timing of the information, according to the resolution of the time to drive the chip of the BL8023 relay , the control relay on or off, in order to achieve the purpose of timing.
Figure 3 UI interface for energy metering on TV
5 Workflow of infrared control module
On the TV, click on the button to send control commands to the Coordinator, the Coordinator received instructions sent to the terminal, the terminal received instructions after the Internet TV communication protocol began to parse the data, the parsed instructions to re-follow the machine control instructions re-data combination, Then the infrared emission of the function of the data sent to the air-conditioning remote control for air conditioning work. If there is no action, re-send a control air conditioning instructions, infrared emission carrier is 38K carrier, this module uses 32M crystal oscillator, duty ratio is 1/3, the main work details see figure 3.
Figure 4 Intelligent control Flowchart
6 Work Flow of security monitoring module
First, the body detection module power up, after $Seconds of voltage stabilization time, allowing this module to be added to theZigBee Number PassNetwork, and then start the security monitoring on the TV Start command, the camera will open, while sending into the security mode to the Coordinator, the coordinator received the command, the command sent to the terminal, the terminal received the command after the start of the system security mode, need to delay -~ -Seconds to enter the normal detection state, so that users leave the monitoring site to prevent false positives. After the system enters the monitoring mode, if someone passes, it will produce an interrupt, and the interrupt must be greater than -Milliseconds, if less than -Millisecond description is interference, when the interrupt is generated, the terminal will be sent by the protocol a warning command to the coordinator, the coordinator received the command sent to the TV, the TV received the command after the start of the control camera to start recording, terminal every2Seconds to send someone a warning command that lasts6Seconds, if in this6Seconds, there was an interruption again, and then someone warned6Seconds will be refreshed, re-clocked, the terminal is still every2Seconds to send: if6Seconds of someone's warning time does not happen again someone interrupted, will enter6Seconds of no warning mode, the interrupt will be2Seconds to send an unmanned warning command to the coordinator, the Coordinator sends the TV, the camera still continues recording, if the6Seconds of no warning time, another interruption occurs, will re-enter6Seconds of someone warning mode that the camera is still persistent video if6The end of the second's no-warning time has not been interrupted, then the terminal will not send an unmanned protocol command to the Coordinator, when the TV received three times no command information after the camera turned off the video function.
7 Summary
The IoT TV smart Home system based on ZigBee Wireless module is relatively simple relative to WiFi, Bluetooth and other wireless communication systems, but it is still relatively complex, through the construction of the entire IoT TV structure framework and communication protocols , through a few typical smart home functions to the entire IoT TV smart home of the specific workflow, development details and the entire framework to show the reader, the design through the actual development, has been able to achieve the effect of the demonstration. Smart home is not only focusing on the future, all intelligent, but also to focus on the present, is not using intelligent household appliances, smart home is the purpose of making home life more comfortable, safer, more convenient.
Design of ZigBee Intelligent Home system based on Android TV