OFweek smart home network news With the development of computer technology, information technology, control technology, and people's material living standards continue to improve, the traditional housing is obviously not able to meet people's needs, smart home came into being. A real smart home sensor network can connect all items through RFID and other information sensing devices to the 3G Internet to achieve intelligent identification and management. The dynamic smart home system studied in this paper can not only realize the functions of traditional home system sensor data collection, analysis, security alarm, and mobile phone short message remote control of household appliances, but also can get home information in real time through the mobile smart gateway. . Through SMS and Internet communication with smart home gateways, remote control of smart home systems is achieved.
1 Dynamic smart home system based on Zynq platform
1.1 Background of System Research Current rapid development of embedded design, in the scene containing a large number of data processing modules (such as intelligent video surveillance, advanced industrial control applications), high performance, low power consumption, high flexibility of the processor The demand is high. Existing microprocessors lack sufficient signal processing capabilities. The Zynq-7000 is a high-performance and low-power processor platform with an ARM+FPGA architecture that provides flexible and scalable solutions. Program.
The traditional smart home system main control CPU generally adopts the ARM+Zigbee solution. In this system, the innovative use of Zedboard FPGA (field programmable logic gate array) as the main control CPU, Zigbee module uses the CC2530 Soc solution, and the GPRS module uses the sim300 Module, using AT commands to interact with the user's mobile phone, Internet interaction through BOA, CGI implementation. The FPGA implements PWM signal generation logic to control the motor.
1.2 System Implementation Architecture As shown in Figure 1 below, the functions completed by the main control module mainly include the interconnection with Zigbee coordinator, GSM/GPRS, Internet, camera video capture and motor-driven trolley control. The module contains two processes. Process one is responsible for taking Zigbee network data and distributing the processed data to the GSM/GPRS module and the Internet WebServer module.
Figure 1 System Hardware Structure Framework
The process includes three separate threads that interact with each module. The flow is as follows: pthread_t tid[3]; //Create the thread number pthread_attr_t attr[3]; //Allocate space for thread pthread_attr_init(&attr[0]); pthread_attr_setscope(&attr[0], PTHREAD_SCOPE_SYSTEM); . . . . . . // Thread space initialization pthread_create(&tid[0],&attr[0],thread_serial_ttyPS1,NULL); //Create thread 1: Use for ZedBoard to get ZigBee network data pthread_create(&tid[1],&attr[1],thread_serial_uartlite_debug,NULL ); / / create thread 2: for ZedBoard to send packets to the GSM pthread_create (& tid [2], & attr [2], thread_serial_ttyPS1toWeb, NULL) ;/ / create thread 3: for ZedBoard to send packets to the Internet pthread_join (tid [0], NULL);. . . . . . . //Add thread pthread_rwlock_destroy(&GPacketBuf_rwmutex) to the main function; //Release thread
The second process is a CGI module, which is called by WebServer. Its function includes parsing data packets and presenting ZigBee information to users in the form of web pages. The flow is as follows: The first step is to create the data packet format. The second step is to use the HTML language to inform the user through the webpage of temperature sensors, battery supply voltage, fire alarm, anti-theft alarm, fan, and light switch status collected from the Zigbee ad hoc network. The user can view the complete information of home conditions by logging in to the Internet remotely. The specific format of the data packet will be given at the following ZigBee module.
2 ZigBee ad hoc network
2.1 ZigBee Network Node Configuration There are three kinds of equipment in the ZigBee network: Coordinator: responsible for starting the entire network, it is also the first device of the network. The function of the router is mainly to allow other devices to join the network, and to assist themselves as a terminal device. The terminal device has no specific responsibility for maintaining the network structure. It can sleep or be awakened.
2.2 Serial Communication Packet Format
ZedBoard master and Zigebee coordinator communication packet format is as follows: StartByte -> 1B (on behalf of the packet start byte 0x47) PropertyId-> 1B (for attribute ID) NodeId-> 1B (for Zigbee terminal device node ID) PacketLength- >2B (represents the length of the entire packet) PrivateData->XB (represents the payload content corresponding to the attribute ID X = PacketLength -6) EndByte->1B (represents the packet end byte 0x48)
The unified format of the data packet is not only used for communication between the ZigBee coordinator node and the ZedBoard, but also used for the data packets sent from the ZedBoard FPGA development board to the serial communication between the GSM modules, and also applicable to the data packets transmitted from the ZedBoard to the Internet CGI module. That is, these three data packets are unified. The receiving module then parses the received message through the packet protocol. The GSM module judges whether there is a warning condition by parsing, and then sends a text message to the user to warn that the Internet module then displays the data collected by each sensor as a text on the web page.
2.3 The realization of motor drive and smart car This module is realized by L298N double H-bridge DC motor drive module, the drive part of the terminal power supply range Vs is +5V to +30V, the drive part of the peak current is 2A, the schematic diagram shown in Figure 2 below, In the figure, IN1, IN2, IN3, and IN4 are control signals. When IN1 is 0 and IN2 is 1, the motor a rotates forward, IN1 is 1, and IN2 is 0, the motor a is inverted. When IN1, IN2 are both 0 or 1 at the same time, the motor stops rotating, PWM-a, PWM-b are enable terminals, and then FPGA PWM output signals, L298N-a, L298N-b are motor A output terminals. The principle of motor b is the same as above. The DC motor drive is mainly used to drive the smart car to realize the movement of the car in the room and use the camera to collect the real-time information of the room and return to the user through the Internet in time. In addition, the smart car also has a ZigBee module, which is equipped with a heat release. Electrical body infrared sensor to detect strangers in and out of the room, flammable gas sensors to detect the presence of combustible gas leakage in the kitchen, the smoke sensor to detect whether there is a fire.
Figure 2 DC motor drive schematic
2.4 GPRS/GSM Module In the GPRS module, we use SIM300 development module provided by Simcom, mainly to use 8051 microcontroller to achieve data analysis, to determine whether there is a warning message, and then send a warning message to the user, send SMS to the user Is through the microcontroller serial port to the SIM300 serial port to transmit a series of AT instructions to achieve.
In the course of sending AT commands, through experiments, it has been found through experiments that the frequency of sending AT commands is too high will cause the SIM300 to fail to respond and cause the operation to fail. If the transmission frequency is too low, the real-time nature of the information will be lost, and the user cannot learn the warning information in time. And by sending short messages to control, GPRS as a medium to achieve user and smart home system interoperability. Similarly, the Internet side also serves as an intermediate medium to implement the user's control of the smart car. The goal of dynamic browsing. The specific communication flow chart is shown in Figure 3 below:
Fig. 3 Schematic diagram of information transmission between modules of the system
3 Conclusions (1) Embedded high-performance processor ZedBoard is used as the main control CPU to implement complex application logic using the Linux software platform: for example, defining communication protocols, collecting and distributing information, and defining Uart IP cores not only improve the development cycle It is easy to expand later; moreover, the overall system function is also relatively stable.
(2) In the serial port communication, experiments have found that packet loss may occur at high baud rates, which may result in inaccurate information feedback at low baud rates, resulting in a decrease in real-time performance of the system. Finally, the portability of the system will be unified through testing. The rate is set to 9600.
(3) By introducing the smart car, the video information collected by the mobile car can be timely transmitted to the Internet. The next step will analyze the relationship between the serial data rate and the effectiveness of MMS transmission, study and optimize the MMS delivery strategy, and strive to achieve real-time monitoring of the Internet at the same time, when the SMS can send an alarm signal, the GPRS module can immediately feed the picture in the form of MMS. To the user.
Bubble Bag Machine,Dense Bag Cutting Machine,T-Shirt Bag Cutting Machine,Computer Automatic Bag Cutting Machine
Dongguan Yuantong Technology Co., Ltd. , https://www.ytbagmachine.com