Wiznet makers

bruno

Published January 08, 2026 ©

151 UCC

14 WCC

33 VAR

0 Contests

0 Followers

0 Following

Original Link

Research and development of an automatic port entry system using AI-based image processing

AI를 이용한 영상 처리에 의한 자동 입항 시스템의 연구 개발

COMPONENTS
PROJECT DESCRIPTION

https://oacis.repo.nii.ac.jp/records/2844

1. Overview

This project demonstrates a low-cost automatic berthing (docking) system for small vessels. Instead of expensive sensors like LiDAR or RTK-GPS, this system utilizes Computer Vision (AI) as its "eyes" and an Arduino Ethernet Shield 2 (W5500) for reliable, real-time motor control.

2. Things used in this project

Hardware components

WIZnet Arduino Ethernet Shield 2 (W5500)

Arduino Mega 2560

Blue Robotics T200 Thrusters x 2

Blue Robotics Basic ESC (Electronic Speed Controller) x 2

Webcams (120° Wide-angle) x 2

Wi-Fi Router (Onboard, for LAN connectivity)

Laptop PC (For AI processing)

Li-ion Battery (12V)

Software apps and online services

YOLOv5m (Object Detection AI)

Python (OpenCV, PyTorch)

Arduino IDE (C++)

VoTT & Roboflow (Data Labeling & Augmentation)

3. Story

Background

With the increasing popularity of leisure boating, maritime accidents involving small vessels are on the rise. "Berthing" (docking) is particularly challenging due to wind and waves, often requiring skilled maneuvering. While large ships use automated systems with expensive LiDAR/GPS, small boats need a cost-effective solution. This project aims to automate this process using AI vision and Arduino control.

System Architecture

The system is divided into two main parts: Vision (PC) and Control (Arduino).

Vision: The PC processes webcam feeds to detect landmarks (colored cones) on the dock and calculates the vessel's position.

Communication: The PC sends thrust commands to the Arduino via UDP over Ethernet.

Control: The Arduino drives the thrusters based on the received commands.

Why WIZnet Ethernet Shield?

The maritime environment is unstable due to vibrations and humidity. A purely wireless connection (Wi-Fi) between the controller and the router can suffer from latency or disconnection. To ensure reliability, a wired Ethernet connection was established between the onboard router and the Arduino using the W5500 Shield. Furthermore, UDP protocol was chosen over TCP to prioritize real-time performance for instant motor response.

4. How it works

Step 1: AI Vision Strategy (YOLOv5)

To detect the target (colored cones) accurately on a moving boat, a robust AI model was required.

Model Selection (YOLOv5m): The project uses YOLOv5m (Medium).

Reason: It offers better accuracy than YOLOv5s and is faster than YOLOv5l/x. It maintained over 70% detection accuracy while running in real-time on a laptop.

Dataset & Augmentation:

Images were collected at a test pond under various weather conditions (sunny, cloudy).

Roboflow was used to augment the dataset (flip, brightness ±20%), tripling the original 200 images to 420 training images.

Overcoming Environmental Challenges:

Backlight: A white screen was placed behind the cones to prevent them from appearing as black silhouettes due to backlight.

Reflection: To prevent the AI from detecting reflections on the water surface as real objects, a software filter was implemented to ignore low-confidence duplicate detections.

Distortion: The 120° wide-angle lens distortion was corrected via calibration before processing.

Step 2: Arduino Control Logic

The PC sends the calculated thrust values (00~99) via UDP. The Arduino Mega, equipped with the Ethernet Shield 2, parses this packet and controls the ESCs using PWM signals (1100µs ~ 1900µs).

Arduino Code Snippet (Concept):

C++
#include <SPI.h>
#include <Ethernet.h>
#include <EthernetUdp.h>
#include <Servo.h> 

// MAC Address used in the thesis
byte mac[] = { 0xA8, 0x61, 0x0A, 0xAE, 0x64, 0xD4 }; 
IPAddress ip(192, 168, 1, 177);
unsigned int localPort = 8888;

EthernetUDP Udp;
Servo leftThruster;
Servo rightThruster;

void setup() {
  Ethernet.begin(mac, ip);
  Udp.begin(localPort);
  leftThruster.attach(9);
  rightThruster.attach(11);
}

void loop() {
  int packetSize = Udp.parsePacket();
  if (packetSize) {
    char packetBuffer[UDP_TX_PACKET_MAX_SIZE];
    Udp.read(packetBuffer, UDP_TX_PACKET_MAX_SIZE);
    
    // Logic: Convert "90.90" string to PWM integers
    // Map 0-99 input -> 1100-1900 PWM output
    controlThrusters(packetBuffer);
  }
}

5. Results & Conclusion

Experimental Results Field tests at the Tokyo University of Marine Science and Technology pond showed that the system could estimate the vessel's self-position with a maximum error of approximately 5.12m. This accuracy outperforms standard GPS (~10m error), proving the viability of a vision-based approach.

Conclusion This project successfully demonstrates that a low-cost combination of Arduino, WIZnet Ethernet, and AI can perform complex marine navigation tasks. The Ethernet Shield 2 played a critical role in bridging high-level AI processing with low-level hardware control, ensuring stable and real-time operation in a wet and unstable environment.

FAQ (WIZnet-Focused)

Q1. Why use W5500 for an AI-based control system instead of software TCP/IP?

W5500’s hardware TCP/IP stack eliminates the need for large software libraries like LwIP, saving roughly 30 KB of MCU RAM. This allows small Arduino boards to participate in networked AI systems without instability. Deterministic packet handling is also essential for control applications.


Q2. How does the Arduino communicate with the PC in this project?

The Arduino communicates via UDP over wired Ethernet. The W5500 handles all low-level TCP/IP processing, while the Arduino only reads UDP payloads and converts them into actuator commands. This minimizes latency and simplifies firmware design.


Q3. What specific role does W5500 play in the automatic port entry system?

W5500 acts as a real-time communication bridge between AI perception and physical actuation. It ensures that control commands generated by image processing arrive reliably and on time, even in electrically noisy or metal-dense environments similar to ports.


Q4. Is this project suitable for beginners or only advanced users?

Yes, it is suitable for motivated beginners. The complexity is well-partitioned: AI runs on a PC, while the Arduino handles simple UDP parsing and motor control. Using W5500 avoids the networking pitfalls that often frustrate beginners using Wi-Fi.


Q5. How does W5500 compare to ENC28J60 Ethernet modules?

Unlike ENC28J60, which requires a full software TCP/IP stack, W5500 includes hardware TCP/IP. This drastically reduces firmware complexity, RAM usage, and debugging effort—making W5500 far more appropriate for education and rapid prototyping.

Documents
Comments Write