Wiznet makers

mason

Published January 14, 2026 ©

115 UCC

21 WCC

31 VAR

0 Contests

0 Followers

0 Following

Original Link

SmartIrrigationSystem

SmartIrrigationSystem

COMPONENTS Hardware components

WIZnet - W5500

x 1


PROJECT DESCRIPTION

Summary

이 프로젝트는 ATmega2560 + WIZnet W5500 보드가 웹서버로 동작하며, 13km 떨어진 급수원을 포함한 대규모 탱크/배관망을 원격 모니터링·제어합니다. PC의 Flutter 앱이 HTTP GET으로 데이터 요청과 릴레이 제어를 수행하고, 유량계(TUF-2000, Modbus RTU/RS485)와 압력 센서 값을 수집합니다. NanoStation 링크로 장거리 전송을 구성해 현장 설비 상태를 한 화면에 통합합니다.

이미지 출처 : https://github.com/eslamshahin0/SmartIrrigationSystem

pc.jpg

이미지 출처 : https://github.com/eslamshahin0/SmartIrrigationSystem


Technical analysis

이 저장소의 핵심은 “스마트 관개”를 농업용 대용량 급수/분배 인프라 운영 문제로 정의했다는 점입니다. 물은 13km 장거리 배관을 통해 이동하고, 도착 후 3개의 메인 파이프로 분기되며 각 라인에 20개 이상의 200~500m³급 탱크가 붙습니다. 이 구조에서는 “토양 수분 기반 자동 급수”보다 유량/압력 기반의 운영 안정성(누수, 막힘, 펌프 이상, 밸브 오동작 감지)이 더 중요해집니다.

통신 측면에서 선택된 WIZnet W5500은 MCU(ATmega2560)가 TCP/IP를 소프트웨어로 전부 처리하지 않고, Hardwired TCP/IP 스택에 소켓 단위로 위임할 수 있어, 현장 장비에서 “연결 유지/재접속/동시 세션” 같은 네트워크 변수를 보다 예측 가능하게 다루는 데 유리합니다. 이런 특성은 장거리 링크(예: 무선 브리지 + 유선 구간 혼합)에서 데이터 요청이 간헐적으로 오가고, 현장 MCU 리소스가 넉넉하지 않을 때 의미가 큽니다.

센서 계측은 TUF-2000 초음파 유량계가 **Modbus RTU(기반: RS485)**로 동작한다고 명시되어 있어, 보드에는 (1) RS485 트랜시버를 통한 Modbus 폴링/응답 처리와 (2) Ethernet(HTTP 응답) 처리가 함께 들어갑니다. 이때 “웹서버 + Modbus 폴링 + 릴레이 제어”는 타이밍 충돌이 쉽게 생기므로, W5500처럼 네트워크 부담을 줄여 MCU가 Modbus/제어 루프에 더 시간을 쓰도록 설계하는 접근이 합리적입니다.

이미지 출처 : https://github.com/eslamshahin0/SmartIrrigationSystem

이미지 출처 : https://github.com/eslamshahin0/SmartIrrigationSystem


Devices in the project

TUF-2000 Ultrasonic Flowmeter (초음파 유량계)

각 메인 파이프(대형 관로)마다 1대씩 설치되는 유량계로, Modbus RTU 기반 RS485 통신으로 데이터를 읽습니다.

이미지 출처 : https://github.com/eslamshahin0/SmartIrrigationSystem

 

HYXC-MP Pressure sensor (압력 센서, 4–20mA 출력 타입)

파이프 내부 압력을 측정해 4–20mA 아날로그 전류 신호로 출력

이미지 출처 : https://github.com/eslamshahin0/SmartIrrigationSystem

 

Pressure sensor (다른 타입의 압력 센서)

이미지 출처 : https://github.com/eslamshahin0/SmartIrrigationSystem

 

Levelmeter sensor (수위/레벨 센서)

대형 탱크에서 **최대 10m 수심(수위)**을 계산하는 데 사용되는 센서로 소개되어 있습니다.

이미지 출처 : https://github.com/eslamshahin0/SmartIrrigationSystem


데이터 흐름


TUF-2000 유량계(각 메인 파이프 1대) + 압력 센서 → (RS485/Modbus RTU) → ATmega2560 제어보드 → (SPI) → W5500 → (Ethernet) → NanoStation 무선 브리지(2대 링크) → 관리 PC(Flutter 데스크톱 앱)

이미지 출처 : AI 생성


FAQ (WIZnet 제품 중심, 각 50–75 words)

1) 왜 이 프로젝트에 W5500을 쓰는 게 유리한가요?

W5500은 Hardwired TCP/IP 스택과 하드웨어 소켓을 제공해, ATmega2560이 복잡한 TCP/IP 처리를 소프트웨어로 떠안지 않아도 됩니다. 이 프로젝트처럼 RS485(Modbus) 폴링과 릴레이 제어 타이밍이 중요한 시스템에서, 네트워크 부하를 칩으로 오프로딩하면 펌웨어의 지연/타임아웃 관리가 단순해집니다. 32KB 버퍼와 8소켓도 “요청·응답형 모니터링”에 여유를 줍니다.

2) ATmega2560과 W5500은 어떻게 연결하고, 어떤 점을 주의해야 하나요?

연결은 SPI 기반이며, W5500은 최대 80MHz SPI를 지원합니다. 다만 ATmega2560의 SPI 클록/신호 품질/배선 길이에 따라 실제 안정 동작 클록은 낮춰야 할 수 있습니다. 또한 W5500 버퍼(32KB)를 소켓별로 어떻게 분배할지(예: HTTP 응답 크기, 동시 접속 수)를 설계 단계에서 정하면, 장거리 링크에서 재전송이 생겨도 응답 일관성이 좋아집니다.

3) 이 프로젝트에서 W5500은 정확히 어떤 역할을 하나요?

README 기준으로 보드는 “웹서버처럼 동작”하고, PC(Flutter 앱)가 HTTP GET을 보내면 센서 데이터를 응답하며, 요청에 따라 릴레이도 제어합니다. 이때 W5500은 Ethernet 물리 계층/프레임 처리뿐 아니라 TCP/IP 처리까지 포함해 HTTP 요청·응답의 기반을 제공합니다. 즉 “센서(Modbus/ADC) 데이터 수집”과 “원격 제어(HTTP API)” 사이에서 네트워크 게이트웨이 역할을 맡습니다.

 

Summary

This project uses an ATmega2560 + WIZnet W5500 board acting as a web server to remotely monitor and control a large-scale tank and pipeline network, including a water source located 13 km away. A PC-based Flutter application sends HTTP GET requests for data retrieval and relay control, while the system collects readings from a flow meter (TUF-2000, Modbus RTU/RS485) and pressure sensors. A NanoStation link provides long-distance transmission and consolidates field equipment status onto a single screen.

Image source: https://github.com/eslamshahin0/SmartIrrigationSystem
pc.jpg

Image source: https://github.com/eslamshahin0/SmartIrrigationSystem


Technical analysis

The key point of this repository is that it defines “smart irrigation” as an operational challenge for large-scale agricultural water supply and distribution infrastructure. Water is transferred through a long-distance pipeline over 13 km, then split into three main pipes, with more than 20 large tanks (200–500 m³ class) connected to each line. In this structure, operational reliability based on flow rate and pressure (detecting leakage, blockage, pump failures, and valve malfunctions) becomes more important than “soil-moisture-based automatic watering.”

From a communications perspective, the WIZnet W5500 is chosen because it allows the MCU (ATmega2560) to delegate TCP/IP processing to a Hardwired TCP/IP stack at the socket level, instead of handling the full TCP/IP stack in software. This makes it easier to manage network variables such as connection maintenance, reconnection behavior, and concurrent sessions in a more predictable way. These characteristics matter when requests are intermittent over long links (e.g., wireless bridge + wired segments combined) and when the field MCU has limited resources.

For sensing and metering, the README specifies that the TUF-2000 ultrasonic flow meter operates over Modbus RTU (RS485-based). This means the controller must handle both (1) Modbus polling/response processing via an RS485 transceiver and (2) Ethernet (HTTP responses). Because “web server + Modbus polling + relay control” can easily create timing conflicts, it is reasonable to use an approach like the W5500 to reduce networking overhead so the MCU can spend more time on the Modbus/control loop.

Image source: https://github.com/eslamshahin0/SmartIrrigationSystem

Image source: https://github.com/eslamshahin0/SmartIrrigationSystem


Devices in the project

TUF-2000 Ultrasonic Flowmeter

A flow meter installed on each main pipe (one unit per large pipeline). Data is read via RS485 communication based on Modbus RTU.

Image source: https://github.com/eslamshahin0/SmartIrrigationSystem

HYXC-MP Pressure sensor (4–20 mA output type)

Measures internal pipeline pressure and outputs an analog current signal of 4–20 mA.

Image source: https://github.com/eslamshahin0/SmartIrrigationSystem

Pressure sensor (another type)

Another pressure sensor type used in the project.

Image source: https://github.com/eslamshahin0/SmartIrrigationSystem

Levelmeter sensor

Introduced as a sensor used to calculate water depth/level in large tanks, up to 10 m.

Image source: https://github.com/eslamshahin0/SmartIrrigationSystem


Data flow

TUF-2000 flow meter (one per main pipe) + pressure sensors → (RS485/Modbus RTU) → ATmega2560 control board → (SPI) → W5500 → (Ethernet) → NanoStation wireless bridge (two-device link) → Management PC (Flutter desktop app)

Image source: AI-generated


FAQ (WIZnet product-focused, 50–75 words each)

1) Why is it advantageous to use the W5500 in this project?

The W5500 provides a Hardwired TCP/IP stack and hardware sockets, so the ATmega2560 does not need to handle complex TCP/IP processing purely in software. In systems like this project—where RS485 (Modbus) polling timing and relay control timing are critical—offloading network processing to the chip simplifies delay/timeout handling in firmware. The 32 KB buffer and 8 sockets also provide headroom for request–response monitoring.

2) How do you connect the ATmega2560 and W5500, and what should you watch out for?

The connection is SPI-based, and the W5500 supports up to 80 MHz SPI. However, depending on the ATmega2560 SPI clock, signal integrity, and wiring length, you may need to lower the actual stable SPI frequency. Also, deciding how to allocate the W5500’s 32 KB buffer per socket (e.g., HTTP response size, number of concurrent connections) at design time helps keep responses consistent even when retransmissions occur over long-distance links.

3) What exactly is the role of the W5500 in this project?

Based on the README, the board “acts like a web server,” and the PC (Flutter app) sends HTTP GET requests to receive sensor data, while also issuing relay control commands when needed. The W5500 provides not only the Ethernet physical/frame handling but also TCP/IP processing, forming the foundation for HTTP request–response communication. In other words, it serves as the network gateway between “sensor data acquisition (Modbus/ADC)” and “remote control (HTTP API).”

 

Documents
Comments Write