Skip to content

ETH Modbus Relay PRO

ETH Modbus Relay PRO: Putting 1 to 64 Isolated Relays on One Ethernet Cable with W5500 and Modbus TCP

scott

Published December 02, 2026

Original author: DIUSTOU · ChinaOriginal source (new tab)

ETH Modbus Relay PRO

Components

Hardware components

WIZnet parts

Project description

Summary

ETH Modbus Relay PRO is a DIN-rail Modbus TCP relay module made by Diustou (丢石头) in China. The product description lists 1, 2, 3, 4, 8, 16, 32 and 64-channel versions (the wiki model list currently shows 1, 2, 3, 4 and 8 channels). The design reads as a split in which the WIZnet W5500 handles Ethernet (MAC + PHY + TCP/IP) while a small STM32F030C8T6 MCU only parses registers and runs per-channel timers (TOE use is [Inferred]). Two things stand out: the register map and byte-level protocol examples are public, so it plugs into a PLC, Python or SCADA right away, and it has a fail-safe register that turns every output off when communication is lost.

Overview

In industrial remote control, a relay module has a simple job. It opens and closes dry contacts on command from a host such as a PLC, an industrial PC or a script. The trouble is what the field throws at it: ground potential differences, surges and common-mode noise. A relay keeps the coil circuit and the contact circuit electrically separate, which limits how much of that interference reaches the control side.

This product puts those relays behind a single Ethernet cable. According to the product page, it uses Omron G5NB-1A-E relays, mounts on a 35 mm DIN rail, wires through pluggable screw terminals, and is rated for -40 to +85 °C. Parameters survive power loss, and each channel can run in normal, flip, delay, loop or auto-reset mode.

The maker, DIUSTOU (丢石头), is an IoT component company in Nanshan District, Shenzhen, China. It describes itself as handling serial converters, relays and sensor modules from design and prototyping through mass production and sales. Its relay line is organized by interface (GPIO, RS232, RS485, USB, CAN and Ethernet), and this product belongs to the Ethernet family.
→ About the company: https://en.diustou.com/contact-us-lxw/about-diustou.html

The product page is the manufacturer's own technical documentation. We found no external material on deployments or regulatory drivers, so this article analyzes the design based on the manufacturer's documents and published register map.

The 8-channel ETH Modbus Relay PRO. RJ45 jack at the upper left, pluggable screw terminals along the right edge, eight Omron relays in the middle

→ Product page: https://wiki.diustou.com/cn/ETH_Modbus_Relay_PRO

Architecture

Here is how a Modbus TCP request travels from Ethernet to the relay contacts.

ETH Modbus Relay PRO block diagram. A host (PC, PLC or Python) connects to the W5500 over Modbus TCP (192.168.1.128:8235, 100M RJ45). The W5500 links to the STM32F030C8T6 over SPI. The MCU handles register parsing, per-channel modes and the comm watchdog, and drives the Omron G5NB-1A-E relays and COM/Y dry-contact terminals through a Darlington driver. W5500 TCP/IP handling is marked as inferred

Step by step, the flow looks like this. The split of work between the W5500 and the MCU is [Inferred] because the firmware is not public; the evidence is in the W5500 section below. The W5500's host interface is SPI.

  1. The host opens a TCP connection to the module's IP and port and sends a Modbus TCP request.
  2. The W5500 accepts the connection and hands the request data to the MCU in a readable form ([Inferred]).
  3. The MCU decodes the function code and register address, then updates that channel's mode and control value.
  4. The driver energizes the relay coil, and the contact opens or closes.
  5. The MCU builds the response frame and passes it to the W5500, which sends it back to the host ([Inferred]).

The front of the board carries the power terminal, RUN LED, RJ45 jack (with status LEDs), relays, per-channel LEDs, reset button and COM/Y terminals.

ETH Modbus Relay PRO hardware callouts. 1 power terminal, 2 RUN LED, 3 RJ45, 4 Omron relays, 5 channel LEDs, 6 reset button, 7 COM/Y output terminals

Wiring comes down to power (DC 12 V on the 12 V model; the spec sheet also lists 5 V and 24 V models), one RJ45 cable, and the load circuits on the contact side. The contacts are dry contacts that supply no voltage, so the load's own supply runs in series through the contact.

Dry-contact wiring example. On the contact side, an external supply runs through the COM/Y terminals to the motors. On the control side, only the DC 12 V supply and a 100M RJ45 cable are connected

Technology Background

Modbus TCP Frame: MBAP + PDU

Modbus TCP carries serial Modbus's request/response model over TCP/IP. A 7-byte MBAP header (transaction ID, protocol ID, length, unit ID) leads the frame. The serial device address becomes the unit ID, and the CRC field at the end of a serial frame is gone.
→ Modbus TCP implementation guide: https://modbus.org/file/secure/messagingimplementationguide.pdf

The product page's own example shows the structure. This request reads one word from holding register 003AH.

00 01 | 00 00 | 00 06 | 01   | 03   | 00 3A | 00 01
trans.  proto.  length  unit   func.  start   count

The response is 00 01 00 00 00 05 01 03 02 0C 5B. Its length field 0005H matches the bytes that follow (unit 1 + function 1 + byte count 1 + data 2). This module supports function codes that read and write relay coils directly in the same format. The product page lists 01 (read coils), 03 (read holding registers), 05 (write single coil), 06 (write single register), 0F (write multiple coils) and 10 (write multiple registers).

The module's default port is 8235, not 502, the registered Modbus TCP port. You have to set the port explicitly in your client tool.

Relay Contact Ratings and Load Selection

A relay module is only as good as the load its contacts can carry. The spec sheet rates the Omron relays at 250 VAC 5 A / 30 VDC 3 A, with an electrical life of at least 100,000 operations at AC 250 V 5 A and 200,000 at DC 30 V 3 A. Operate and release times are 10 ms max, and the rated-load switching frequency is 1,800 operations per hour.

Keep two things in mind when designing. First, inductive loads (motors, solenoids) produce back-EMF when the contact opens, so they need protection such as an RC snubber. The maker's RS485 model documentation also recommends an RC absorber for inductive loads. Second, these figures match the rated load and electrical durability of the G5NB-1A-E (high-capacity, SPST-NO) in Omron's datasheet. They are resistive-load values, so leave margin for inductive loads.
→ Omron G5NB datasheet: https://omronfs.omron.com/en_US/ecb/products/pdf/en-g5nb.pdf

Fail-Safe Communication Watchdog

The risk in remote control is that outputs stay in their last state when the link drops. This module exposes a communication watchdog time in register 0040H. A value of 0 disables it; a value greater than 1 (>1) turns off all outputs N × 0.1 s after communication is lost. The setting survives power loss. For equipment that is only safe when stopped, such as a press or a heater, this single register is a minimum safeguard.

Technical Highlights

  • Five operating modes per channel: each channel pairs a mode register (0050H to 008FH) with a control register (0000H to 003FH).
    • Normal: 1/0 switches on/off immediately
    • Flip: each write of 1 toggles the state
    • Delay: switches after N × 0.01 s
    • Loop: toggles automatically every N × 0.01 s
    • Auto-reset: turns off automatically N × 0.01 s after switching on
  • Bulk control: writing 1 to 0045H turns everything on and 0 turns everything off. Registers 0046H to 0049H control channels 1–16, 17–32, 33–48 and 49–64 as bitmaps in one write.
  • Network settings in registers: gateway (0090H–), subnet mask (0092H–), IP (0094H–) and port (0096H) are read and written as registers and take effect after a reboot. Values are stored byte-swapped. For example, 192.168.1.128 (C0.A8.01.80) goes in as the two words A8C0 and 8001, and port 8235 (202BH) is written as 2B20.
  • Recovery: holding the reset button for 3 s or more makes the LED blink slowly three times and performs a factory reset. A press between 100 ms and 3 s simply restarts the module. A soft reset writes 1 to 004AH.
  • Tools: the maker provides a Windows utility and a Python test program. The Python program puts coil read/write, channel mode and control-value settings, and network configuration behind a menu.

Main menu of the maker's Python test program. Items include connect, read coils (01H), read holding registers (03H), single coil control (05H), batch coil control (0FH), set channel mode, all on/off, software reset, and network and RS485 configuration

The maker's tool still has an RS485 settings item, and the product page says the RS485 items and registers can be ignored. The maker's Modbus usage guide PDF is also an RS485 guide, yet it includes the Ethernet network registers. Taken together, the Ethernet and RS485 models appear to share one register map and toolset ([Inferred]).

Where WIZnet Fits

Confirmed use: the product page names the W5500, and the spec sheet lists an STM32F030C8T6 MCU and a Darlington array on the drive side. The spec sheet also states the module has a "built-in standard Modbus TCP protocol stack and TCP/IP protocol stack", and the tool has a TCP server settings menu.

TOE in use: Yes ([Inferred]). There are two reasons. The module runs as a TCP server, and the STM32F030C8T6 is a 48 MHz Cortex-M0 MCU with no Ethernet MAC (64 KB Flash, 8 KB SRAM). Because the firmware is not public, we cannot directly confirm whether it runs a software TCP/IP stack or how it uses the sockets.
→ STM32F030C8 datasheet: https://www.st.com/resource/en/datasheet/stm32f030c8.pdf

When a request arrives, the work likely splits like this ([Inferred]).

  1. The client requests a TCP connection to 192.168.1.128:8235.
  2. The W5500 completes ARP replies, the TCP handshake and retransmission inside the chip.
  3. Once connected, the MCU reads only the Modbus frame from the socket receive buffer.
  4. The MCU decodes a PDU such as 01 05 00 00 FF 00 and drives that channel.
  5. The MCU writes the response PDU into the socket transmit buffer, and the chip handles the rest of the transmission.

Think of the W5500 as a building's front desk. The desk greets visitors, checks IDs and issues passes. The MCU is the staff member who only receives a note saying "turn on the relay on floor 3" and does it. That person never has to worry about what happens at the entrance.

Without this chip: the MCU has no Ethernet MAC, so the design would need an external MAC/PHY chip plus a software TCP/IP stack. A single small Cortex-M0 would have to run the network stack alongside the relay timers, register handling and the comm watchdog ([Inferred]).

The W5500 provides a hardwired TCP/IP stack, 8 independent sockets, 32 KB of internal Tx/Rx buffer memory, and SPI up to 80 MHz (WIZnet official documentation; 80 MHz is the datasheet's theoretical design speed).

→ W5500 documentation: https://docs.wiznet.io/Product/Chip/Ethernet/W5500

Similar Projects on WIZnet Makers

All three share an MCU with a W5500 attached over SPI for wired Ethernet. Whether each one uses the W5500's hardwired TCP/IP or only its MAC + PHY under a software stack may differ from case to case ([Inferred]).

Item ETH Modbus Relay PRO KinCony T64M 8CH Relay TCP MODBUS STM32+W5500 Modbus TCP Server
Ethernet chip W5500 W5500 W5500 W5500
MCU STM32F030C8T6 ESP32-S3 STM32F103 STM32 (model unknown)
Protocol Modbus TCP MQTT/ESPHome/TCP Modbus TCP + ASCII Modbus TCP
Default port 8235 N/A Unknown 502
Outputs Relays, 1–64 ch 64 MOSFET Relays, 8 ch N/A (reference code)
Notable Per-channel timer modes, comm watchdog HA integration, 64 inputs 4 sessions, 10 A FC03/04/06/10 implemented

The common thread is a design that "adds wired Ethernet with the W5500 and lets the MCU focus on the application." This product stands out as a finished device that publishes its register map and safety features.

Use Cases

  • PLC and SCADA integration: systems with a Modbus TCP master can add relay outputs without a separate gateway. With a public register map, you only need to match the PLC's Modbus settings.
  • Script-driven automation: the maker provides pymodbus examples, so process equipment or test rigs are easy to control from Python or Node-RED.
  • Timed contact control: the module runs the delay, loop and auto-reset modes itself, so you can produce pulsed outputs (holding a breaker, flashing a warning light) without the host polling on a fixed schedule.
  • Safety-relevant remote outputs: with the comm watchdog time set, the module suits equipment whose outputs must all turn off when the network drops.

Limitations and Future Improvements

The maker deserves credit for publishing registers and byte-level examples. Still, anyone implementing from the documentation should know the following before starting.

  • Documentation inconsistencies:
    • The function-code table gives the holding register range as 0000H to 008FH, but the register table has network settings from 0090H on (both the web page and the PDF).
    • Port register 0096H appears both as the port number and inside the reserved range 0096H to 009FH (both the web page and the PDF).
    • The web page says the response's "byte count" field is 2 bytes, but the example uses 1 byte (02H).
    • The control register description numbers the modes 1 to 5, but the actual mode register values are 0 to 4. The list numbers are easy to mistake for setting values.
    • The web page splits the comm watchdog across two rows, 0040H and 0041H. The maker's PDF separates them: 0040H is the comm watchdog and 0041H is input-state auto-reporting. The PDF appears to be correct.
  • What checks out: we verified by hand that the FC01 and FC0F bit-packing examples (F0 03, AA 02), the MBAP length field, and the byte-swapped IP, mask, gateway and port values are correct.
  • Non-standard port: the default port is 8235, not 502. You must set the port separately in clients and PLCs.
  • Feature scope: the module does not support PoE, a built-in web UI, WAN remote control or dry-contact inputs (spec sheet). If you need inputs, plan on a separate module or a custom build.
  • Unconfirmed items: we could not confirm certifications (such as CE), the number of simultaneous connections, or the output state after a power cycle.
  • Improvement directions: offering 502 as a port option, documenting whether multiple masters can connect using the W5500's 8 sockets ([Inferred]), fixing the duplicate addresses in the register table, and publishing certification information. All of these can be addressed through documentation and firmware cleanup without major hardware changes.

FAQ

Q1. Why is the port 8235 instead of 502?
The maker has not said. You can change the port through register 0096H; the default is 8235. Just specify the port in your client tool.

Q2. Can multiple clients connect at the same time?
We could not confirm this. The W5500 itself supports 8 sockets, but the firmware does not disclose how many it uses as servers.

Q3. What state are the relays in after a power cycle?
The product page and register table only say that parameters such as the comm watchdog and network settings persist through power loss. They do not mention the output state. For safety-relevant uses, measure it yourself.

Q4. How much load current can it handle?
Per the spec sheet, AC 250 V 5 A and DC 30 V 3 A. Add an RC snubber for inductive loads, and select against the relay maker's datasheet ratings.

Q5. What changes with the channel count?
The register map is defined for 64 channels, and models with fewer channels appear to use only the first channels ([Inferred]). Models are labeled like (8, 12V, CN, None, A), and the wiki model list shows 1, 2, 3, 4 and 8-channel versions.



요약

ETH Modbus Relay PRO는 중국 Diustou(丢石头)가 만든 DIN 레일형 Modbus TCP 릴레이 모듈로, 제품 소개문은 1·2·3·4·8·16·32·64채널 구성을 제시합니다(위키 모델 목록에 올라 있는 것은 1·2·3·4·8채널). WIZnet W5500이 이더넷(MAC+PHY+TCP/IP)을 맡고, 소형 STM32F030C8T6 MCU는 레지스터 해석과 채널별 타이머 동작만 처리하는 구조로 읽힙니다(TOE 사용은 [추정]). 레지스터 맵과 바이트 단위 프로토콜 예제가 공개되어 있어 PLC·Python·SCADA 어디에서든 바로 붙일 수 있다는 점, 그리고 통신이 끊기면 전체 출력을 차단하는 fail-safe 레지스터가 있다는 점이 주목할 만합니다.

개요

산업 현장의 원격 제어에서 릴레이 모듈이 맡는 일은 단순합니다. 상위 장치(PLC, 산업용 PC, 스크립트)가 보낸 명령에 따라 건접점(dry contact) 을 열고 닫는 것입니다. 문제는 현장에서 흔히 생기는 접지 전위차, 서지, 공통모드 노이즈입니다. 릴레이는 코일 쪽 회로와 접점 쪽 회로가 전기적으로 분리되어 있어 이런 간섭이 제어 계통으로 넘어오는 것을 줄여 줍니다.

이 제품은 그 릴레이를 이더넷 한 선으로 제어하도록 만든 모듈입니다. 제품 페이지 기준으로 Omron G5NB-1A-E 릴레이를 사용하고, 35mm DIN 레일에 올려 분리형 나사 단자로 배선하며, 동작 온도는 **-40~+85℃**로 표기되어 있습니다. 파라미터는 전원이 꺼져도 유지되고, 채널마다 보통·점동·지연·루프·자동복귀 모드를 고를 수 있습니다.

제조사 DIUSTOU(丢石头) 는 중국 선전 난산구에 있는 IoT 부품 회사로, 시리얼 변환기·릴레이·센서 모듈 등을 설계부터 시제품, 양산, 판매까지 직접 한다고 소개합니다. 릴레이는 GPIO·RS232·RS485·USB·CAN·이더넷 등 인터페이스별 제품군을 갖추고 있으며, 이 제품은 그중 이더넷 계열입니다.
→ 회사 소개: https://en.diustou.com/contact-us-lxw/about-diustou.html

제품 페이지는 제조사 자사 기술 문서입니다. 저장소 도입 사례나 규제 배경을 뒷받침하는 외부 자료는 확인하지 못했으므로, 이 글은 제조사 문서와 공개된 레지스터 맵을 기준으로 구조를 분석합니다.

8채널 ETH Modbus Relay PRO 외형. 왼쪽 위에 RJ45, 오른쪽 가장자리를 따라 분리형 나사 단자, 중앙에 Omron 릴레이 8개가 놓여 있다

→ 제품 페이지: https://wiki.diustou.com/cn/ETH_Modbus_Relay_PRO

아키텍처

이더넷으로 들어온 Modbus TCP 요청이 릴레이 접점까지 가는 흐름은 다음과 같습니다.

ETH Modbus Relay PRO 구성도. 호스트(PC·PLC·Python)가 Modbus TCP(192.168.1.128:8235, 100M RJ45)로 W5500에 접속하고, W5500은 SPI로 STM32F030C8T6과 연결된다. MCU는 레지스터 해석·채널별 모드·통신 감시를 맡고, 달링턴 드라이버를 거쳐 Omron G5NB-1A-E 릴레이와 COM/Y 건접점 단자를 구동한다. W5500의 TCP/IP 처리는 추정으로 표기했다

번호 순서로 정리하면 다음과 같습니다. W5500과 MCU 사이의 역할 분담은 펌웨어가 공개되지 않아 [추정]이며, 근거는 아래 W5500 절에 정리했습니다. W5500의 호스트 인터페이스는 SPI입니다.

  1. 상위 장치가 모듈의 IP·포트로 TCP 연결을 맺고 Modbus TCP 요청을 보냅니다.
  2. W5500이 연결을 받아 요청 데이터를 MCU가 읽을 수 있는 형태로 건넵니다([추정]).
  3. MCU가 기능 코드와 레지스터 주소를 해석해 해당 채널의 모드와 제어값을 갱신합니다.
  4. 드라이버가 릴레이 코일을 구동하고, 접점이 열리거나 닫힙니다.
  5. MCU가 응답 프레임을 만들어 W5500에 맡기면 칩이 상위 장치로 돌려보냅니다([추정]).

보드 전면에는 전원 단자, RUN LED, RJ45(상태 LED 포함), 릴레이, 채널별 LED, 리셋 버튼, COM/Y 단자가 배치되어 있습니다.

ETH Modbus Relay PRO 하드웨어 설명도. 1 전원 단자, 2 RUN LED, 3 RJ45, 4 Omron 릴레이, 5 채널 LED, 6 리셋 버튼, 7 COM/Y 출력 단자

배선은 전원(12V 모델 기준 DC 12V, 사양표에는 5V·24V 모델도 있음)과 RJ45 한 가닥, 그리고 접점 쪽 부하 회로가 전부입니다. 접점은 전압을 내보내지 않는 건접점이라, 부하 전원은 외부에서 접점을 직렬로 거쳐 공급합니다.

건접점 배선 예. 접점 쪽은 외부 부하 전원이 COM/Y 단자를 지나 모터로 가고, 제어 쪽은 DC 12V 전원과 RJ45 100M 케이블만 연결한다

기술 배경

Modbus TCP 프레임: MBAP + PDU

Modbus TCP는 직렬 Modbus의 요청·응답 모델을 TCP/IP 위로 옮긴 프로토콜입니다. 7바이트 MBAP 헤더(트랜잭션 ID, 프로토콜 ID, 길이, 유닛 ID)가 앞에 붙고, 직렬 프레임의 장치 주소는 유닛 ID로 바뀌며, 직렬 프레임 끝의 CRC 필드는 없습니다.
→ Modbus TCP 구현 가이드: https://modbus.org/file/secure/messagingimplementationguide.pdf

제품 페이지의 예제를 그대로 읽으면 구조가 보입니다. 보유 레지스터 003AH에서 1워드를 읽는 요청은 다음과 같습니다.

00 01 | 00 00 | 00 06 | 01 | 03 | 00 3A | 00 01
트랜잭션  프로토콜  길이   유닛  기능  시작주소  개수

응답은 00 01 00 00 00 05 01 03 02 0C 5B로, 길이 필드 0005H는 뒤따르는 바이트 수(유닛 1 + 기능 1 + 바이트수 1 + 데이터 2)와 맞습니다. 이 제품에서는 위 형식으로 릴레이 코일을 직접 읽고 쓰는 기능 코드를 지원합니다. 제품 페이지의 기능 코드 표는 01(코일 읽기), 03(보유 레지스터 읽기), 05(단일 코일), 06(단일 레지스터 쓰기), 0F(다중 코일), 10(다중 레지스터 쓰기)입니다.

이 모듈은 기본 포트가 8235입니다. Modbus TCP 의 등록 포트인 502가 아니므로, 클라이언트 도구에서 포트를 직접 지정해야 합니다.

릴레이 접점 정격과 부하 선정

릴레이 모듈의 가치는 접점이 견디는 부하에서 결정됩니다. 제품 사양표는 Omron 릴레이를 250VAC 5A / 30VDC 3A, 개폐 수명은 AC250V 5A 기준 10만 회 이상, DC30V 3A 기준 20만 회 이상으로 표기합니다. 동작·복귀 시간은 10ms 이하, 정격 부하 개폐 빈도는 시간당 1,800회입니다.

설계할 때는 두 가지를 챙겨야 합니다. 첫째, 유도성 부하(모터, 솔레노이드)는 접점이 열릴 때 역기전력이 생기므로 RC 스너버 같은 보호가 필요합니다. 같은 제조사의 RS485 모델 문서도 유도성 부하에는 RC 흡수 회로를 권장합니다. 둘째, 위 수치는 Omron 데이터시트의 G5NB-1A-E(고용량형, SPST-NO) 정격 부하와 전기적 수명 표기와 같습니다. 이는 저항 부하 기준이므로, 유도성 부하에서는 여유를 두고 선정하는 것이 안전합니다.
→ Omron G5NB 데이터시트: https://omronfs.omron.com/en_US/ecb/products/pdf/en-g5nb.pdf

Fail-safe 통신 감시

원격 제어의 위험은 통신이 끊긴 순간 출력이 마지막 상태로 남는 것입니다. 이 모듈은 레지스터 0040H에 통신 감시 시간을 두어, 값이 0이면 감시하지 않고 1보다 크면(>1) 통신이 끊긴 뒤 N × 0.1초 후 모든 출력을 끄도록 설정할 수 있습니다. 이 값은 전원이 꺼져도 유지됩니다. 프레스·히터처럼 멈춰야 안전한 장비에서는 이 한 레지스터가 최소한의 안전장치가 됩니다.

기술 특징

  • 채널별 5가지 동작 모드: 채널마다 모드 레지스터(0050H008FH)와 제어 레지스터(0000H003FH)가 짝을 이룹니다.
    • 보통: 1/0 즉시 개폐
    • 점동(flip): 1을 쓸 때마다 상태 반전
    • 지연: N × 0.01초 후 개폐
    • 루프: N × 0.01초 간격으로 자동 개폐 반복
    • 자동복귀: 켜진 뒤 N × 0.01초 후 자동 차단
  • 일괄 제어: 0045H에 1을 쓰면 전체 켜짐, 0을 쓰면 전체 꺼짐이고, 0046H0049H는 채널 116, 1732, 3348, 49~64를 비트맵으로 한 번에 제어합니다.
  • 네트워크 설정 레지스터: 게이트웨이(0090H), 서브넷 마스크(0092H), IP(0094H~), 포트(0096H)를 레지스터로 읽고 쓰며, 재부팅 후 적용됩니다. 값은 바이트 순서가 뒤바뀌어 저장됩니다. 예를 들어 192.168.1.128(C0.A8.01.80)은 A8C0, 8001 두 워드로 들어가고, 포트 8235(202BH)는 2B20으로 씁니다.
  • 복구 장치: 리셋 버튼을 3초 이상 누르면 LED가 3번 느리게 깜빡이며 공장 초기화, 100ms~3초 사이로 누르면 단순 재시작입니다. 소프트 리셋은 004AH에 1을 씁니다.
  • 운영 도구: 제조사가 Windows 도구와 Python 테스트 프로그램을 제공합니다. Python 프로그램은 코일 읽기·쓰기, 채널 모드·제어값 설정, 네트워크 설정 변경 등을 메뉴로 묶어 두었습니다.

제조사가 제공하는 Python 테스트 프로그램의 메인 메뉴. 릴레이 연결, 코일 읽기(01H), 보유 레지스터 읽기(03H), 단일 제어(05H), 일괄 제어(0FH), 채널 모드 설정, 전체 켜기/끄기, 소프트 리셋, 네트워크·RS485 설정 항목이 있다

제조사 도구에 RS485 설정 항목이 남아 있고, 제품 페이지도 "RS485 관련 항목과 레지스터는 무시해도 된다"고 적고 있습니다. 제조사의 Modbus 사용 가이드 PDF 역시 RS485 가이드인데 이더넷 네트워크 레지스터를 함께 싣고 있습니다. 이런 점에서 이더넷 모델과 RS485 모델이 같은 레지스터 맵과 도구를 공유하는 것으로 보입니다([추정]).

W5500은 이 모듈 어디에 들어가는가

실제 사용: 제품 페이지가 W5500을 명시하고, 사양표는 구동 쪽에 STM32F030C8T6 MCU와 달링턴 어레이를 둔다고 적습니다. 사양표는 모듈이 "내장 표준 Modbus TCP 프로토콜 스택과 TCP/IP 프로토콜 스택" 을 갖는다고 쓰고, 도구에는 TCP 서버 설정 메뉴가 있습니다.

TOE 사용: 예([추정]). 근거는 두 가지입니다. 모듈이 TCP 서버로 동작한다는 점, 그리고 STM32F030C8T6은 이더넷 MAC이 없는 48MHz Cortex-M0 MCU(Flash 64KB, SRAM 8KB)라는 점입니다. 펌웨어가 공개되지 않아 소프트웨어 TCP/IP 스택을 쓰는지, 소켓을 어떻게 쓰는지는 직접 확인할 수 없습니다.
→ STM32F030C8 데이터시트: https://www.st.com/resource/en/datasheet/stm32f030c8.pdf

요청이 들어왔을 때 역할은 다음처럼 나뉜다고 볼 수 있습니다([추정]).

  1. 클라이언트가 192.168.1.128:8235로 TCP 연결을 요청합니다.
  2. W5500이 ARP 응답, TCP 핸드셰이크, 재전송을 칩 안에서 끝냅니다.
  3. 연결이 성립하면 MCU는 소켓 수신 버퍼에서 Modbus 프레임만 읽습니다.
  4. MCU가 01 05 00 00 FF 00 같은 PDU를 해석해 해당 채널을 구동합니다.
  5. 응답 PDU를 소켓 송신 버퍼에 쓰면, 이후 전송은 칩이 맡습니다.

비유하자면 W5500은 건물 안내 데스크입니다. 방문객 응대, 신원 확인, 방문증 발급은 데스크가 처리하고, MCU는 "3층 릴레이를 켜 달라"는 쪽지만 받아 실행하는 담당자입니다. 담당자는 현관에서 일어나는 일을 신경 쓰지 않아도 됩니다.

만약 이 칩이 없었다면: 이 MCU에는 이더넷 MAC이 없으므로 외부 MAC/PHY 칩에 소프트웨어 TCP/IP 스택을 얹어야 합니다. 소형 Cortex-M0 하나가 릴레이 타이머, 레지스터 처리, 통신 감시와 네트워크 스택을 같이 돌려야 하는 구성이 되는 셈입니다([추정]).

W5500은 하드와이어드 TCP/IP, 8개 독립 소켓, 내부 32KB 송수신 버퍼, 최대 80MHz SPI를 갖춘 칩입니다(WIZnet 공식 문서. 80MHz는 데이터시트상 이론 설계값).

→ W5500 문서: https://docs.wiznet.io/Product/Chip/Ethernet/W5500

WIZnet Makers 유사 사례

세 사례 모두 MCU에 W5500을 SPI로 붙여 유선 이더넷을 얻는 구성이라는 점이 같습니다. 다만 W5500의 하드와이어드 TCP/IP를 쓰는지, 소프트웨어 스택 아래에서 MAC+PHY로만 쓰는지는 사례마다 다를 수 있습니다([추정]).

항목 ETH Modbus Relay PRO KinCony T64M 8CH Relay TCP MODBUS STM32+W5500 Modbus TCP Server
이더넷 칩 W5500 W5500 W5500 W5500
MCU STM32F030C8T6 ESP32-S3 STM32F103 STM32(기종 미상)
프로토콜 Modbus TCP MQTT/ESPHome/TCP Modbus TCP + ASCII Modbus TCP
기본 포트 8235 해당 없음 미상 502
출력 릴레이 1~64채널 MOSFET 64 릴레이 8채널 해당 없음(참고 코드)
특징 채널별 타이머 모드, 통신 감시 HA 연동, 64입력 4세션, 10A FC03/04/06/10 구현

공통점은 "W5500으로 유선 이더넷을 붙이고 MCU는 응용에 집중" 하는 설계이고, 본 제품의 차별점은 레지스터 맵과 안전 기능까지 공개한 완제품이라는 점입니다.

어디에 쓰나

  • PLC·SCADA 연동: Modbus TCP 마스터가 있는 시스템에서 별도 게이트웨이 없이 릴레이 출력을 확장할 수 있습니다. 레지스터 맵이 공개되어 있어 PLC의 Modbus 설정만 맞추면 됩니다.
  • 스크립트 기반 자동화: 제조사가 pymodbus 예제를 제공하므로, Python·Node-RED 같은 환경에서 공정 장치나 시험 장비를 제어하기 쉽습니다.
  • 타이밍이 필요한 접점 제어: 지연·루프·자동복귀 모드를 모듈이 처리하므로, 상위 시스템이 일정하게 폴링하지 않아도 펄스성 출력(차단기 유지, 경보등 점멸 등)을 만들 수 있습니다.
  • 안전이 걸린 원격 출력: 통신 감시 시간을 설정해 두면, 네트워크가 끊겼을 때 출력이 모두 꺼져야 하는 장비에 쓸 수 있습니다.

한계 및 개선 방향

제조사가 레지스터와 바이트 예제까지 공개한 점은 높이 평가할 만합니다. 다만 문서를 따라 구현하는 사용자라면 아래 사항을 알고 시작하는 편이 좋습니다.

  • 문서 표기 불일치:
    • 기능 코드 표는 보유 레지스터 범위를 0000H~008FH로 적지만, 레지스터 표에는 0090H 이후 네트워크 설정이 있습니다(웹 페이지와 PDF 모두).
    • 포트 레지스터 0096H가 포트 번호와 예약 구간(0096H~009FH)에 중복 표기되어 있습니다(웹 페이지와 PDF 모두).
    • 웹 페이지는 응답의 "반환 바이트 길이"를 2바이트라고 썼지만 예제는 1바이트(02H)입니다.
    • 제어 레지스터 설명은 모드를 15로 번호 매겨 나열하지만, 실제 모드 레지스터 값은 04입니다. 나열 번호를 설정값으로 오해하기 쉽습니다.
    • 웹 페이지는 통신 감시를 0040H와 0041H 두 행에 나눠 적었지만, 제조사 PDF는 0040H를 통신 감시, 0041H를 입력 상태 자동 보고로 구분합니다. PDF 쪽이 맞는 것으로 보입니다.
  • 교차 확인으로 맞는 것: FC01·FC0F의 비트 패킹 예제(F0 03, AA 02)와 MBAP 길이 필드, IP·마스크·게이트웨이·포트의 바이트 스왑 값은 직접 계산해 맞았습니다.
  • 비표준 포트: 기본 포트가 502가 아니라 8235입니다. 클라이언트와 PLC 설정에서 포트를 따로 지정해야 합니다.
  • 기능 범위: 이 모듈은 PoE, 내장 웹, WAN 원격 제어, 건접점 입력을 지원하지 않습니다(사양표). 입력이 필요하면 별도 모듈이나 맞춤 제작이 필요합니다.
  • 확인되지 않은 항목: 인증(CE 등), 동시 접속 가능 수, 전원 재투입 시 출력 상태는 확인할 수 없었습니다.
  • 개선 방향: 포트를 502로 바꾸는 선택지 제공, W5500의 8개 소켓을 활용한 다중 마스터 접속 지원 여부 문서화([추정]), 레지스터 표의 주소 중복 정정, 인증 정보 공개가 있습니다. 현재 하드웨어 구성을 크게 바꾸지 않아도 문서와 펌웨어 정리만으로 개선할 수 있는 항목들입니다.

FAQ

Q1. 포트가 왜 502가 아니라 8235인가요?
제조사는 이유를 밝히지 않았습니다. 레지스터 0096H로 포트를 바꿀 수 있고, 기본값이 8235입니다. 클라이언트 도구에서 포트만 지정하면 됩니다.

Q2. 여러 클라이언트가 동시에 접속할 수 있나요?
확인하지 못했습니다. W5500 자체는 8개 소켓을 지원하지만, 이 펌웨어가 몇 개를 서버로 쓰는지는 공개되어 있지 않습니다.

Q3. 전원이 꺼졌다 켜지면 릴레이는 어떤 상태가 되나요?
제품 페이지와 레지스터 표는 통신 감시·네트워크 설정 같은 파라미터가 전원 차단 후에도 유지된다고만 밝히고, 출력 상태는 언급하지 않습니다. 안전이 걸린 용도라면 반드시 실측으로 확인하세요.

Q4. 부하 전류는 어디까지 쓸 수 있나요?
사양표 기준 AC 250V 5A, DC 30V 3A입니다. 유도성 부하는 RC 스너버를 붙이고, 릴레이 제조사 데이터시트의 정격과 대조해 선정하세요.

Q5. 채널 수에 따라 무엇이 달라지나요?
레지스터 맵은 64채널을 기준으로 정의되어 있고, 채널 수가 적은 모델은 앞쪽 채널만 쓰는 구조로 보입니다([추정]). 모델은 (8, 12V, CN, None, A) 처럼 표기되며, 위키 모델 목록에는 1·2·3·4·8채널이 올라 있습니다.

Comments

Similar projects you might like

Comments