Today, I will dissect a DTU module for everyone. The wireless data terminal DTU module, fully known as Data Transfer Unit, is a type of IoT wireless data terminal specifically designed to convert serial data into IP data or to convert IP data into serial data, and transmit it via a wireless communication network. It utilizes public carrier networks to provide users with wireless long-distance data transmission capabilities.
Overview of the Core Functions of the DTU Module:
1. Data Transmission and Conversion: The DTU module can receive data sent from serial devices and convert it into IP data format for transmission via wireless communication networks. At the same time, it can also receive IP data from the network and convert it into a format recognizable by serial devices.
2. Wireless Communication: The DTU module integrates wireless communication capabilities, allowing it to connect to the carrier’s mobile network, enabling wireless data transmission. This allows serial devices to achieve remote communication and data transmission without wired connections.
3. Long Connection Maintenance: To maintain a stable connection with the data center, the DTU module uses a heartbeat packet mechanism. When there is no data communication for an extended period, it sends heartbeat packets to maintain the connection state and prevent disconnection. Additionally, the DTU module supports automatic reconnection and redialing after disconnection functionalities.
4. Parameter Configuration and Storage: The DTU module supports parameter configuration, including the data center IP address, port number, serial port baud rate, etc. These parameters can be set according to specific applications. The configured parameters will be permanently stored, allowing the DTU module to operate automatically according to the set parameters once powered on.
In terms of hardware, the DTU module uses a high-performance industrial-grade communication processor and industrial-grade wireless module, supported by an embedded real-time operating system. It provides RS232, RS485, and other serial communication interfaces (optional) that can directly connect to serial devices, achieving transparent data transmission functionality.
The shell design is quite clever, resembling riveting.
Plug-in 6-pin F2EDG 3.81MM pluggable terminal blocks, two sets of power, one ground, and a set of RS232 transceiver pins. The internal circuit PCBA is as follows:
According to the voltage on the shell DC: 9~40V, temperature: -35~75 degrees. Wide voltage power supply. Measured with a multimeter. The first-level DC-DC step-down first reduces to 5V, and then 5V is converted to 3.7V voltage.
The power chip is packaged in SOT-23-Thin-6, which first brings to mind the Ti TPS56320X. This IC is priced under 0.4 yuan. The TPS56320XDDCR model regulator is a simple and easy-to-use 2A and 3A synchronous buck converter with a 6-pin SOT-23 package, optimized to operate with as few external components as possible and achieve low standby current. This component can be applied in fields such as digital TV power supplies, HD Blu-ray Disc players, network home terminal devices, and digital set-top boxes.
Domestic brand JW5033S can be replaced, a current mode single-chip step-down voltage converter JW5033S has an input range of 3.7V-18V and can provide a continuous output current of 2A with two integrated N-channel MOSFETs. At light loads, the regulator operates at low frequency to maintain high efficiency and low output ripple. JW5033S ensures stability through short circuit protection, thermal protection, current limit protection, and input undervoltage lockout. JW5033S is available in 6-pin TSOT23-6 and SOT563 packages, providing a simple compact solution with external components.
However, according to the specifications:
Input Voltage Range: 4.5 V to 17 V • Output Voltage Range: 0.76 V to 7V
The input voltage range: 4.5 V to 17 V • Output voltage range: 0.76 V to 7 V. Does not meet the 9~40 wide voltage input.
Seeing the JW imprint, I thought of the domestic Jinhua brand, a company that has made achievements in the field of power management chips and signal chain chips. Its products are mainly divided into two categories, including power management chips such as AC-DC chips, DC-DC chips, linear power products, battery management chips, etc.; signal chain chips include detection chips, interface chips, converter chips, clock chips, and linear chips.
By searching the official website: JW5126, which meets the wide voltage design requirements. However, the output current is too small, only 200mA.
JW5126 is a single-chip buck switching regulator based on a hysteresis mode scheme. JW5126 operates within an input range of 4.5V~65V, using an integrated N-channel MOSFET and an integrated P-channel MOSFET, but the output current is too small, only 200mA of continuous output current.
The 5V to 3.7V power supply uses AMS1117 ADJ LDO chip, which is a three-terminal output low dropout linear regulator with an output current of up to 1A, with various versions of fixed output voltages of 1.2V, 1.8V, 2.5V, 3.3V, 5.0V, and adjustable output voltage, with a voltage drop of only 1.2V at 1A current. With its excellent performance and extreme cost-effectiveness, it is suitable for various electrical products. Current limiting function and overheating protection function.
There are fixed output voltages of 1.2V, 1.8V, 2.5V, 3.3V, 5.0V, and adjustable output versions. Temperature range: -40℃~+125℃.
2. Air780EX is an LTE Cat 1 wireless communication module designed based on the Yichip EC618 platform. It supports FDD-LTE/TDD-LTE 4G long-distance wireless transmission technology. Additionally, the module provides general interfaces such as USB/UART/I2C to meet various application demands in the IoT industry. It belongs to the small size 4G-Cat.1 series. This module supports all three major carriers in China, including China Mobile, Telecom, and Unicom, and is compatible with the classic 1618 package in the module industry, suitable for a variety of IoT terminals. The Air780 series modules feature high integration packaging, multiple pad pins, and support for various interfaces while providing excellent low power consumption performance, making them suitable for long-term connection standby scenarios. Among them, Air780EP and Air780EPV are two main modules in this series. Air780EP only supports 4G communication, while Air780EPV supports 4G communication as well as VoLTE call functionality, thus meeting the needs of different application scenarios. The Air780 series wireless communication modules from Hozone inject new vitality into the development of the IoT field with their outstanding performance, wide application scenarios, and strong technical support. Hozone is a high-tech enterprise specializing in providing IoT wireless communication solutions, products, and services, established in May 2014. Its core technical team has rich experience in embedded development in communication modules, focusing on IoT platforms and Luat secondary development platforms. Hozone has independently developed various wireless communication modules, including Luat 2G/4G series modules, which are widely used in scenarios such as wireless payment, vehicle tracking, industrial DTU, public intercom, and shared payment.
Air780EX module functional block diagram:
Core circuit design of Air780: Full reference circuit is in the attachment
As a Data Transfer Unit, the main functions of the Air780 DTU include data collection, transmission, remote control, and data storage. It can connect to various sensors and instruments, collecting field data such as temperature, humidity, pressure, flow, etc., and transmitting this data to cloud platforms or remote servers via wireless communication. At the same time, it can also receive control signals from cloud platforms or servers to remotely control and adjust field equipment.
In terms of configuration parameters, the Air780 DTU offers flexible options. It supports configuration using a local serial port or through a web server. Users can choose one of these methods according to actual needs, ensuring only one method is effective at a time.
The meanings of the four indicator lights: The POW light is always on. When using the built-in card, the NET light flashes twice quickly within 2 seconds; when using the external card, the NET light flashes once every 2 seconds. The LINK light is always on after communication is established and goes out after disconnection. The DATA light flashes during data transmission and reception.
TCP/UDP Transparent TransmissionTesting of TCP transparent transmission and UDP transparent transmission functionalities. The test steps are as follows. Use a browser to open the network testing tool provided by Hozone, link: http://netlab.luatos.com/ Click “Open TCP” in the upper right corner to obtain a TCP SERVER address and port.

Air780 DTU is a powerful and easy-to-configure wireless data transmission device that can meet the needs of various industries, such as industrial automation, smart buildings, and provides bidirectional half-duplex transparent transmission functionality between RS232, 485 serial ports and 4G wireless networks. It can choose TCP/UDP/MQTT and other protocol types for network data transmission, supporting flexible registration, heartbeat, and topic publish-subscribe settings, widely used in electricity, water conservancy, petrochemical, municipal, environmental protection, agriculture, and other IoT application scenarios for communication, collection, control, and other functions between network and serial devices.
The wireless data terminal DTU module plays an important role in the IoT communication industry, providing convenient and efficient wireless data transmission solutions for various serial devices.
The Lua software design architecture of the Air780 DTU typically aims to provide a flexible and easy-to-configure data transmission solution. Lua, as a lightweight and easily embeddable scripting language, is very suitable for software design for devices like DTUs. Below is a reference for the Lua-based Air780 DTU software design architecture:
The Lua software design architecture of the Air780 DTU mainly includes the following parts:
1) Lua runtime environment: Provides the parsing and execution environment for Lua scripts, including the Lua interpreter, basic library functions, etc.
2) Lua API interface: Defines a series of API functions for interaction between Lua scripts and the underlying hardware and operating system layers.
3) Lua script applications: Write specific Lua script applications to implement data collection, processing, transmission, and other business logic.
The Lua API interface serves as a bridge for interaction between Lua scripts and the underlying hardware and operating system layers. These interfaces typically include the following categories:
1) Hardware operation interfaces: Provide hardware operation functions such as GPIO control, serial communication, ADC/DAC reading.
2) Network communication interfaces: Implement network communication protocols such as TCP/IP, UDP, providing data sending and receiving functionalities.
3) Data processing interfaces: Provide functions for data parsing, conversion, storage, and other processing.
4) Configuration management interfaces: Allow Lua scripts to read and modify DTU configuration parameters.
Lua script applications are the part that implements specific business logic. Depending on actual needs, multiple Lua script files can be written, each responsible for a specific function. For example:
Data collection script: Collects sensor data or other information by calling hardware operation interfaces.
Data processing script: Performs preprocessing, analysis, conversion, and other operations on collected data.
Data transmission script: Uses network communication interfaces to send data to specified recipients or upload to cloud platforms.
Configuration and Management
To facilitate configuration and management, a unified configuration file or remote management interface can be designed. Lua scripts read the configuration file at startup to obtain necessary parameters and settings. At the same time, the remote management interface can be used to adjust the working state and parameters of the DTU in real-time.
Scalability and MaintainabilityTo enhance the scalability and maintainability of the Lua software architecture, the following measures can be taken:
Modular design: Divide Lua scripts into multiple modules, each responsible for a specific function. Through collaboration between modules, the overall business logic can be achieved.
Interface standardization: Establish a unified Lua API interface specification to ensure the stability and ease of use of the interfaces.
Logging and debugging: Implement logging functionality to record key operations and exception information, facilitating troubleshooting and debugging.
Documentation: Write detailed documentation explaining the usage and precautions of the Lua API interfaces, lowering the development threshold and improving development efficiency.
Through the above architecture design, a flexible, easily extendable, and maintainable software system can be built for the Air780 DTU based on the Lua language.
PROJECT = "NET-LTE-DTU"VERSION = "1.0.3"PRODUCT_KEY = "5XoC6f6tSEHw3rwdYzJRw77mJbYIomgI"log.info("main", PROJECT, VERSION)_G.sys = require("sys")_G.sysplus = require("sysplus")require("init")require("mqttmodule")require("uartmodule")require("tcpmodule")require("testmodule")local libfota = require("libfota")--require("mqcpmodule")log.style(2)
-- Check wdtif wdt then -- Add a watchdog to prevent the program from hanging, enable this feature on supported devices wdt.init(9000) -- Initialize watchdog set to 9s sys.timerLoopStart(wdt.feed, 3000) -- Feed the dog every 3sendfunction libfota_cb(result) log.info("fota", "result", result) -- fota success
if result == 0 then rtos.reboot() -- If there are other things to do, do not reboot immediately endend
-- Check for upgrades-- After connecting to the network, this message will be sentsys.subscribe("IP_READY", function(ip, adapter) log.info("mobile", "IP_READY", ip, (adapter or -1) == socket.LWIP_GP) sys.taskInit(function() libfota.request(libfota_cb) end)end)-- Initialize necessary processesinitDevice()
-- GPIO control operationsys.taskInit(gpioLoop)
-- Initialize databaselocal workMode, dbStatus = initConfig()if dbStatus then log.info("main" .. "Database initialized successfully:") -- Initialize serial port uartInitData = initUart()end
if uartInitData then log.info("main" .. "Serial port initialized successfully:" .. uartId)end
-- 5 is 5500 1 is sim card, register network status listening for sim card and 5500sys.subscribe("IP_READY", function(ip, adapter) log.info("ipready", ip, adapter) if adapter == 1 then is4GConnect = true elseif adapter == 5 then isW5500Connect = true end
end)
sys.subscribe("IP_LOSE", function(adapter) log.info("iplose", adapter) if adapter == 1 then is4GConnect = false pm.reboot() elseif adapter == 5 then isW5500Connect = false pm.reboot() endend)
-- Initialize database and working mode sys.taskInit(function() repeat sys.wait(3000) local workMode, dbStatus = initConfig()
if workMode and dbStatus then log.info("Database initialization complete") print("Configuration data normal", workMode, dbStatus) -- 1:mqtt-dtu 2:tcp-dtu 2:mqcp if workMode == 1 then log.info("Running MQTT-DTU mode") initMqttConfig() elseif workMode == 2 then log.info("TCP/DTU-DTU") initTcpConfig() end elseif workMode == false and dbStatus then log.info("Mode not configured") initTestMqttConfig() else print("Configuration data incorrect", "workMode", workMode, "dbStatus", dbStatus) end until dbStatusend)
sys.run()
Attachment: SCH_EVB_Air780X_.pdf Air780EX Hardware Design Manual V1.0.8.pdf https://mbb.eet-china.com/forum/topic/141063_1_1.html
Author: Abner Ma, Blogger from Breadboard Community
