---
title: "Desenvolvimento de um Sistema de Conversão entre os Protocolos DNP3 e Modbus (TCC)"
url: "https://maker.wiznet.io/matthew/projects/desenvolvimento-de-um-sistema-de-converso-entre-os-protocolos-dnp3-e-modbus/"
markdown_url: "https://maker.wiznet.io/matthew/projects/desenvolvimento-de-um-sistema-de-converso-entre-os-protocolos-dnp3-e-modbus/md"
type: "UCC: User Created Content"
author: "Pedro Henrique Nogacz"
author_url: "https://repositorio.ufsc.br/handle/123456789/266826"
editor: "WIZnet"
editor_url: "https://maker.wiznet.io/"
original_author: "Pedro Henrique Nogacz"
original_url: "https://repositorio.ufsc.br/handle/123456789/266826"
published: "2025-12-12"
language: "en"
likes: 0
views: 782
comments: 0
source: "WIZnet Makers (https://maker.wiznet.io/)"
---

# Desenvolvimento de um Sistema de Conversão entre os Protocolos DNP3 e Modbus (TCC)

> A low-cost bidirectional DNP3↔Modbus TCP gateway built with two ESP32s and WIZnet W5500 Ethernet, with measured latency and real-world pitfalls.

Original author: Pedro Henrique Nogacz (source: https://repositorio.ufsc.br/handle/123456789/266826)

## Article

## Low-cost DNP3 ↔ Modbus TCP Gateway on ESP32 + WIZnet W5500 (UFSC Undergraduate Thesis)

## Introduction

This work is an undergraduate thesis (TCC) from UFSC that tackles a common real-world automation problem: **bridging two widely used industrial protocols—DNP3 and Modbus TCP—when systems can’t “speak” the same language**. The author implements a **bidirectional protocol converter** using **two ESP32-WROOM-32 modules**, each paired with a **WIZnet W5500 Ethernet controller**, and links the ESP32 pair via **UART** to separate and simplify the translation pipeline.

---

## Overview

- **Goal**: Convert traffic **both ways** between **Modbus TCP** and **DNP3 TCP** in a transparent gateway-style setup.

- **Hardware**: Two ESP32 boards + UART interconnect + **one W5500 per ESP32** for wired Ethernet.

- **Validation**: A small LAN testbed is used to send commands through the gateway, capture logs, and measure latency at each hop.

---

## Quick background: What is DNP3?

![](https://maker.wiznet.io/upload/ckeditor5/415555091%5F1765533228%2Epng)

**DNP3 (Distributed Network Protocol 3)** is widely used in **utility/SCADA environments** (power, water, etc.), typically in a **master/outstation** model for remote monitoring and control. It is also known as **IEEE Std 1815** and has standardized extensions like **Secure Authentication** discussed in industry documentation.

Why this matters here: **Modbus** is common in industrial equipment and PLC-centric environments, while **DNP3** is common in utility SCADA. That split creates a recurring need for **protocol gateways**—exactly what this thesis prototypes.

---

## Related VAR (DNP3 VAR Product)

- VAR1 : <https://maker.wiznet.io/matthew/resellers/pmi-dc-battery-charger/>

- VAR2: <https://maker.wiznet.io/matthew/resellers/industrial-shields-arduino-plc-for-automation-monitoring-and-control/>

---

## Author & context

- **Author**: Pedro Henrique Nogacz

- **Advisor**: Prof. Ciro André Pitz

- The UFSC repository metadata and abstract clearly state the objective and the chosen architecture (ESP32 pair, UART link, W5500 Ethernet).

- Publish: 2025. 7

---

## Architecture & data flow

![](https://maker.wiznet.io/upload/ckeditor5/415555091%5F1765533257%2Ejpg)

Repo: [`https://repositorio.ufsc.br/bitstream/handle/123456789/266826/Pedro_Nogacz___TCC.pdf?sequence=1&isAllowed=y`](https://repositorio.ufsc.br/bitstream/handle/123456789/266826/Pedro_Nogacz___TCC.pdf?sequence=1&isAllowed=y)

At a high level, the gateway is designed as a **two-stage pipeline**:

1. ESP32 #1 receives Protocol A over Ethernet → parses and maps data → sends an internal representation over **UART**

2. ESP32 #2 receives that internal representation → rebuilds Protocol B → outputs Protocol B over Ethernet

The thesis specifies the **UART interconnect (115200 baud)** and uses a LAN test setup to isolate and measure each stage.

---

## What W5500 does in this design

In this project, **W5500 is the wired Ethernet interface that makes the ESP32 boards reliable LAN endpoints for TCP/IP traffic**. The thesis explicitly notes W5500 characteristics such as **SPI Ethernet integration**, **8 simultaneous connections**, and **32 KB internal buffer**, and it uses **one W5500 per ESP32** to implement the gateway’s network-facing endpoints.

---

## Results: latency & behavior

The thesis measures latency per segment (Table 8), reporting millisecond-level averages such as:

- Modbus ESP32 → DNP3 ESP32: **4.38 ms** (avg)

- DNP3 ESP32 → PC: **3.24 ms** (avg)

- DNP3 ESP32 → Modbus ESP32: **5.52 ms** (avg)

- Modbus ESP32 → PC: **3.58 ms** (avg)

It also explains why **DNP3→Modbus** tends to be slower—additional processing plus the UART handoff.

---

## Commercial gateways vs. the prototype

The thesis compares against commercial devices (e.g., Moxa/Siemens examples) and frames the ESP32+W5500 build as a **low-cost, high-flexibility reference** rather than a drop-in replacement for certified industrial gear. A comparison table highlights prototype advantages such as **low estimated cost** and **open code**, contrasted with higher-cost commercial gateways that offer industrial robustness and vendor tooling.

---

## Limitations & lessons learned

This is one of the strongest parts of the write-up: it documents practical failure modes and integration issues, including:

**Packet loss / backlog** under aggressive update timing and load

**W5500 initialization issues after power cycling**, with discussion of SPI timing/reset handling and suggested recovery strategies

Watchdog-related resets under certain conditions

---

## Future work

Proposed next steps include:

- Dynamic configuration (IP/port) via UI or config system

- **FreeRTOS task separation**, UART flow-control improvements, buffering upgrades

- More robust W5500 fault detection and recovery/logging

---

## Why this content matters

- **For automation learners/researchers**: a reproducible example of how a real gateway is structured, tested, and benchmarked.

- **For legacy integration**: shows a practical path to connect Modbus-only equipment to DNP3-centric SCADA ecosystems.

- **For WIZnet makers**: a concrete reference of **W5500 used as the network backbone of an industrial protocol gateway**, including measured latency and documented edge cases (like power-cycle initialization pitfalls).

## ESP32 + W5500 기반 DNP3 ↔ Modbus TCP 양방향 프로토콜 컨버터 (UFSC TCC)

## Introduction

본 컨텐츠는 UFSC(Universidade Federal de Santa Catarina)에서 공개된 학부 졸업작품(TCC) **「DNP3와 Modbus 프로토콜 간 변환 시스템 개발」**로, 산업·에너지 자동화 환경에서 빈번히 발생하는 **서로 다른 산업용 프로토콜(DNP3 ↔ Modbus TCP) 간 통합 문제**를 저비용 임베디드 하드웨어로 해결하는 레퍼런스입니다.

TCC는 브라질 대학에서 쓰는 약어로, **Trabalho de Conclusão de Curso**(코스/학위 **졸업(종합)과제**, Final Course Project/Final Paper)라는 뜻이에요. 대부분 학부 과정에서 **졸업 요건으로 제출하는 논문/모노그래프/프로젝트 보고서**를 말합니다.

핵심은 간단합니다:

**ESP32 2대**를 **UART로 연결**해 변환 파이프라인을 분리하고,

각 ESP32를 **WIZnet W5500 Ethernet**으로 유선 LAN에 붙여,

**Modbus TCP ↔ DNP3 TCP** 변환을 “양방향”으로 구현합니다.

---

## Overview

**목표**: Modbus TCP 기반 장비와 DNP3 TCP 기반 장비를 “투명하게” 연결하는 **양방향 게이트웨이/컨버터구현**: ESP32-WROOM-32 2대 + UART interconnect + 각 1개씩 W5500 Ethernet 모듈

**테스트 환경**: 로컬 Ethernet 네트워크에서 송신/수신 클라이언트를 구성해 실제 변환 흐름과 지연을 검증

**결론(논문 요약)**: 변환이 양방향으로 정상 동작하며, ms 단위 지연이 **비핵심(저위험) 산업용 적용**에 적합하다는 결과

---

## Quick background: What is DNP3?

이 논문의 주제(“DNP3 ↔ Modbus”)를 이해하려면, DNP3가 어떤 분야에서 쓰이는지 짧게 짚는 게 좋습니다.

**DNP3(Distributed Network Protocol 3)**는 전력·수도 같은 **유틸리티 SCADA(원격감시제어)**에서 널리 쓰이는 통신 프로토콜로 소개됩니다.

산업계에서 DNP3는 **IEEE Std 1815**로도 알려져 있으며, 유틸리티 환경에서 원격 데이터 교환을 염두에 두고 설계된 표준으로 설명됩니다.

또한 DNP3는 “Secure Authentication(DNP3-SA)”처럼 응용 계층 수준의 인증 메커니즘이 문서화/논의되는 프로토콜로도 자주 언급됩니다.

반면 **Modbus**는 공장 자동화/프로세스 제어에서도 광범위하게 쓰이는 단순하고 보편적인 프로토콜로 요약되는 경우가 많고, 이 때문에 현장에서는 “Modbus 장비 ↔ DNP3 SCADA”를 연결하는 **게이트웨이 수요**가 생깁니다.

![](https://maker.wiznet.io/upload/ckeditor5/415555091%5F1765533228%2Epng)

DNP3는 주로 **유틸리티(전력·수도 등) SCADA**에서 많이 쓰입니다. 특히 **북미 전력 유틸리티**에서 채택이 매우 높다는 자료가 있고, 한 설문 요약에서는 **북미 전력 유틸리티의 94%가 SCADA에 DNP3를 사용**한다고 보고합니다. 또한 NIST 문서도 DNP3가 **북미 전력에서 광범위하게 쓰이고**, water/wastewater·oil&gas 등으로도 사용된다고 정리합니다.

“DNP3 시장 규모”는 보통 프로토콜 자체보다는 **DNP3 게이트웨이/SCADA 장비 시장**의 일부로 잡히며, 일부 민간 리서치는 **DNP3 게이트웨이 시장**을 별도로 추정치로 제시하지만(예: 2024년 약 $1.18B), 이는 **공식 통계가 아닌 참고용**으로 다루는 게 안전합니다.

---

## Related VAR (DNP3 VAR Product)

- VAR1 : <https://maker.wiznet.io/matthew/resellers/pmi-dc-battery-charger/>

- VAR2: <https://maker.wiznet.io/matthew/resellers/industrial-shields-arduino-plc-for-automation-monitoring-and-control/>

---

## Author & Context

**저자**: Pedro Henrique Nogacz

**지도교수**: Prof. Ciro André Pitz

**UFSC Campus Blumenau, Engenharia de Controle e Automação TCC**로 등록되어 있으며, 리포지터리 페이지의 초록에서 프로젝트 목적/구성(ESP32 2대 + UART + W5500 Ethernet)이 명확히 요약됩니다.

---

## Architecture & Data Flow

이 시스템의 데이터 흐름은 “프로토콜 A를 받은 ESP32가 해석 → UART로 전달 → 다른 ESP32가 프로토콜 B로 재구성”이라는 **모듈러 파이프라인**입니다.

두 ESP32는 **UART 115200 baud**로 연결되며, 한쪽은 Modbus→DNP3, 다른 한쪽은 DNP3→Modbus 역할을 맡습니다.

테스트 구성은 “송신 클라이언트 ↔ 변환기(ESP32 2대) ↔ 수신 클라이언트”로 분리되어, 변환 과정에서의 지연/병목을 로그로 추적합니다.

![](https://maker.wiznet.io/upload/ckeditor5/415555091%5F1765533257%2Ejpg)

Repo: [`https://repositorio.ufsc.br/bitstream/handle/123456789/266826/Pedro_Nogacz___TCC.pdf?sequence=1&isAllowed=y`](https://repositorio.ufsc.br/bitstream/handle/123456789/266826/Pedro_Nogacz___TCC.pdf?sequence=1&isAllowed=y)

---

## W5500은 여기서 무엇을 하나?

이 작품에서 W5500은 단순 부품이 아니라, **유선 TCP/IP 통신을 안정적으로 제공하는 핵심 인터페이스**입니다.

논문은 W5500을 다음처럼 설명합니다:

W5500은 **SPI 인터페이스를 갖는 Ethernet 컨트롤러**로, 임베디드 장치의 TCP/IP 연결에 적합

**최대 8개 동시 연결**과 **32kB 내부 버퍼**를 지원

본 프로젝트에서는 **각 ESP32에 W5500을 1개씩 연결**해 로컬 Ethernet에서 안정적인 통신을 수행

또한 테스트 네트워크는 스위치로 동작하는 TP-Link 장비에 모두 물려 **고정 IP 기반 로컬망**에서 진단과 재현성을 높였다고 설명합니다.

---

## Results: 성능/지연/안정성

변환 지연은 **각 단계별로 ms 단위**로 계측되어 표로 정리됩니다(“Tabela 8”).

예시(평균):

Modbus ESP32 → DNP3 ESP32: **4.38 ms**

DNP3 ESP32 → PC: **3.24 ms**

DNP3 ESP32 → Modbus ESP32: **5.52 ms**

Modbus ESP32 → PC: **3.58 ms**

저자는 **DNP3→Modbus 변환이 더 느린 이유**를 “추가 처리 + UART 데이터 교환” 때문이라고 설명하며, 표준편차가 0.2ms 이하로 낮아 **시간적 안정성**이 있음을 강조합니다.

---

## 상용 게이트웨이와의 비교: “왜 굳이 ESP32로?”

논문은 상용 게이트웨이(예: Moxa MGate 5109, Siemens TIM/SINAUT)를 예로 들며, 프로토타입의 포지션을 분명히 합니다.

상용 장비는 견고성과 산업 인증/지원이 강점이지만, 가격대가 높고 구성/도구 종속이 큼

비교표(“Tabela 9”)에서는 프로토타입의 강점을

**저비용(추정 R$240)코드 오픈(“Sim”)유연성(Alta)**
로 정리합니다.

즉, 이 컨텐츠는 “바로 공장 핵심 공정에 투입”이라기보다, **교육/테스트/연구/레거시 통합** 같은 영역에서 “빠르게 만들고 바꿔 쓰는” 게이트웨이 레퍼런스를 제공합니다.

---

## Limitations & Lessons Learned

현장 적용 관점에서 가장 가치 있는 부분은 “실제로 부딪힌 문제”를 구체적으로 적은 대목입니다.

고부하/짧은 주기(0.5s)에서는 패킷 손실·메시지 누적이 관측되고, UART 구간이 병목이 될 수 있다고 설명합니다.

전원 사이클에 따라 **W5500이 초기화 실패**를 일으켜 TCP 통신이 막힐 수 있으며, 원인 후보로 SPI 초기화 타이밍/리셋 펄스를 지목하고 “상태 확인 + 재초기화 루틴”을 제안합니다.

결론 파트에서는 UART 취약성과 더불어 **watchdog(INT_WDT) 연관 재시작**, W5500 초기화 실패 등을 명시적으로 언급합니다.

---

## Future Work

개선 방향도 “바로 다음 버전에서 할 일” 수준으로 구체적입니다.

IP/포트의 **동적 설정(웹 설정/UI 등)FreeRTOS로 태스크 분리**, UART 흐름 제어, 버퍼(링 버퍼 등) 최적화

W5500 장애 감지, 지속 로그, watchdog 세분화

---

## Where this content has impact

**산업·에너지 자동화**에서 “DNP3 ↔ Modbus 통합”을 저비용으로 검증하려는 팀

**교육/연구/실험실**에서 DNP3/Modbus/TCP 게이트웨이 개념을 재현하려는 커리큘럼

**WIZnet Maker 관점**에서는, W5500이 “단순 네트워크 모듈”이 아니라 **프로토콜 게이트웨이 설계의 핵심 인터페이스**로 쓰이며, 성능 측정·상용 비교·실패 모드(전원 사이클 초기화 실패)까지 포함해 학습할 수 있는 좋은 사례입니다.

---

### 원문 링크

UFSC 리포지터리(메타/초록): `https://repositorio.ufsc.br/handle/123456789/266826`

PDF: `https://repositorio.ufsc.br/bitstream/handle/123456789/266826/Pedro_Nogacz___TCC.pdf?sequence=1&isAllowed=y`

---

Source: https://maker.wiznet.io/matthew/projects/desenvolvimento-de-um-sistema-de-converso-entre-os-protocolos-dnp3-e-modbus/
