“With the development of embedded computer technology and communication technology, people’s requirements for wireless measurement and control technology are also increasing. The traditional digital modulation system encoding and decoding technology (such as FSK, ASK, PSK, DPSK, etc.) has been very mature, and various encoding and decoding technologies have been widely used in various Electronic products. In the communication process, the anti-interference ability is strong and the accuracy is high. In recent years, with the increasingly powerful mobile communication network technology, the mobile phone short message service has developed rapidly, and the cost of the mobile phone short message service has been continuously reduced.SMS industry
Authors: Pan Yang, Chen Jiasheng
With the development of embedded computer technology and communication technology, people’s requirements for wireless measurement and control technology are also increasing. The traditional digital modulation system encoding and decoding technology (such as FSK, ASK, PSK, DPSK, etc.) has been very mature, and various encoding and decoding technologies have been widely used in various electronic products. In the communication process, the anti-interference ability is strong and the accuracy is high. In recent years, with the increasingly powerful mobile communication network technology, the mobile phone short message service has developed rapidly, and the cost of the mobile phone short message service has been continuously reduced. The mobile phone short message service is also welcomed by the majority of users because of its low cost, convenience and speed.
The existing Yuline measurement and control systems are all based on a single communication technology, either based on GSM network technology or based on codec technology, and the wireless measurement and control system discussed in this paper is a combination of codec technology and GSM network technology. A wireless measurement and communication system combined with the method. And combined with embedded technology, to achieve short-range special line measurement and remote control functions.
2 System function and structure
Figure 1 Overall block diagram of the system
The development of the system is based on GSM technology, wireless codec technology and embedded technology. The wireless codec module is controlled by the microprocessor, so as to obtain the information of each signal acquisition system quickly and accurately. The information is analyzed and processed, and finally the AT command of the corresponding station is sent to the GSM module through the serial communication n of the microprocessor, and the processed information is transmitted to the end user through the GSM network. It can also receive the instructions of the end user through the GSM module, and the wireless codec module controls the execution mechanism to run the corresponding tasks.
3 Hardware principle
The hardware part of the system consists of microprocessor LPC2131, wireless codec Modules PT2262, PT2272 and GSM modules.
Figure 2 shows the microprocessor module, the microprocessor selects the chip LPC213l of the ARM7TDMI core. The processor has 48 bidirectional I/O ports, including 2 full-duplex UART communication interfaces. Can be used for communication with GSM and PC. Among them, P0.0 P0.1 is the interface of UART0, which is used to connect with the GSM module; P0.8PO.9 is the interface of UART1, which is used to connect with the PC to realize some function settings; P0.28-P0.3 1 and P0.20-P0.23 are dual-phase I/O ports, which are respectively connected to the sending and receiving parts of the wireless codec module; P0.4-P0.7 and P0.10-P0.13 are dual-phase I/O ports, Used for the expansion of keyboard functions; P0.18 P0.19 P0.25-P0.27 and P1.18-P1.25 are also dual-phase I/O ports for the expansion of LCD functions.
Figure 2 Microprocessor circuit
Figure 3 shows the communication interface between the microprocessor and the GSM module. Since the GSM module is RS232 level, and the microprocessor LPC2131 is TTL level, it needs level conversion in the middle. In the figure, P0.0_TxDo and P0.1_RxDO are respectively connected to the Tx0 end and the RxO end of the microprocessor. The few pins on the left are connected to the GSM module. The middle chip SP3232E is a conversion chip between 232 level and TTL level. The microprocessor sends AT commands to the GSM module through its serial communication port, so that it can communicate with the remote end users.
Figure 3 GSM interface circuit
Figure 4 shows the sending and receiving circuit of the wireless codec module, wherein P32262 is the sending module SD0, SDI, SD2, SD3 is the data input terminal to be sent, and is connected to P0.28-P0.31 of the microprocessor. PT2272 is the receiving module RD0, RDI, RD2, RD3 are the corresponding bits of the received data, which are connected with P0.20-P0.23 of the microprocessor. When any position of the sending module is high, the corresponding terminal of the receiving module will also be set high.
Figure 4 Wireless sending and receiving module circuit
4 Working process
1) System software
The system has designed three tasks of module communication, signal processing and GSM communication according to different functions, and selected an embedded operating system μC/OS-Ⅱ with a refined kernel to control the scheduling and distribution among the three tasks. uC/OS-II includes system functions such as task scheduling, process communication, and memory management. The working process and software flow of the system are shown in Figure 5:
Figure 5 System flow chart
The system uses the interrupt method to receive short messages. When the GSM module receives the short message, it will send data to the system. At this time, the system interrupt function is activated to obtain the content of the short message and perform corresponding operations.
2) Communication protocol
①Connection establishment process: The short-range communication of this system selects a four-bit codec module for sending and receiving, and an interrogation communication method is used between the main control system and each acquisition system. If there are n (n≤15) acquisition systems, their numbers are 1, 2, ···, n. When the main control system queries the information of the acquisition system of number m, the four-digit binary code broadcasts its number m, and the number m is divided into After the system receives the broadcast, it will send an acknowledgement signal to the main control system. At this time, if the master system receives the acknowledgement signal, it will send another ready-to-accept signal (“1111”). At this time, the communication connection has been established and data communication starts. If the main control system fails to receive the acknowledgment signal for a long time, the system considers that the acquisition system is faulty and will notify the end user.
②Data transmission process: 4 bits of data are transmitted each time during data transmission, which are D0, D1, D2, and D3, of which D2 and D3 are control bits, and D0 and D1 are data bits. The definitions of D2 and D3 are shown in the following table:
D2 when data is transferred. D3 uses 01, 10 to send each other alternately for main control system identification. Avoid data aliasing. When D2 is received and D3 is 11, it indicates that the data transmission is completed and the communication is terminated.
As a wireless measurement and control system, this system combines long-range GSM communication technology with short-range codec communication technology, combined with embedded technology, with flexible design, multi-channel measurement, and support for online programming and scalability. , especially suitable for immunity control in places with high security. Such as home security control. Install corresponding sensors (such as human body induction, gas sensor, temperature sensor, etc.) on the signal acquisition system, and cooperate with a good human-machine interface to design a complete home intelligent monitoring system, and the system is equipped with an actuator. Users can control the switches of household appliances (such as air conditioners, electric rice cannons, water heaters, etc.) in units or other places, so that they can not only play a monitoring role, but also serve users, just like smart babysitters. Because Yi Neng is connected with the PC, it can also be used as the vehicle management system of the parking lot. The administrator can effectively manage the operation of the entire parking lot in front of the computer. It can also be used for the index gun measurement of the assembly line in the T industry production. The system retains the JTAG port. It can be programmed online on a PC, which can be directly researched and improved by professionals.
The main innovations of the author of this paper are: 1. Multi-channel patrolling: The system can perform patrol detection on the multi-channel signal acquisition system through the wireless codec module, and process the signals in real time. 2. Long and short-range communication: The system has both long-range and short-range communication functions. The wireless codec module and the signal acquisition module are used to realize short-range communication, and the GSM module can be used to realize long-distance communication with end users. 3. Programmable function: The system is equipped with a JATG emulation port and a serial communication port, which can be connected to a PC, and the PC can set the system and support online programming. 4. Interface for entering the machine: The system also retains the expansion interface of LCD and keyboard, which can be used to design and install the human-machine interface. Users can easily and quickly set the system through the keyboard, and can observe the various states of the system from the LCD. . 5. Fault detection: If the acquisition system fails, the main control system can detect it in time and feedback it to the end user.
The Links: MDR250A40 MG150Q2YS40