This project presents a compact, low‑power Modbus RTU to Ethernet/Wi‑Fi gateway based on the ESP32 microcontroller and the LAN8720A Ethernet PHY.
The goal is to connect legacy Modbus RTU (RS‑485) industrial devices to modern IP networks and the cloud, enabling remote monitoring and data collection using MQTT.
The gateway has been tested in real applications with PLCs and industrial energy meters, and is suitable for industrial retrofitting, IoT integration, and maker projects.
Why This Project?Many industrial devices still rely on Modbus RTU over RS‑485, which makes remote monitoring and system integration difficult.
This project solves that problem by:
- Converting Modbus RTU → Modbus TCP / MQTT
- Supporting both Ethernet and Wi‑Fi
- Keeping the hardware simple, affordable, and open
- ESP32 — main microcontroller and protocol handler
- RS‑485 transceiver (MAX485 / SP485 / SN65HVD1781)
- LAN8720A Ethernet PHY (RMII interface)
- Ethernet isolation transformer (HanRun HR911105A)
- Power input and protection circuits
- ESP32 reads/writes data from Modbus RTU slaves via RS‑485
- Data is processed and formatted
Data is sent to the cloud via:
- Wi‑Fi, or
- Ethernet (LAN8720A)
- Data is sent to the cloud via:Wi‑Fi, orEthernet (LAN8720A)
- All communication to upper systems uses the MQTT protocol
- ✅ Modbus RTU master (RS‑485)
- ✅ Ethernet (10/100 Mbps) via LAN8720A
- ✅ Wi‑Fi connectivity
- ✅ MQTT data publishing
- ✅ Compatible with PLCs and industrial devices
- ✅ Arduino‑based firmware
- ✅ Low power consumption (< 2W)
- Interface: RS‑485
- Baud rates supported:1200, 2400, 4800, 9600 … 115200, up to 512000 bps
- Maximum slaves: up to 32 devices on one bus
Protection:
- 100 mA fuse (over‑current)
- TVS diode (6.8 V) for surge protection
- Protection:100 mA fuse (over‑current)TVS diode (6.8 V) for surge protection
- Speed: 10 / 100 Mbps
- Operating temperature: –40°C to +85°C
- Isolation: HanRun HR911105A transformer
- Designed for stable operation in industrial environments
- Input voltage: 7–40 V (AC or DC)
- Power consumption: < 2 W
- Typical board temperature during operation: 45–55°C
To ensure reliability:
- A 5V cooling fan
- Heat sink activated when temperature increases
- Developed using Arduino IDE
- Modular firmware structure
Uses:
- Modbus RTU library for RS‑485 communication
- ESP32 networking stack (Wi‑Fi / Ethernet)
- MQTT for cloud data transfer
- Uses:Modbus RTU library for RS‑485 communicationESP32 networking stack (Wi‑Fi / Ethernet)MQTT for cloud data transfer
Data can be monitored using:
- Smartphone applications
- PC / laptop software (including custom C# tools)
- Industrial data logging
- PLC monitoring
- Energy meters (e.g. MFM devices)
- Factory automation retrofits
- IoT gateways for legacy systems
- Educational projects for Modbus & industrial networking
I am willing to share:
- ✅ Altium schematic
✅ Sample source code
- Modbus RTU read/write
- Wi‑Fi & Ethernet (LAN8720A)
- MQTT data transmission
- ✅ Sample source codeModbus RTU read/writeWi‑Fi & Ethernet (LAN8720A)MQTT data transmission
📌 Altium PCB layout file can be provided with a small donation (e.g. “a cup of coffee”).
📦 Demo boards are available and ready to ship upon request.
Demo📹 Demonstration video (working with MFM383A parameter selection):👉 https://www.facebook.com/kuem0912/posts/707666223039027
ContactIf you are interested in this project or collaboration, feel free to contact me:
📧 thanhnamlt5@gmail.com








Comments