DINO-PLC-V2
DINO-PLC-V2
요약
DINO PLC V2는 ESP32를 기반으로 Mitsubishi FX2N 호환 래더 로직을 구현한 오픈소스 소프트 PLC 보드입니다. W5500 Ethernet 컨트롤러를 탑재해 유선 Modbus TCP와 MQTT를 안정적으로 처리하면서, ESP32 내장 Wi-Fi로 클라우드·모바일 채널을 동시에 운용합니다. 기존 산업용 PLC의 폐쇄성과 고비용 문제를 오픈소스 생태계로 해결한 실용적 레퍼런스입니다.
개요
Mitsubishi FX 시리즈 PLC는 소규모 공장 자동화 시장에서 오랜 기간 표준처럼 사용되어 왔습니다. 그러나 전용 프로그래밍 소프트웨어, 독점 통신 프로토콜, 높은 하드웨어 단가는 소규모 메이커와 스타트업 엔지니어에게 진입 장벽으로 작용해 왔습니다. DINO PLC V2는 이 문제에 정면으로 대응합니다. ESP32 위에서 FX2N 명령 세트를 Arduino 라이브러리로 재현해, 기존 래더 로직 자산과 엔지니어링 경험을 그대로 활용할 수 있도록 설계되었습니다.
단순한 PLC 에뮬레이터에 그치지 않고, Modbus TCP·Modbus RTU·MQTT·Blynk·Line Notify까지 폭넓은 프로토콜을 지원해 레거시 현장 기기와 현대 IoT 클라우드를 단일 보드로 연결합니다. 특히 W5500 유선 Ethernet 컨트롤러를 내장해, Wi-Fi의 불안정성에 의존하지 않고 현장 네트워크를 운용할 수 있다는 점이 산업 환경에서 의미 있는 차별점입니다.
하드웨어 아키텍처
DINO PLC V2의 구성은 산업용 소형 PLC에 요구되는 핵심 요소를 충실히 갖추고 있습니다.
입출력 및 통신 인터페이스:
- 디지털 입력: 6채널 (24 VDC, Source type)
- 릴레이 출력: 4채널 + 고속 출력 1채널 (Y4)
- RS485: 1채널 (Auto Direction, Modbus RTU용)
- I2C: 1채널 (4핀, 외부 센서 확장용)
- RTC: DS1307 (I2C 연결)
- 리텐티브 메모리: 8K
시스템 전체 구조는 다음과 같습니다.
ESP32와 W5500은 SPI 인터페이스로 연결됩니다. W5500이 유선 Ethernet을 전담하고, ESP32 내장 Wi-Fi가 무선 채널을 담당하는 이중 네트워크 구조가 이 보드의 핵심 설계 포인트입니다.
FX2N 호환 소프트 PLC 구조
DINO PLC V2 라이브러리는 Mitsubishi FX2N PLC의 명령 서브셋을 Arduino C 라이브러리로 구현합니다. FX2N에 익숙한 엔지니어라면 별도의 학습 없이 래더 로직 구조를 그대로 활용할 수 있습니다.
V2에서 새롭게 추가된 기능은 PLC 운용의 신뢰성을 크게 높입니다.
- 리텐티브 D 메모리 (D200~D1000): 전원 차단 후에도 데이터 레지스터 값 보존
- 리텐티브 T/M/S 메모리: 타이머·보조 릴레이·스텝 상태 보존
- DS1307 RTC: 시간 기반 제어 및 NTP 동기화 지원
- 고속 출력 (Y4): 일반 릴레이 출력보다 빠른 응답이 필요한 제어에 활용
- I2C 포트 (4핀): 외부 센서, 디스플레이 등 I2C 기기 확장
리텐티브 메모리는 ESP32의 비휘발성 스토리지를 활용해 구현된 것으로 추정되며 [추정], PLC 스캔 사이클 중단 없이 레지스터 값을 보존합니다. 이는 컨베이어 제어, 카운터 누적, 생산량 집계처럼 전원 재투입 후에도 상태를 유지해야 하는 응용에 필수적인 기능입니다.
지원 프로토콜 및 통신 구조
DINO PLC V2가 지원하는 통신 프로토콜 범위는 단순한 PLC를 넘어섭니다.
| 프로토콜 | 경로 | 역할 |
|---|---|---|
| Modbus TCP (Server/Master/Slave) | W5500 Ethernet | 현장 SCADA·HMI 연결 |
| Modbus RTU (Master/Slave) | RS485 | 레거시 기기 연결 |
| MQTT | Wi-Fi 또는 Ethernet | 클라우드·브로커 연결 |
| Blynk | Wi-Fi | 모바일 앱 모니터링·제어 |
| Line Notify / HTTP | Wi-Fi | 이벤트 알림 |
| NTP | Wi-Fi | RTC 시간 동기화 |
Wi-Fi와 W5500 Ethernet을 동시에 운용하는 구조이므로 [추정], 역할에 따라 네트워크 채널을 분리할 수 있습니다. 예를 들어 Modbus TCP는 현장 LAN의 유선 Ethernet(W5500)을 통해 처리하고, MQTT 클라우드 발행과 Blynk 모니터링은 Wi-Fi로 분리하는 방식입니다. 이 이중 채널 구조는 RF 간섭이 심한 산업 환경에서 유선 Ethernet의 신뢰성을 유지하면서 동시에 무선 원격 접속 편의성도 확보하는 실용적인 설계입니다.
W5500 적용 구조
DINO PLC V2에는 W5500이 Ethernet 컨트롤러로 탑재되어 있습니다. SPI 인터페이스를 통해 ESP32와 연결되며, 현장 유선 네트워크 통신을 전담합니다.
W5500의 역할:
- Modbus TCP Server (포트 502): 상위 SCADA·HMI 시스템의 폴링 요청 수신
- Modbus TCP Master/Slave: 동일 LAN 내 다른 Modbus TCP 기기와 통신
- MQTT over Ethernet: 유선 경로를 통한 MQTT 브로커 연결 (Wi-Fi 대체 경로)
W5500은 하드웨어 TCP/IP 스택을 내장하고 있어, TCP 연결 관리·재전송·ARP 처리 등 네트워크 처리를 칩 내부에서 자율적으로 수행합니다 [추정: Arduino Ethernet 라이브러리 사용 시]. 이는 ESP32가 FX2N 래더 로직 스캔, RS485 Modbus RTU 처리, Wi-Fi 통신을 동시에 수행하는 환경에서 MCU의 네트워크 처리 부하를 분산시키는 데 기여합니다.
PLC 응용에서 유선 Ethernet의 의미는 단순한 "연결 수단"을 넘어섭니다. Wi-Fi는 산업 현장의 인버터·용접기·모터 구동 장치 등에서 발생하는 RF 간섭에 취약하고, 연결 복구 지연이 PLC 스캔 사이클에 영향을 줄 수 있습니다. W5500 기반의 유선 Ethernet은 이러한 환경에서 결정론적이고 안정적인 통신 경로를 제공합니다.
비즈니스 가치 및 적용 시나리오
DINO PLC V2가 제시하는 가치는 두 가지 층위에서 작동합니다.
고객 관점에서는 기존 FX2N 자산의 재활용 가능성이 핵심입니다. 래더 로직 프로그래밍 경험, 기존 I/O 배선 구조, Modbus 기반 SCADA 시스템을 그대로 유지하면서 하드웨어만 교체할 수 있습니다. ESP32 기반 오픈소스 플랫폼이므로 BOM 비용 역시 기존 산업용 PLC 대비 대폭 낮출 수 있습니다.
WIZnet 관점에서는 W5500이 산업용 소프트 PLC의 Ethernet 인터페이스로 채택된 레퍼런스입니다. Modbus TCP와 MQTT를 동시에 처리하는 멀티소켓 운용, 이중 네트워크 구조에서의 유선 신뢰성 담당 역할이 산업 IoT 시장에서의 W5500 포지셔닝을 잘 보여줍니다.
주요 적용 시나리오:
- 소규모 공장 자동화: 컨베이어·포장 라인·공압 제어에 FX2N 래더 로직 그대로 적용. Modbus TCP로 상위 SCADA와 연결
- 레거시 PLC 교체: 노후화된 FX2N 하드웨어 교체 시 기존 프로그램 자산을 최대한 보존하면서 IoT 연결성 추가
- 스마트 빌딩 설비 제어: 조명·공조·출입 제어를 Modbus RTU로 통합하고 MQTT로 BMS에 데이터 발행
- 스마트 팜: 환경 센서 데이터를 I2C로 수집하고, 관개·환기 제어를 래더 로직으로 구현. Blynk로 모바일 모니터링
한계 및 개선 방향
DINO PLC V2는 오픈소스 소프트 PLC의 가능성을 실질적으로 보여주는 프로젝트입니다. 다만 산업 현장 투입에 앞서 몇 가지 구조적 특성을 파악해 두는 것이 좋습니다.
현재 한계:
- PLC 스캔 사이클 지터: ESP32 단일 코어에서 래더 로직 실행·MQTT·Wi-Fi 스택이 경합할 경우, 스캔 사이클의 일관성이 저하될 수 있습니다. 고속 응답이 필요한 제어에는 별도 검증이 필요합니다.
- 고정 I/O 구성: 6입력 / 4출력 구성이 고정되어 있으며, 현재 확인 범위 내에서 확장 모듈은 지원되지 않습니다. 대규모 I/O가 필요한 라인에는 적합하지 않습니다.
- 리텐티브 메모리 내구성: 플래시 기반 비휘발성 저장소는 쓰기 횟수에 제한이 있습니다. 빠른 주기로 레지스터를 갱신하는 설계에서는 플래시 수명을 고려해야 합니다.
- Modbus TCP 소켓 관리: W5500은 최대 8개 소켓을 지원하지만, 실제 코드에서의 소켓 할당 구조는 확인되지 않았습니다. 다수의 클라이언트가 동시에 접속하는 환경에서는 사전 검증이 필요합니다.
개선 방향:
- FreeRTOS 태스크 분리: ESP32의 듀얼 코어를 활용해 코어 0은 래더 로직 스캔, 코어 1은 네트워크 처리(W5500 + Wi-Fi)로 분리하면 스캔 사이클 안정성이 크게 향상됩니다.
- I/O 확장: I2C 포트를 활용한 GPIO 익스팬더(PCF8574 등) 연결로 제한적인 확장이 가능합니다. 공식적인 확장 모듈 설계가 추가된다면 활용 폭이 넓어질 것입니다.
- W5500 소켓 관리 고도화: Modbus TCP와 MQTT 각각에 전용 소켓을 고정 할당하고, 소켓 상태를 주기적으로 점검하는 Watchdog 구조를 추가하면 장기 운용 안정성이 향상됩니다.
FAQ
Q. W5500 Ethernet과 Wi-Fi를 동시에 사용할 수 있나요? 네, 동시 운용이 가능한 구조로 추정됩니다 [추정]. README에 두 인터페이스가 독립 항목으로 명시되어 있으며, 지원 프로토콜 구성상 Modbus TCP는 Ethernet, Blynk·Line Notify는 Wi-Fi로 역할을 분리해 사용하는 것이 일반적인 운용 방식입니다.
Q. 기존 FX2N 래더 프로그램을 그대로 포팅할 수 있나요? FX2N 명령어 서브셋을 지원하므로 기본적인 래더 로직은 재활용 가능합니다. 다만 DINO PLC V2가 FX2N의 전체 명령 세트를 지원하는지는 공개된 소스에서 완전히 확인되지 않았습니다. 복잡한 특수 펑션 블록이나 고속 카운터가 포함된 프로그램은 사전 검증이 필요합니다.
Q. 산업 현장에서 신뢰성은 어느 수준인가요? 소규모 공정 제어나 보조 제어 회로 수준의 응용에는 충분히 검토할 만합니다. 단, 안전 회로나 고속 응답(수ms 이하)이 요구되는 메인 라인 제어에는 추가 검증과 보완 설계가 필요합니다. RS485·유선 Ethernet 기반의 통신 구조는 RF 간섭이 많은 현장에서도 안정적으로 동작하는 방향으로 설계되어 있습니다.
Q. I/O를 확장할 수 있나요? 현재 공식 확장 모듈은 확인되지 않습니다. I2C 포트를 통한 GPIO 익스팬더 연결은 기술적으로 가능하나, 라이브러리 차원의 공식 지원 여부는 소스 코드를 통해 추가 확인이 필요합니다.
Summary
DINO PLC V2 is an open-source soft PLC board built on ESP32, implementing a Mitsubishi FX2N-compatible ladder logic instruction set. It integrates a W5500 Ethernet controller for reliable wired Modbus TCP and MQTT communication, while simultaneously running cloud and mobile channels over ESP32's built-in Wi-Fi. It's a practical reference for solving the high cost and closed ecosystems of traditional industrial PLCs using open-source tools.
Overview
The Mitsubishi FX series PLC has long served as a de facto standard in small-scale factory automation. However, proprietary programming software, closed communication protocols, and high hardware costs have created a real barrier for small teams and maker engineers. DINO PLC V2 addresses these challenges directly. It reimplements the FX2N instruction set as an Arduino library running on ESP32, allowing engineers to reuse existing ladder logic assets and programming expertise without starting from scratch.
Beyond basic PLC emulation, the board supports a wide range of protocols — Modbus TCP, Modbus RTU, MQTT, Blynk, and Line Notify — enabling it to bridge legacy field devices and modern IoT cloud platforms on a single board. The onboard W5500 wired Ethernet controller ensures that field network communication doesn't depend on Wi-Fi stability, which is a meaningful differentiator in industrial environments.
Hardware Architecture
DINO PLC V2 covers the essential building blocks of a compact industrial PLC.
I/O and communication interfaces:
- Digital inputs: 6 channels (24 VDC, source type)
- Relay outputs: 4 channels + 1 high-speed output (Y4)
- RS485: 1 channel (auto direction, for Modbus RTU)
- I2C: 1 channel (4-pin, for external sensor expansion)
- RTC: DS1307 (I2C)
- Retentive memory: 8K
The overall system architecture is as follows:
The ESP32 and W5500 communicate over an SPI interface. W5500 handles all wired Ethernet traffic, while ESP32's built-in Wi-Fi manages the wireless channel. This dual-network design is the core architectural differentiator of this board.
FX2N-Compatible Soft PLC Structure
The DINO PLC V2 library implements a subset of the Mitsubishi FX2N PLC instruction set as an Arduino C library. Engineers familiar with FX2N can apply their existing ladder logic knowledge directly, without learning a new programming model.
V2 introduces several features that meaningfully improve PLC operational reliability:
- Retentive D memory (D200~D1000): data register values persist across power cycles
- Retentive T/M/S memory: timer, auxiliary relay, and step states are preserved
- DS1307 RTC: supports time-based control logic and NTP synchronization
- High-speed output (Y4): handles control tasks that require faster response than standard relay outputs
- I2C port (4-pin): enables expansion with external sensors and displays
Retentive memory is [Inferred] implemented using ESP32's non-volatile storage, preserving register values without interrupting the PLC scan cycle. This is essential for applications that must maintain state across power interruptions — such as conveyor control, production counters, and cumulative metering.
Supported Protocols and Communication Structure
The range of protocols supported by DINO PLC V2 goes well beyond a basic PLC.
| Protocol | Path | Role |
|---|---|---|
| Modbus TCP (Server/Master/Slave) | W5500 Ethernet | SCADA/HMI connectivity |
| Modbus RTU (Master/Slave) | RS485 | Legacy device connectivity |
| MQTT | Wi-Fi or Ethernet | Cloud/broker messaging |
| Blynk | Wi-Fi | Mobile app monitoring and control |
| Line Notify / HTTP | Wi-Fi | Event notifications |
| NTP | Wi-Fi | RTC time synchronization |
The board [Inferred] operates Wi-Fi and W5500 Ethernet simultaneously, allowing each channel to handle a distinct role. For example, Modbus TCP runs over the wired Ethernet channel (W5500), while MQTT cloud publishing and Blynk monitoring use Wi-Fi. This dual-channel structure maintains the reliability of wired Ethernet in RF-noisy industrial environments, while still providing the convenience of wireless remote access.
Where W5500 Fits
DINO PLC V2 integrates the W5500 as its Ethernet controller. It connects to the ESP32 via SPI and handles all wired network communication on the board.
W5500's role:
- Modbus TCP Server (port 502): receives polling requests from SCADA and HMI systems
- Modbus TCP Master/Slave: communicates with other Modbus TCP devices on the same LAN
- MQTT over Ethernet: provides a wired path to the MQTT broker as an alternative to Wi-Fi
W5500 embeds a hardwired TCP/IP stack, handling TCP connection management, retransmission, and ARP resolution autonomously within the chip [Inferred: when used with the Arduino Ethernet library]. In an environment where ESP32 simultaneously runs FX2N ladder logic, RS485 Modbus RTU, and Wi-Fi communication, this offloads network processing from the MCU and helps distribute the overall CPU workload.
In PLC applications, wired Ethernet means more than just connectivity. Wi-Fi is susceptible to RF interference from inverters, welding equipment, and motor drives commonly found on factory floors, and reconnection delays can affect PLC scan cycle consistency. W5500-based wired Ethernet provides a deterministic and stable communication path in exactly these environments.
Business Value and Use Cases
The value DINO PLC V2 delivers operates on two levels.
From a customer perspective, the key advantage is the ability to reuse existing FX2N assets. Engineers can preserve their ladder logic programs, existing I/O wiring conventions, and Modbus-based SCADA infrastructure — replacing only the hardware. As an open-source ESP32-based platform, BOM costs are significantly lower than traditional industrial PLCs.
From a WIZnet perspective, this project is a reference showing W5500 adopted as the Ethernet interface in an industrial soft PLC. The multi-socket operation handling Modbus TCP and MQTT simultaneously, and the board's role as the wired reliability layer in a dual-network architecture, clearly demonstrates W5500's positioning in the industrial IoT market.
Key use cases:
- Small-scale factory automation: apply FX2N ladder logic directly to conveyor, packaging, or pneumatic control lines; connect to SCADA over Modbus TCP
- Legacy PLC replacement: swap aging FX2N hardware while preserving existing program assets and adding IoT connectivity
- Smart building control: consolidate lighting, HVAC, and access control over Modbus RTU, and publish data to a BMS via MQTT
- Smart agriculture: collect environmental sensor data via I2C, implement irrigation and ventilation control in ladder logic, and monitor remotely via Blynk
Limitations and Future Improvements
DINO PLC V2 makes a compelling case for open-source soft PLCs. That said, a few structural characteristics are worth understanding before deploying in a production environment.
Current limitations:
- PLC scan cycle jitter: when FX2N ladder execution, MQTT, and the Wi-Fi stack compete on ESP32's single core, scan cycle consistency may degrade. Applications requiring deterministic high-speed response need additional validation.
- Fixed I/O count: the 6-input / 4-output configuration is fixed, and no official expansion module support has been confirmed. This limits applicability to larger-scale I/O requirements.
- Retentive memory endurance: flash-based non-volatile storage has a finite write cycle limit. Designs that update registers at high frequency should factor in flash longevity.
- Modbus TCP socket management: W5500 supports up to 8 sockets, but the actual socket allocation structure in the firmware has not been verified. Environments with multiple simultaneous clients should be pre-validated.
Improvement directions:
- FreeRTOS task separation: assigning Core 0 to ladder logic scanning and Core 1 to network processing (W5500 + Wi-Fi) would significantly improve scan cycle stability, making full use of ESP32's dual-core architecture.
- I/O expansion: connecting a GPIO expander (e.g., PCF8574) via the I2C port enables limited expansion. Official library support for expansion modules would broaden the platform's applicability considerably.
- W5500 socket management: dedicating fixed sockets to Modbus TCP and MQTT respectively, and adding a periodic socket-state watchdog, would improve long-term operational stability.
FAQ
Q. Can W5500 Ethernet and Wi-Fi be used simultaneously? Yes, simultaneous operation is the [Inferred] intended design. The README lists both interfaces as independent specifications, and the protocol lineup suggests Modbus TCP over Ethernet and Blynk/Line Notify over Wi-Fi as the typical split.
Q. Can existing FX2N ladder programs be ported directly? Basic ladder logic using standard FX2N instructions can be reused. However, full FX2N instruction set coverage has not been fully verified from the available source. Programs that rely on advanced function blocks or high-speed counters should be validated before deployment.
Q. What is the reliability level for industrial use? It is worth evaluating for auxiliary control circuits and small-scale process control applications. For safety circuits or main-line control requiring sub-millisecond response, additional validation and supplementary design are necessary. The RS485 and wired Ethernet communication architecture is designed to operate stably even in RF-noisy industrial environments.
Q. Is I/O expansion supported? No official expansion module has been confirmed. Connecting a GPIO expander via the I2C port is technically feasible, but official library-level support has not been verified from the available source.
