Design of a remote real-time monitoring system for environmental conditions based on multi-network integration

Publisher:自由思想Latest update time:2010-09-18 Source: 电子技术应用 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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.

Reference address:Design of a remote real-time monitoring system for environmental conditions based on multi-network integration

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

STC12C5406AD 1602 LCD display + LM35DZ thermometer
The frequency of the STC12C5406AD crystal oscillator is 12MHz.   This program has been debugged:  Functional description: STC12C5406AD+74HC164+1602 LCD display+LM35DZ+DS18B20 thermometer design.  Measuring voltage: Using 8-bit AD measurement, the temperature values ​​read by LM35DZ and DS18B20 are very accurate.  #i
[Microcontroller]
STC12C5406AD 1602 LCD display + LM35DZ thermometer
How to choose AD/DA devices
When engineers are designing circuits, facing a wide variety of AD/DA chips , how do they choose the device they need? This requires comprehensive design factors, system technical indicators, cost, power consumption, installation, etc. The most important basis is speed and accuracy. Accuracy is related to the si
[Analog Electronics]
Audio Panpot Circuit of Dual Channel Low Distortion Difference Amplifier AD82731
 Figure 1 shows an audio panpot circuit that responds to the setting of a potentiometer by continuously changing the position of a mono audio signal between the left and right stereo channels. Low cost and low distortion are important considerations for audio circuits. The AD82731 dual-channel, low-distortion differen
[Analog Electronics]
Audio Panpot Circuit of Dual Channel Low Distortion Difference Amplifier AD82731
STM32 AD DMA mode
Directly on the code: //Variable definition__IO uint16_t ADCConvertedValue ; //ADC peripheral data register #define ADC1_DR_Address ((uint32_t)0x4001244C) //ADC_DR (ADC rule data register), offset = 0x4c ADC1(0x40012400-0x400127ff) //ADC1_GPIO configuration void ADC1_GPIO_Configuration(void) {   GPIO_InitTypeDef G
[Microcontroller]
Introduction to C8051F005 and DA/AD Program
Introduction: This article mainly introduces the DA driver (C language) of C8051F005. DA driver for C8051F005 (C language) //----------------------------------------------------------------------------- // Includes //----------------------------------------------------------------------------- #include // SFR declar
[Microcontroller]
c8051f330 series microcontroller AD conversion
c8051f330 series microcontroller AD conversion. Author lml198694 Date 2008-7-21 10:53:00 2 recommend According to the C8051F330 microcontroller that I have recently learned, I wrote a program about AD conversion. However, when debugging, I always found that its accuracy is not as high as I imagined. I don’
[Microcontroller]
dsPIC30F6015 controls AD7715 program source code for personal testing and use
This is the program I wrote for controlling AD7715 with dsPIC30F6015. The source program of the microcontroller is as follows: #include p30f6015.h _FOSC(CSW_FSCM_OFF & XT_PLL4); _FWDT(WDT_OFF); #define uchar unsigned char #define uint unsigned int   #define CS_A LATCbits.LATC13 //RC13 output #define DRDY PORTDbits.
[Microcontroller]
High-throughput, high-precision ADC-AD974 that simplifies circuit design
    Abstract: AD974 is the first 200kSPS, 4-channel, 16-bit data acquisition system produced by American Analog Devices. It has the characteristics of high throughput, low power consumption, high precision, etc. In addition, the device also integrates peripheral devices and adopts serial communication method, which c
[Analog Electronics]
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号