Environmental conditions play an increasingly important role in industrial and agricultural production, national life and other fields. How to effectively monitor them is a meaningful topic. Using wired networks to monitor environmental conditions at close range is a traditional method, which has the disadvantages of complex and difficult wiring and limited communication distance. With the development of wireless communication and network technology, the combination of detection technology automation and communication technology has made remote distributed real-time monitoring possible.
The remote distributed environmental condition monitoring system integrating Ad hoc network, GPRS/GSM and PSTN can give full play to the advantages of each network and transmit the data monitored by the wireless sensor network WSN (Wireless Sensor Network) to the remote terminal, with basically no cost and distance restrictions.
1 System overall structure
The composition principle of the multi-network integrated environmental remote real-time monitoring system is shown in Figure 1. It mainly consists of three parts: Ad hoc network, gateway and remote terminal. Ad hoc WSN is a distributed monitoring system that realizes data collection of environmental conditions; the gateway completes the seamless connection between the Ad hoc network and GPRS/GSM and PSTN, and sends the WSN data to the remote end; the remote terminal consists of a mobile phone and an ordinary computer, which is used to monitor the on-site conditions.
Ad hoc network is a multi-hop temporary autonomous system composed of a group of mobile terminals with wireless transceivers. It has the characteristics of being decentralized, self-organized, multi-hop routing and dynamic topology, and is suitable for building large-scale distributed WSNs. When wireless sensor monitoring nodes communicate with each other, the MAC layer uses the IEEE 802.15.4 standard. This standard defines a low-speed wireless connection technology with extremely low complexity, cost and power consumption for use by inexpensive fixed, portable or mobile devices. When data is transmitted between nodes, the network layer uses the AODVjr routing algorithm. The AODVjr algorithm is an improvement on the AODV algorithm. Considering the energy saving, cost and application convenience of the IEEE 802.15.4 standard, it simplifies some features of AODV, but still maintains the original functions of AODV [1]. The advantage of using the AODVjr algorithm is that the wireless monitoring node can always find the best path every time it communicates with the gateway; when individual nodes in the network are in sleep or stop working, it still does not affect the communication between other nodes and the gateway.
General Packet Radio Service (GPRS) is a new packet data bearer service developed on the existing GSM system, which is particularly suitable for intermittent, sudden or frequent, small amount of data transmission. Public Switched Telephone Network (PSTN) is a circuit switching service based on standard telephone lines, used as a method of connecting remote endpoints, and its characteristics are wide distribution and low communication costs.
2 Hardware Design
The designed hardware system mainly includes two parts: wireless monitoring nodes for collecting environmental conditions and gateways for multi-network integration.
2.1 Wireless Monitoring Node
The wireless monitoring node adopts the "MCU+RF+Sensor" model, as shown in Figure 2. The single-chip microcomputer uses the STC12C5A60S2 produced by Hongjing Technology Co., Ltd. It has two serial ports, 60 KB of Flash memory, 1,280 B of data memory, 1 KB of EEPROM, and 8-channel 10-bit high-speed A/D converters [2]. The wireless module uses the IP-Link 1221-2034 of Helicomm Co., Ltd. This module complies with the IEEE 802.15.4 standard and operates at a frequency of 2.4 GHz, which is a license-free ISM band. The STC12C5A60S2 and IP-Link1221-2034 communicate through the serial port. The serial port of the former is 5 V TTL level, while the serial port of the latter is 3.3 V TTL level. When the two are connected, level conversion is required.
The sensors mainly include smoke sensor MQ-2, gas sensor MQ-5, CO sensor MQ-9, Hamamatsu photoresistor P1201-04, Osong single bus digital temperature and humidity sensor DHT11, Dallas single bus digital temperature sensor DS18B20. The analog signals output by the illumination, smoke, gas and CO sensors are directly sent to the STC12C5A60S2 microcontroller for conversion after the signal conditioning circuit.
The light-emitting diode is mainly used to indicate the working status of the wireless monitoring node; the 1602 LCD is used to display the monitoring results. When the system is working normally, the LCD can be turned off to save energy; the independent button is mainly used to set the upper and lower alarm limits of the environmental conditions; when the environmental conditions exceed the alarm threshold, the buzzer will sound an alarm.
2.2 Gateway
The structure of the gateway is shown in Figure 3. It mainly realizes the connection between the Ad hoc network and GPRS/GSM and PSTN, and reports the data collected by WSN to the remote control center or mobile phone at regular intervals. If the on-site environmental indicators exceed the standard, they can also be reported immediately. At the same time, the remote control center or mobile phone can actively query the status of WSN.
The gateway is mainly composed of two STC12C5A60S2 microcontrollers as controllers, which are connected through the SPI bus in master-slave mode. STC12C5A60S2_1 is connected to the Ad hoc wireless module and transmits the environmental data collected by the WSN to STC12C5A60S2_2 through the SPI bus. The latter is connected to the GPRS/GSM module and the embedded Modem (Embedded Modem, eModem) through the serial port to access the GPRS/GSM network, Internet and PSTN.
2.2.1 GPRS/GSM network interface
STC12C5A60S2_2 connects to GPRS/GSM network and Internet through GPRS module. The GPRS module mainly adopts BenQ's M23G design, which integrates PPP and TCP/IP protocol stacks; supports network types GPRS Class 8 and GPRS Class B; supports three frequency bands: EGSM 900MHz, DCS1800MHz and PCS1900 MHz, and has functions such as short message service, voice call, data fax, etc. [3]. The designed GPRS module works stably and reliably, with high cost performance.
The operating voltage of M23G is 3.3~4.5 V. When designing the power supply, a voltage of 3.8 V is used. The maximum instantaneous current of the module during operation can reach 2 A. Considering the need for large current, the LM2941 switch-type adjustable high-performance microwave circuit dedicated voltage regulator chip is used to construct the GPRS power supply.
STC12C5A60S2_2 and M23G module communicate in serial mode, with a baud rate of 9 600 b/s. The DSR pin of M23G is connected to the P2.4 port of the microcontroller. When DSR is high, it means the module is in data mode, and when it is low, it means it is in command mode. The DTR pin of M23G is connected to the P1.1 port of the microcontroller, and the data state and command state of M23G can be switched by controlling the high and low time of this pin level.
2.2.2 PSTN Network Interface
STC12C5A60S2_2 dials up via eModem and connects to a remote computer via the PSTN network. Tianshi Technology's serial bus eModem is 5V TTL level and can directly communicate with the microcontroller in serial. The eModem has a transmission rate of 14.4 kb/s to 56 kb/s, supports V.32bis, V.34 and V.90 standards, supports standard AT command set dialing/auto answering functions, has most of the technical parameters and functions of ordinary modems, and can be easily embedded in microcontroller designs [4]. Because the amount of data transmitted is not large, the flow control function of the eModem can be ignored. STC12C5A60S2_2 can control the eModem to reset via the P1.4 pin.
3 Software Design
The single chip microcomputers used in wireless monitoring nodes and gateways are STC12C5A60S2, and their firmware is written in C51 language and compiled in Keil uVision3. The software of the monitoring center is designed in LabVIEW, and the server webpage is written in ASP language.
3.1 Ad hoc Network
In addition to collecting sensor data and conducting human-computer interaction, wireless nodes in Ad hoc networks also need to find routes and forward data for other nodes. Maintaining the network is a very complex task, and the traditional single-threaded structure cannot meet the requirements well. Therefore, from the perspective of convenient program development and maintenance, the embedded real-time multi-tasking operating system Small RTOS51 is transplanted to the STC12C5A60S2 microcontroller in the wireless node.
Small RTOS51 has the characteristics of open source code, portability, curability, preemptiveness, interrupt management and small RAM requirement [5]. As shown in Figure 4, the AODVjr protocol stack and its upper layer of the Ad hoc network run on Small RTOS51. The network layer uses the AODVjr routing algorithm, which may need to handle tasks such as finding routes, maintaining routes, and sending and receiving data at the same time. Small RTOS51 can handle the above tasks in real time and provide a multi-tasking interface for the application layer program.
3.2 GPRS/GSM Network
The microcontroller mainly controls the GPRS module through AT commands to achieve GPRS network connection, PDP activation, Ethernet access and data transmission. The commonly used ATs of the GPRS module are shown in Table 1.
3.3 PSTN Network
The eModem connected to the gateway works in the calling mode with automatic answering. The microcontroller mainly uses the AT commands in Table 2 to set and control the communication of the eModem. There are three main steps in communication: (1) Initialization: setting the result code format, echoing commands and answering methods; (2) Calling or answering: entering the actual data/command communication process; (3) Disconnection: hanging up.
3.4 Computer software
The server uses Microsoft's IIS (Internet Information Service) technology and ASP language to write dynamic web page codes. The data sent by the gateway is received by the server and saved in the background ACCESS database. The operator can log in to the server to query the status of the remote WSN.
The remote monitoring center is connected to the PSTN network through an ordinary modem, and its computer monitoring software is implemented using LabVIEW, a virtual instrument development platform launched by National Instruments (NI). It can provide users with a concise, intuitive, and easy-to-use graphical programming method, which can simplify cumbersome and complex language programming into selecting functions in a menu prompt manner and connect various functions with lines, which is very time-saving and simple.
LabVIEW can also be used to easily draw graphs and visually display the temperature and humidity data received by the modem. Figure 5 is a software interface designed using LabVIEW.
The remote distributed system integrating Ad hoc network, GPRS/GSM and PSTN can give full play to the characteristics of various wired and wireless, short-distance and long-distance networks, realize complementary advantages, and monitor the environmental conditions in real time. The system has low hardware cost, low demand for power supply and communication network, low communication cost, wide applicability, friendly human-computer interaction interface, and simple management and operation. By appropriately replacing sensors, the system can be widely promoted in practical applications such as industrial and agricultural monitoring, environmental testing, security, smart home appliances, and medicine, generating good economic and social benefits.
Previous article:Design of universal motor control device based on ATmegal6 single chip microcomputer
Next article:Home intelligent waterproof system based on water sensor detection and MCU
Recommended ReadingLatest update time:2024-11-16 16:33
- Popular Resources
- Popular amplifiers
- MATLAB and FPGA implementation of wireless communication
- Modern Electronic Technology Training Course (Edited by Yao Youfeng)
- Operational Amplifier Practical Reference Handbook (Edited by Liu Changsheng, Zhao Mingying, Liu Xu, etc.)
- A Complete Illustrated Guide to Operational Amplifier Applications (Written by Wang Zhenhong)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Voltage Follower
- Anlu SparkRoad Development Board Review (1) Development Board Hardware Overview
- C Data Structures
- 【ufun learning】isp download
- What is wireless charging? What are the benefits of a wireless charging setup?
- PCB panelization skills
- A masterpiece by a senior Python programmer, helping you quickly master efficient Python programming
- MicroPython Hands-on (08) - Learn Color Recognition with MicroPython from Scratch
- Optical modules and 5G bearer networks
- Analysis of the switch input circuit composed of four diodes