**1. Introduction**
With the rapid growth of Internet of Things (IoT) technology, one of the key applications is the ability to transmit data collected by various sensor nodes to users' mobile devices or PCs via the internet. To fulfill this need, it is essential to develop a system that can function as both a coordinator in a wireless sensor network and a gateway for remote GPRS communication and network connectivity. This design aims to provide a reliable and efficient solution for real-time data transmission and remote control in IoT environments.
To achieve this goal, the system employs the STM32F417 microcontroller as the central processing unit. The on-chip μC/OS-II real-time operating system manages device operations, while the uIP protocol stack handles TCP/IP communication. The main device is equipped with a keyboard and display interface, allowing local configuration and settings. Additionally, it supports remote configuration through a PC, enhancing user flexibility and convenience. The GPRS module, connected via a serial port, enables long-distance communication, while the wireless coordinator transmits sensor data to the main device. It also receives commands from the master unit and forwards them to the sensors using the ZigBee protocol, ensuring seamless interaction within the network.
**2. System Hardware Design**
The embedded gateway system consists of several key components: the embedded main device, a GPRS module, a wireless coordinator, and a router. A block diagram of the system is shown in Figure 1, illustrating the overall architecture and data flow between different modules.

**Figure 1: Embedded Gateway System Block Diagram**
The embedded main device connects to the router through a network port, enabling local network access. It communicates with the GPRS module via a serial port, using AT commands to manage network connections, send SMS messages, and control data transmission. The same serial port is used to send commands to the wireless coordinator, which in turn controls the wireless sensor network using the ZigBee protocol.
**2.1. Embedded Main Device Hardware Design**
The hardware platform of the embedded main device is built around the STM32F417 microcontroller. It includes peripheral circuits such as a liquid crystal display (LCD), network interface, keyboard input, and serial port drivers. A block diagram of the hardware is shown in Figure 2.

**Figure 2: Embedded Main Device Hardware Circuit Block Diagram**
This design utilizes a serial LCD, which simplifies the driving circuitry by relying on serial commands for control. The display content and GUI interface are stored in the LCD’s internal flash memory, making it easy to update and customize based on application requirements. The keyboard provides local user interaction, allowing users to configure the device directly.
The STM32F417 includes an integrated MAC module, so a PHY chip is added to support Ethernet communication. The network driver interacts with the PHY chip, while the uIP protocol stack manages TCP/IP communication. The GPRS module is controlled via the serial port using AT commands, enabling the system to connect to cellular networks, send data, and handle message exchanges. Similarly, the wireless coordinator is managed through the serial port using a custom protocol, ensuring compatibility and efficient command execution across the entire system.
Three Phase High Frequency Rack UPS
Three Phase High Frequency Rack-Mounted UPS,Three Phase High Frequency Rack-Mounted Online UPS
Shenzhen Unitronic Power System Co., Ltd , https://www.unitronicpower.com