In recent years, the rapid advancement of communication and network technologies, especially in wireless communication, has significantly enhanced the automation of power systems. Following the emergence of the GSM network, engineers quickly integrated GSM modules into various instruments such as multi-function energy meters, fault recorders, meter reading systems, and power load monitoring devices, enabling remote communication capabilities for these tools.
GPRS, or General Packet Radio Service, is a data transmission service built upon the existing GSM infrastructure. It supports the TCP/IP protocol and allows direct communication with packet-switched networks like the Internet. The GPRS wireless transmission system is widely used across various applications, particularly for medium to low traffic, low-rate data transmissions, including bursty small data packets.
The GPRS wireless communication module designed in this paper incorporates the TCP/IP protocol and uses an industrial-grade GPRS module. It is ideal for scenarios where a single-chip data acquisition and transmission system lacks a built-in TCP/IP stack but relies on serial communication.
### 1. GPRS Communication Principle and Application Characteristics
#### 1.1 Introduction to GPRS
GPRS stands for General Packet Radio Service, a technology that bridges the gap between 2G and 3G networks, often referred to as 2.5G. It shares the same frequency band, bandwidth, burst structure, wireless modulation standards, frequency hopping rules, and TDMA frame structure as GSM. As a result, when implementing a GPRS system on top of a GSM network, most hardware components remain unchanged, requiring only software upgrades. With GPRS, call setup times are significantly reduced, offering near "always-on" connectivity. Additionally, billing is based on data usage rather than connection time, making it more cost-effective for users.
#### 1.2 Basic Working Principle
GPRS introduces two new network nodes on the original circuit-switched (CSD) based GSM network: the GPRS Service Support Node (SGSN) and the Gateway Support Node (GGSN). The SGSN operates at the same level as the MSC, tracking the location of a mobile station (MS), managing security functions, and accessing the base station system via frame relay. The GGSN facilitates interworking with external packet-switched networks and connects to the SGSN through an IP-based GPRS backbone. Figure 1 illustrates the block diagram of the GPRS and Internet connection.
The GPRS terminal receives data from the client system through an interface. The processed GPRS packet data is sent to the GSM base station. After encapsulation by the SGSN, it communicates with the GGSN via the GPRS backbone network. The GGSN processes the data and forwards it to the destination network, such as the Internet or X.25 network.
If the packet data is destined for another GPRS terminal, it is transmitted through the GPRS backbone network to the SGSN and then delivered to the GPRS terminal via the BSS.
### 2. Implementation of Embedded GPRS Communication System
#### 2.1 GPRS Module Hardware Design
The embedded GPRS wireless communication module consists of a single-chip microcontroller with TCP/IP functionality (MSC1210Y5), a GPRS module, a SIM card holder, external interfaces, and extended data memory. Figure 2 shows the hardware block diagram of the system.
The MSC1210 controls the GPRS module for data transmission and reception, communicating with an external controller (e.g., a data acquisition terminal) via a standard RS232 serial port. Software is used to handle interrupts and manage data forwarding.
##### 2.1.1 MCU Module
The microcontroller is based on the latest 8051 core from Texas Instruments, the 80512Y5. It offers strong data processing capabilities, with a clock speed of 33 MHz, equivalent to a standard 8051 running at 99 MHz. It includes 32 KB Flash program memory, 256 B internal RAM, 1024 B on-chip SRAM, 2 KB boot ROM, and supports in-system programming. The dual data pointers DPTR0 and DPTR1 enhance the speed of data block transfers.
The main implementation steps are:
1. Initialize the GPRS module using AT commands, attach to the GPRS network, obtain a dynamic IP address, and establish a connection.
2. Connect the external controller (e.g., a data acquisition terminal) via serial port 0 using the MAX232 standard.
3. Reuse P1.2 and P1.3 to connect serial port 1 to the GPRS module's TXD0 and RXD0, while the remaining P1 ports are connected to the other RS232 ports of the GPRS module via software configuration.
##### 2.1.2 Extended Data Memory Section
The Flash memory of the MSC1210 can function as either program or data memory. Due to the presence of a real-time operating system and network protocols, all Flash is used for program storage. An 74HC573 address latch and a 6264 external data memory chip are used to expand the data storage capacity, providing 8 KB of space sufficient for normal operation.
Figure 3 shows the hardware connection between the MSC1210 and the data memory.
##### 2.1.3 GPRS Wireless Data Transmission Module
As the wireless transceiver for the terminal, the GPRS module processes packet data received from the IP network or the microcontroller and forwards it accordingly.
The GPRS module uses the MC35 module from Siemens. It includes an RF antenna, internal Flash, SRAM, a GSM baseband processor, a power supply, and a 40-pin ZIF socket. The baseband processor acts as a protocol processor, handling AT commands sent over the serial port. The RF antenna manages signal modulation and demodulation, converting between external RF signals and internal baseband data. The power supply provides necessary voltage for the RF section. The peripheral circuit for the MC35 is shown in Figure 4.
The AS2815 converts the input voltage to 3.3V. The startup circuit includes a transistor and a power-on reset circuit. After powering up, a low-level signal of at least 100 ms must be applied to pin 15 for proper operation. Once started, the signal on pin 15 should remain high. The CCIN pin detects whether a SIM card is inserted. When the SIM card is present, the system enters normal operation. The SYNC pin has two modes: one indicating transmit state, and the other showing the module’s status. In this design, the latter mode is used. An LED indicates the module’s state: off means it is powered down or sleeping; blinking every 600 ms indicates no SIM card or network login; and a 75 ms on/3 s off cycle indicates successful network login.
#### 2.2 MCU Communication Program Design
All software is written in C and compiled in the Keil environment. Keil is a development tool specifically for 8051-compatible microcontrollers, supporting in-system debugging. The C51 compiler integrates well with the RTX multitasking OS. To use the RTX features, the header file `#include rtx51.h` must be added. Code is debugged and downloaded using the TI Downloader.
Most GPRS modules do not support TCP/IP natively, so the MCU must implement the protocol. This design embeds TCP/IP and PPP protocols to enable seamless GPRS communication.
##### 2.2.1 Embedding of TCP/IP Protocol
This design leverages the IP and PPP protocols within the RTX51 real-time OS to improve system scalability and product continuity. The TCP/IP protocol is hierarchical, with each layer adding its own header information before passing it to the next layer. Upon receiving GPRS data, the headers are stripped, and the remaining data is treated as the payload.
To reduce system overhead, this design uses the IP+UDP protocol. UDP packets from the host are transmitted via the GPRS channel and parsed by the GPRS module, which then sends them to the user terminal at a set baud rate.
##### 2.2.2 Data Processing
Data packets are transmitted using IP-based packets, meaning all data is encapsulated in IP packets. However, transmitting IP packets in plaintext is not secure, so the PPP protocol is typically used. The module sends PPP packets to the gateway, and responses from the Internet are returned to the GPRS module based on the IP address, enabling transparent data transmission.
Since the GSM network does not provide static IP addresses, other devices cannot initiate connections. Therefore, the monitoring center must have a fixed IP address, allowing the terminal to locate it after logging into the network. This can be achieved by applying for the appropriate service.
After logging into the GSM network, the GPRS module automatically connects to the data center, reports its IP address, and maintains the link. If a failure occurs, the module re-establishes the connection, enabling bidirectional communication via UDP/IP, ensuring reliable and transparent data transmission.
### 3. Design of the Upper Computer Monitoring Center
The monitoring center’s role is to receive and store GPRS data. It is developed using Microsoft Visual C++, a powerful and flexible language with strong support for networking and databases.
Thanks to GPRS, the monitoring center can directly access the Internet without needing a GPRS module. It listens to the network through the central software, receives UDP packets from the GPRS module, and sends control information to enable IP communication with the GPRS terminal. Received data is stored in an Access database for future reference. The VC interface accesses the database using ADODB.
The Socket interface, part of the TCP/IP API, enables developers to create applications for network communication. The MFC class CAsyncSocket simplifies Socket programming. This design uses a datagram Socket, corresponding to a UDP service, which is connectionless.
CAsyncSocket handles events via the DoCallBack function, triggering OnReceive, OnSend, OnAccept, and OnConnect functions based on FD_READ, FD_WRITE, FD_ACCEPT, and FD_CONNECT events, completing the data communication process.
### 4. Conclusion
This paper implements GPRS data transmission using an embedded TCP/IP protocol on a high-speed 8-bit microcontroller. It offers advantages such as minimal peripheral circuits, simple design, and low cost. Through a standard RS232 serial port and external controller, communication is achieved using a pre-defined protocol, ensuring versatility. The system software is written in C, making it portable across different controllers with minor modifications.
Despite its benefits, the GPRS-based system has some limitations, such as network instability, packet loss, and the complexity of implementing the IP protocol. The host computer’s Internet-based solution also poses security risks. However, with careful design, these issues can be addressed, and the GPRS-based system continues to offer significant advantages.
Coal Gas Generator,190 Series Coal Gas Engine,1600Kw Coal Gas Engine,Coal Gas Engine And Gensets
Jinan Guohua Green Power Equipment Co.,Ltd. , https://www.guohuagenerator.com