Share this

Design of a GPRS-based urban environmental data acquisition device

2026-04-06 04:20:34 · · #1

Abstract : Based on the needs of urban environmental data collection, this paper describes the design of an urban environmental data acquisition device using the MSP430F1232 microcontroller as the core, integrating a GPRS module and a data acquisition module. The design details both the hardware and software solutions. This system can record environmental data such as temperature, humidity, and noise intensity at urban collection points in real time, and can transmit the collected information to the server of the urban environmental monitoring center via a GPRS wireless network in real time, enabling researchers to analyze and study the collected urban environmental information.

Keywords : microcontroller; GPRS module; DS18B20; LTC3105

introduction

With the rapid development of urbanization, the collection and analysis of urban environmental data has become increasingly important. How to make the collection and analysis of environmental data simpler and easier is a primary concern for urban environmental monitoring and research institutions. The collection of urban environmental data is fundamental for these institutions to analyze and study the urban environment. However, in the past, the collection of urban environmental data largely relied on manual labor, resulting in significant discrepancies between the collected and recorded data and the actual data. This greatly impacted the application of the data and the analysis of the urban environment. Urban environmental data acquisition equipment can collect urban environmental data in real time, conveniently, and quickly, and can operate around the clock, reliably recording urban environmental data and thus avoiding human error.

1. Functions of urban environmental data acquisition equipment

To ensure the accurate and effective collection and recording of environmental data at the installation sites, enabling environmental research institutions to analyze the collected data, understand the patterns of urban environmental change, and better serve human life and production, the main functions of the environmental data acquisition equipment are as follows:

1) Urban environmental data information collection function

This device can accurately collect real-time urban environmental data (such as temperature, humidity, noise intensity, and suspended particulate concentration) at the installation location.

2) Data storage function

This device can store and record the collected urban environmental data in chronological order, so that urban environmental analysts can verify and confirm the collected data.

3) Data transmission function

The device can transmit collected urban environmental data to the server of the urban environmental monitoring center via a GPRS wireless network, allowing relevant personnel to analyze the data. Simultaneously, the device can also receive setup commands from the urban environmental monitoring center via its GPRS module for remote data configuration.

2 System Hardware Design

The system uses the high-performance, low-power MSP430F1232 microcontroller as its core controller, integrating a GPRS module, a data acquisition module, a data storage module, a keyboard, and a power management module. The microcontroller receives real-time data from the data acquisition module, analyzes and stores the acquired data, and can transmit the acquired data to the city environmental monitoring center's server via the GPRS wireless network. The data acquisition module collects environmental information from the site and transmits it to the microcontroller. The GPRS module handles data communication between the device and the city environmental monitoring center. Through the GPRS module, the device can send real-time data to the city environmental monitoring center and receive corresponding setting commands from the center. Additionally, the device can set its operating status (e.g., data acquisition interval, data transmission interval) via the keyboard. To avoid frequent battery replacements, the terminal device uses a solar cell to provide the necessary power. The system's block diagram is shown in Figure 1.

Figure 1 System structure block diagram

Fig.1 The block diagram of the system

2.1 Microcontroller Unit

The MCU uses Texas Instruments' (TI) MSP430F1232 microcontroller, which is an ultra-low power microcontroller with a 16-bit architecture, a 16-bit CPU integrated register and constant generator, achieving maximum code efficiency. It includes a built-in 16-bit timer, a fast 12-bit A/D converter, a general-purpose serial synchronous asynchronous communication interface and 22 I/O ports. Some of its main features are listed below: low power supply voltage input range: DC 1.8~3.6V; ultra-low power consumption: 2.5uA @ 4kHz, 2.2V; five power saving modes; wake-up time less than 6us; 12-bit 200Ksps A/D converter with built-in sample and hold; one serial communication interface that can be used for asynchronous or synchronous communication modes; two 8-bit parallel ports and one 6-bit parallel port; 8KB FLASH ROM and 256 RAM on-chip; one general-purpose 16-bit timer and an on-chip temperature sensor [1] . The microcontroller receives various data from the data acquisition module through the data cable interface, analyzes and stores the data, and then connects to the GPRS module through serial port 0 to complete the sending and receiving of data, realizing bidirectional communication with the urban environmental monitoring center.

2.2 GPRS Module

2.2.1 Overview of GPRS

GPRS (General Packet Radio Service) is a wireless packet switching technology based on the GSM (Global System for Mobile Communications) system, providing end-to-end, wide-area wireless IP connection; it is one of the contents of the GSM Phase 2.1 specification, and can provide a higher data rate than the existing GSM network of 9.6 kbit/s. GPRS adopts the same frequency band, bandwidth, burst structure, wireless modulation standard, frequency modulation rules and the same TDMA frame structure as GSM. As a transition technology from the second-generation mobile communication technology GSM to the third-generation mobile communication (3G), GPRS makes full use of the equipment of the existing mobile communication network and does not need to change the wireless network planning and its topology, thus saving a large amount of mobile network construction costs. It supports IP protocol and X.25 protocol, providing a connection between mobile users and data networks, and providing mobile users with high-speed wireless IP and X.25 packet data access services. Therefore, when building a GPRS system on the basis of the GSM system, only some hardware equipment and software upgrades are needed [2] .

GPRS data transmission has the following characteristics: (1) It adopts a packet switching communication method. In the packet switching communication method, data is divided into data packets of a certain length. Each data packet has a header (the address mark in the header indicates where the packet is sent). There is no need to pre-allocate the channel and establish a connection before data transmission. Instead, when each data packet arrives, an available channel resource is temporarily found according to the information in the data packet header (such as the destination address) to send the data packet out. In this transmission method, there is no fixed occupation relationship between the data sender and receiver and the channel. The channel resource can be regarded as shared by all users, so the channel resource can be used more rationally. (2) It is charged according to the data flow, not according to the online time. GPRS is charged according to the data flow transmitted by the user. That is, the user is always online and does not need to pay as long as no data is transmitted, thereby reducing the system's operation and service costs. (3) High transmission rate. GPRS can provide a data transmission rate of up to 115 kbit/s (the highest value can reach 171.2 kbit/s), which is more than ten times higher than the circuit-switched service speed (9.6 kbit/s) in the current GSM network, and can stably transmit large-capacity high-quality audio and video files. (4) Always online. Once a GPRS user successfully connects to the network, the user will always be connected to the network and online, regardless of whether data transmission is being performed. (5) GPRS network access speed is fast, providing seamless connection with existing data networks. (6) GPRS supports applications based on standard data communication protocols and can interconnect with IP networks and X.25 networks. It supports specific point-to-point and point-to-multipoint services to realize some special applications such as remote information processing. GPRS also allows short message service (SMS) to be transmitted through the GPRS wireless channel. (7) The design of GPRS enables it to support both intermittent burst data transmission and occasional large data transmission. It supports four different QoS levels. GPRS can resume data retransmission within 0.5 to 1 second.

2.2.2 Introduction to GPRS Module

The GPRS module uses Siemens' MC52i module, which is an important part of establishing communication between the urban environmental data acquisition equipment and the urban environmental monitoring center. Through the GPRS module, the data information collected by the data acquisition module can be sent to the server of the urban environmental monitoring center in real time; on the other hand, it can also receive setting commands from the urban environmental monitoring center to realize two-way communication between the data acquisition equipment and the monitoring center. The characteristics and technical parameters of the MC52i module are as follows: (1) Compliant with GSM phase 2/2+. (2) Controlled by standard AT commands. (3) The MC52i realizes data transmission in the form of AT commands, and each transmission will return a corresponding result status ("OK" or "ERROR"). (4) Embedded TCP/IP protocol, provided to users through the AT command interface, which can support transparent and non-transparent transmission of data services. Transparent transmission means that the encapsulation of data is automatically completed by the TCP/IP protocol. (5) Supports communication functions such as GSM voice, data, fax, short message and GPRS data transmission. (7) Small size, high cost performance, suitable for large-scale production.

2.2.3 Design of GPRS Module Interface Circuit

The MC52i module is connected to the MSP430F1232 via a serial port and signal control pins, as shown in Figure 2. Pins 26-30 of the MC52i are the power supply input terminals, with an input voltage range of 3.3V to 4.8V and a peak load current of 2A. The TXD0 and RXD0 pins of the MC52i module are the data receive and data output ports, respectively, and are connected to the microcontroller's serial port (UART0) pins TXD0 and RXD0. Pins 1-6 of the MC52i provide a standard interface for an external SIM card. CCGND and CCVCC provide the operating voltage for the SIM card; CCCLK provides the clock pulse signal for the SIM card; CCIO is the serial data input/output interface; CCRST is the SIM card reset signal; and the CCIN pin is mainly used to detect whether the SIM card is inserted into the SIM card slot. The interface functions are shown in Table 1. The IGT pin of the MC52i module is the power-on signal control terminal. When the input power supply voltage of the MC52i module reaches 4.0V, the microcontroller's P1.0 control of the peripheral circuit pulls this pin low and maintains it for more than 100ms before the MC52i module can power on and operate normally. To prevent current backflow into the MC52i module, the peripheral circuit uses a transistor with no pull-up resistor at the collector as the driving circuit.

Table 1 SIM Interface Functions

Tab. 1 Function of the SIM interface

Signal

Function

CCGND

To improve electromagnetic compatibility, a separate ground wire is used to connect to the SIM card.

CCCLK

Provide clock signal for SIM card

CCVCC

Provide power to the SIM card

CCIO

Serial data input/output port.

CCRST

SIM card reset signal

CCIN

Used by MC52i to check if the SIM card is in the card slot.

Figure 2 MC52i connection schematic diagram

Fig. 2 MC52i Connection diagram

The operating status of the MC52i can be monitored through the module's VDD pin. When the module is working, VDD outputs a high level, and when the module is off, VDD outputs a low level. The operating status of the MC52i module can be determined by monitoring the output level of VDD through the microcontroller's P1.2 pin.

The MC52i module and the microcontroller primarily communicate via serial port. The communication baud rate can be set according to actual needs, with options including 1200bit/s, 2400bit/s, 4800bit/s, 9600bit/s, 19200bit/s, 38400bit/s, 57600bit/s, and 115200bit/s. The microcontroller uses AT commands to control the MC52i module to attach to the GPRS network and establish a connection with the city environmental monitoring center server. Once the connection is established, the data acquisition terminal device can send collected urban environmental information to the city environmental monitoring center in real time and receive setting commands from the center.

2.3 Data Acquisition Module

The data acquisition module is the data acquisition unit of the data acquisition device, integrating a single-bus digital temperature sensor, a single-bus digital humidity sensor, a single-bus digital noise sensor, and a suspended particulate matter detection sensor. All sensors on the data acquisition module use a single-wire data transmission control method, and each sensor has its own ID number, allowing the microcontroller to easily identify the data type received. Due to space limitations, this design only introduces the working method of the temperature sensor and its connection with the microcontroller.

2.3.1 Temperature Sensor

The system uses the DS18B20 single-bus digital temperature sensor chip produced by DALLAS in the United States. It adopts a 3-pin TO-92 small-volume package. The temperature measurement range is -55~C to +125℃. It has 9 to 12-bit A/D conversion accuracy and the minimum temperature resolution can reach 0.0625℃. The measured urban ambient temperature is output serially in 16-bit two's complement mode. The working power supply of DS18B20 can be introduced from the remote end or parasitic power supply mode. Multiple DS18B20 can be connected in parallel to two or three lines. At this time, the CPU only needs to use one port line to realize communication with multiple DS18B20 sensors. This occupies less of the microprocessor port. Therefore, this temperature sensor can be widely used in multi-channel temperature detection and control [3] .

The temperature sensor in the DS18B20 can measure temperature in urban environments. When a temperature conversion command is received, the converted ambient temperature is stored in two's complement form in the 0th and 1st bytes of the high-speed temporary storage. The following example illustrates a 12-bit conversion: It uses 16-bit extended binary two's complement form, represented as 0.0625℃/LSB, where S is the sign bit. Table 2 shows the 16-bit data format obtained after temperature conversion. The first 5 bits of the high byte are the sign bit. If the measured temperature is greater than 0, these 5 bits are 0; in this case, multiplying the data by 0.0625 yields the actual temperature. If the temperature is less than 0, these 5 bits are 1; the measured value needs to be inverted, added to 1, and then multiplied by 0.0625 to obtain the actual temperature.

Table 2 Temperature Data Format

Tab.2 The temperature data format

For example, the digital output for +125℃ is 07D0H; the digital output for +25.0625℃ is 0191H; and the digital output for -55℃ is FC90H.

The interface circuit between the single-bus sensor and the microcontroller is shown in Figure 3. Single-bus sensors are typically powered by either internal parasitic power or external power. In terms of connection methods, they can be categorized as single-chip connection or multi-chip connection. The former forms a single-point measurement system, while the latter constitutes a multi-point measurement system. In this design, the single-bus sensor is connected to the microcontroller via external power supply, with VCC connected to a 4.0V power source. The advantages of external power supply include: stable power supply, strong anti-interference capability, and convenient operation. P2.2 of the microcontroller's P2 port is used as the data transmission line for connecting multiple external sensors to form a multi-channel urban environmental data acquisition system. The connection diagram between the sensor and the microcontroller is shown in Figure 3.

Figure 3. Connection diagram between sensor and microcontroller

Fig.3 The circuit of MCU and sensors

2.4 Power Module

The data acquisition equipment uses solar cells to provide the power required for operation, and employs a Linear Technology LTC3105 controller to convert the voltage supplied by the solar cells, ensuring a stable operating voltage for the entire system. A rechargeable battery is also included in the circuit design to store residual energy so that the system can operate normally in the absence of sunlight. The power module circuit diagram is shown in Figure 4.

The technical parameters of LTC3105 are as follows: operating voltage as low as 0.225V; the chip can be programmed to output the voltage required by the device; maximum output current 0.4A; simple peripheral circuit, requiring only a few external electronic components to provide a stable operating voltage for the device; high conversion efficiency; and overheat and overload protection functions.

Figure 4 Power module circuit diagram

Fig.4 The circuit of power module

3 System Software Design

To facilitate system maintenance and upgrades, the system software design adopts a modular program structure, mainly consisting of a main program, a data acquisition interrupt program, a data storage program, and a GPRS communication program.

3.1 Main Program Functions

The main program is responsible for initializing each working module of the device. After initialization is complete, the interrupt routine is enabled, and then the main program enters the interrupt waiting state, waiting for the interrupt to occur.

3.2 Data Acquisition Interruption Procedure

The microcontroller connects to each sensor via a single bus. When idle, the single bus is at a high level, and each sensor is in a state where it can both write and read data. Operations on the single-bus sensors mainly include two categories: reading data and writing data, appearing in the form of ROM operation commands or storage operation commands. The corresponding commands can be defined by the user, and in this device, they are defined as follows: [F0H] Identify all sensors on the bus; [33H] Read the serial number of a single sensor; [55H] Locate a specific sensor; [CCH] Skip ROM operation; [4EH] Write to memory; [BEH] Read from memory; [44H] Complete the conversion of acquired data.

The data acquisition interrupt procedure is implemented through a timer interrupt. When the timer reaches a predetermined value, an interrupt is generated, and the system enters the data acquisition procedure. Once in the data acquisition procedure, the system selects the sensors that need to collect data. The corresponding sensors respond to the microcontroller's requests. After the sensors complete data acquisition, the microcontroller reads the acquired data. After the data is read, the microcontroller performs appropriate conversions on the read data and stores the converted data in a specific format for transmission to the urban environmental monitoring center via GPRS. The flowchart of the data acquisition interrupt procedure is shown in Figure 5a.

Figure 5 Program Flowchart

Fig. 5 Program Flow Diagram

3.3 GPRS Data Transmission Program Design

The data acquisition device can transmit the collected real-time information to the server of the urban environmental monitoring center via a GPRS module, enabling the center to monitor urban environmental changes in real time. After collecting various data, the microcontroller analyzes and processes the data, encapsulating the information to be sent to the urban environmental monitoring center in a specific format and storing it in a data transmission buffer for later use during data transmission. This system uses a timer interrupt method to transmit data at 5-second intervals. When the timer overflows after 5 seconds, an interrupt is triggered, executing the data transmission interrupt program. The program reads the data stored in the transmission buffer and transmits it to the urban environmental monitoring center via the GPRS module. The data transmission program flowchart is shown in Figure 5b.

4. Conclusion

This urban environmental data acquisition device, designed using microcontroller, GPRS, and single-bus sensor technologies, features high accuracy and fast response. Both the hardware and software employ a modular design, and the device utilizes solar cells for power, facilitating system upgrades and maintenance. Actual operational testing has demonstrated accurate and reliable data acquisition and transmission, providing a novel data acquisition device for multi-point wireless remote urban environmental data collection. It avoids the significant errors inherent in traditional manual recording, and this system possesses considerable potential for widespread adoption and application.

References:

[1] Texas Instruments Incorporated. Msp430x1xx Family User's Guide, 2006.

[2] Siemens Cellular Engine. MC52i AT Command Set V01.200. Confidential/Released, 8, 2008.

[3] Sha Zhanyou. Principles and Applications of Intelligent Integrated Temperature Sensors [M]. Beijing: Machinery Industry Press, 2002: 125-150.

Read next

CATDOLL 130CM Sasha

Height: 130cm Weight: 27kg Shoulder Width: 31cm Bust/Waist/Hip: 64/60/72cm Oral Depth: 3-5cm Vaginal Depth: 3-15cm Anal...

Articles 2026-02-22