Wireless sensor network system based on mobile SMS technology
2026-04-06 03:43:19··#1
Abstract: When using various biochemical sensors for multi-point or multi-parameter monitoring of environmental quality in the field, it is necessary to transmit the collected data to the monitoring center or decision-makers in real time. This paper presents a long-distance wireless transmission system for sensor data, combining GSM (Global System for Mobile Communications) technology and short-range wireless communication technology. Utilizing the GSM network messaging platform and the nRF401 short-range wireless communication chip, this system can stably perform multi-point remote monitoring and data transmission at low operating costs. This system can be widely applied in environmental monitoring, remote monitoring, and mobile healthcare. Keywords: Wireless communication; SMS technology; Data transmission; Sensors Abstract: Field environment monitoring for multi-position and multi-parameter based biochemical sensors requires timely and reliable transmission of acquired data to the control center or decision-maker. Combining GSM with short-distance wireless communication technology, a novel wireless small-amount data transfer system based on SMS and the nRF401 short-distance transceiver chip is presented. The system can reliably perform remote control and data transmission with low operational cost. It can be widely used in many fields, such as environmental monitoring, remote control, and ambulant healthcare, etc. Keywords: Wireless communication; SMS; Data transmission; Sensors 1. Introduction In the process of field environmental pollution monitoring using various biochemical sensors, multi-point and multi-parameter monitoring is often required. Due to the dispersed and variable nature of monitoring points and the complex operating conditions, conventional wired network methods cannot meet the needs of today's environmental pollution monitoring. Wireless technology has advantages such as simple circuit, low power consumption, small size, low cost and convenient debugging and is suitable for sites where it is not suitable to lay cables. Therefore, wireless network technology provides a good solution for on-site environmental pollution monitoring. At present, the GSM (Global System for Mobile Communications) network is very complete. Using one of its value-added services—SMS (Short Message Service), no additional terminal equipment is required. Only the GSM module is needed to transmit Chinese and English information. According to the GSM specification, SMS can transmit 140 bytes of information at a time. Therefore, SMS can be used to transmit small amounts of data to realize remote monitoring of sensors or small amounts of data collection. The nRF401 short-range wireless transceiver chip has advantages such as serial communication, low power consumption and low cost. It can realize wireless signal transmission within a range of 100 to 200 meters in open environment conditions, which is very suitable for short-range wireless signal transmission and reception [1]. In this system design, in order to save system costs, only one GSM module is used at the lower GSM module end. Multiple nRF401 short-range wireless transceiver chip modules are used together with this lower GSM module to form wireless communication for multiple data acquisition points on site. 2. System structure and working principle The system structure is shown in Figure 1. The computer is used as the management platform of the whole system. The GSM module of the system is the ZTE MZ28 GSM module; the USB port communication uses the Xuntong USB130 module [2], which maps the USB port to the computer serial port (such as COM3 port, note that the serial port mapped by different computers may be different). Its use is the same as the computer's usual serial port, and there is no need to understand the USB related protocol. First, the computer communicates with GSM module 1 (upper GSM) through the USB port. The upper GSM sends instructions to GSM module 2 (lower GSM) in the form of SMS. After receiving the instruction, the lower-level GSM transmits it to the main MCU via the microcontroller's serial port. The main MCU jumps to the corresponding branch program according to the instruction content, and then sends the corresponding instruction to the lower-level wireless transceiver module through the main wireless transceiver module. The lower-level MCU executes the corresponding instruction received from the lower-level wireless transceiver module, guiding the sensor and sampling circuit to collect data. After the data collection is completed, the lower-level MCU sends the collected data back to the main MCU. The main MCU then sends the collected data or monitoring terminal status information back to the upper-level GSM via SMS through the lower-level GSM module. The upper-level GSM then transmits the received SMS to the computer via USB. After receiving the SMS, the monitoring computer executes the corresponding operations through the monitoring software and data management program, ultimately realizing remote data collection and monitoring. [align=center] Figure 1: System Structure Diagram[/align] 3. System Implementation The MZ28 is a GSM dual-band wireless modem launched by ZTE Corporation, mainly providing wireless interfaces for voice transmission, SMS sending, and data services. It integrates a complete RF circuit and a GSM baseband processor, making it particularly suitable for the rapid development of wireless application products based on GSM wireless networks. Application products with a human-machine interface (HMI) can communicate with the MZ28 via a USB port. The short-range wireless transceiver chip nRF401 from the Norwegian company Nordic operates at 433 MHz in the internationally recognized Industrial, Scientific and Medical (ISM) band, requiring no license. It uses FSK modulation, has strong anti-interference capabilities, and is particularly suitable for industrial control applications [1,3]. The system hardware design involves connecting the computer to the upper-level GSM via a USB port and providing it with power. The hardware connection circuit between the lower-level GSM module, the main wireless transceiver module, and the main MCU is shown in Figure 2. In Figure 2, the main MCU serial port is connected to the main wireless transceiver module RF and the lower-level GSM (MZ28) via a multiplexer switch MSW. Since the internal operating voltage of the MZ28 is 2.8V, while the system power supply voltage is 4V, a germanium diode is connected to the RXD terminal of the MZ28 module, and two silicon diodes are connected to the CTS terminal (active low) for voltage reduction protection. The communication connection between the main wireless transceiver module and the main MCU is relatively simple; the data input and data output terminals of the module are directly connected to the serial port TXD and RXD terminals of the main MCU, respectively. [align=center] Figure 2: Connection between the lower-level GSM module, the main wireless transceiver module, and the MCU[/align] System Software Design The system software design includes the monitoring program and data management program of the monitoring computer, and the programs for the main MCU and the slave MCU. The system uses AT commands to control the GSM module. Some commonly used AT commands related to SMS can be found in GSM specifications GSM07.05 and GSM07.07[4]. The computer signal acquisition and data management module is developed using Visual Basic (VB6.0) language. It uses the MsComm control to communicate with the main GSM module through the USB port. It uses VB to start Excel and sends the acquired data directly to Excel. It makes full use of Excel's powerful data processing function to realize the display (including data values, data point curves and trend charts, etc.), analysis and storage of the acquired data[5,6]. The relevant statements for starting and operating Excel in VB are as follows: '*** First, declare a target global variable *** Global chrtobj As ChartObject '*** Open Excel *** Dim ExcelApp As Excel.Application Set ExcelApp = Excel.Application ExcelApp.Visible = True ExcelApp.Workbooks.Add '*** Write data to an Excel cell *** Range(Excel_Column).Value="ChNo"&OutCh(I) '*** Plot Excel data *** chrtobj.Chart.SeriesCollection.AddRange(Select_to_Draw) '*** Add trend lines *** chrtobj.Chart.SeriesCollection(1).Select chrtobj.Chart.SeriesCollection(1).Trendlines.Add_(Type:=xlPolynomial,Order:=4,_ Forward:=0,Backward:=0, DisplayEquation:=False,DisplayRSquared:=False).Select The upper-level GSM module sends SMS messages in PDU mode. For the specific definition of PDU format and other parameters, please refer to GSM specifications GSM03.40 and GSM03.38[7]. The corresponding VB program is as follows: MSComm1.Output = "AT + CMGF = 0" & Chr (13) 'Set the module SMS format to PDU mode Call Delay 'Delay MSComm1.Output = "AT + CNMI = 2,2,0,0,0 " & Chr (13) 'Send and display the SMS message as soon as it arrives Call Delay 'Delay MSComm1.Output = "AT + CMGS = " & Length & Chr (13) 'Send the SMS message, Length is the number of bytes sent Call Delay 'Delay, so that the GSM module has time to respond to the previous instruction MSComm1.Output = Sendstr & Chr (26) 'Send the PDU string, Sendstr is the PDU string variable Receiving SMS messages uses TEXT mode to decode the received SMS messages. TEXT mode is relatively simple. Here is an example: RX: + CMT: "13601702443", "00/ 05/18, 09:20:16 + 02”, “4E00004100420043” where “+ CMT” is a new SMS instruction, and + CMT means that the new SMS is sent directly to the terminal device; “13601702443” is the SMS source number; 00/05/18, 09:20:16 + 02 is the SMS arrival time; 4E00004100420043 is the SMS content (here it is “a ABC”). The main MCU module system uses Atmel's AT89C51 microcontroller as the CPU, and the program is written in assembly language [8]. The main functions include: system module initialization (local initialization, lower-level GSM module initialization, main wireless transceiver module initialization); jump control for different upper-level GSM module SMS instruction content; data acquisition reception and storage control; SMS sending and receiving control, etc. The main MCU software flow is shown in Figure 3. The principle of SMS sending and receiving using microcontroller assembly language is the same as described above, and the AT commands are identical. The system's master and slave wireless transceiver modules establish a one-to-many communication mechanism. To ensure reliable communication, a custom communication protocol needs to be defined for short-range wireless modules. The communication protocol designed in this paper is as follows: each slave wireless transceiver module is assigned an address code; data transmission uses short packet packaging. According to the datasheet, 00xFF and 00x00 are unlikely to be generated in noise. Therefore, data packets are packaged as follows: three header bytes (00xFF, 00x00, 00x00) are added before the data bytes, followed by the two bytes of data to be sent. Based on experience, the first byte of data is often lost during transmission; therefore, before sending data, an arbitrary byte is sent first, and then the data packet is sent. For reception, only the two bytes following the three bytes (00xFF, 00x00, 00x00) are accepted; simultaneously, even parity is used, and if an error occurs, the data packet is discarded, and the next data packet is received. The MCU module's program mainly receives control commands from the computer and acquires data, including A/D conversion, data preprocessing, and short-range wireless transmission of the acquired data. 4. Conclusion [align=center]Figure 3. Main MCU Software Flowchart[/align] Combining the GSM module and the short-range wireless module realizes a sensor data acquisition and low-volume wireless transmission function. It fully utilizes the advantages of the existing GSM network and the high data transmission rate and hot-swappable functionality of the USB bus, providing a reasonable and efficient solution for remote monitoring and low-volume data acquisition. The system is stable, low-cost, and exhibits no SMS loss or errors. Currently, the system can operate stably in a small area, and tests have proven its reliability. However, the system's real-time performance is weak, lagging behind by one SMS sending and receiving cycle. With the development of wireless communication technology, the system's functions will be improved, and it will be widely used in more fields such as medical clinical testing and monitoring. The author's innovation lies in combining a GSM module with a short-range wireless module, fully leveraging the advantages of the existing GSM network and the high data transfer rate and hot-swappable functionality of the USB bus, while utilizing Excel's powerful data processing capabilities to provide a reasonable and efficient solution for remote monitoring and low-flow sensor data acquisition. References [1] nRF401 Datasheet, Nordic Corp. Ltd. [2] USB130 Datasheet, Xuntong Electronics Co., Ltd. [3] Li Jinfeng, Cao Shun, Wei Lifeng. Application of wireless transceiver module nRF401 in mines [J]. Microcomputer Information (Embedded and SOC), 2006, Vol.22,1-2: 241-243,16 [4] Digital Cellular Telecommunications System (Phase 2+); Use of Data Terminal Equipment2Data Circuit Terminating; Equipment (DTE2DCE) Interface for Short Message Service (SMS) and Cell Broadcast Service (CBS). GSM 07. 05 version 5.5.0 1998201 [5] Wang Hongru. Excel VBA Programming [M]. Beijing: China Railway Publishing House, 2004 [6] Chen Xuedong, Chang Dan, et al. Visual Basic 6.0 Programming Tutorial [M]. Beijing: Tsinghua University Press, 2005 [7] Digital Cellular Telecommunications System (Phase2+); Technical Realization of the Short Message Service (SMS); Point-to-Point (PP). GSM 03.40 version 6.0.0 1998203 [8] Sun Hanfang, Xu Aiqing. MCS-51, 96 series single-chip microcomputer principles and applications [M]. Beijing: Beijing University of Aeronautics and Astronautics Press, 1988