Wiznet makers

mason

Published December 03, 2025 © MIT license (MIT)

120 UCC

21 WCC

32 VAR

0 Contests

0 Followers

0 Following

Original Link

stm32f103_w5500

Smart Traffic Edge Node with STM32F103 & W5500

COMPONENTS Hardware components

STMicroelectronics - STM32F103RCT6

x 1


WIZnet - W5500

x 1


PROJECT DESCRIPTION

Project Goal – Edge Computing for Smart Traffic

Real-time traffic monitoring and control
Quickly collect data from traffic lights, intersections, and crosswalks, and perform control actions locally at the edge.

Minimizing latency through local processing
Instead of sending all data to the cloud, the edge MCU makes the first decision and forwards only the necessary information to the upper-level system.

Seamless integration with smart city infrastructure
Using micro-ROS, the node can easily integrate with ROS 2–based central traffic management systems and cloud analytics platforms.

Original link: https://github.com/narudoltatiyavattanachai/stm32f103_w5500


Hardware Configuration – STM32F103C8T6 + W5500 Ethernet

This project uses the following hardware combination:

MCU

STM32F103C8T6 (72 MHz, Cortex-M3)

Network

WIZnet W5500 Ethernet controller:
Built-in hardware TCP/IP stack to offload networking from the MCU

Other Characteristics

I/O layout designed with external sensors in mind
(vehicle detection, pedestrian detection, etc.)

Demo_Board.png

Image source : https://github.com/narudoltatiyavattanachai/stm32f103_w5500


Software Stack – FreeRTOS + micro-ROS + W5500

FreeRTOS

Task-based real-time operation

Separate tasks for sensor reading, communication, and control logic

micro-ROS

Framework that lets resource-constrained MCUs participate in a ROS 2 environment

Communicates with the ROS 2 agent through a custom W5500 transport layer

Network Stack

Supports both static IP and DHCP

Communication over TCP/UDP protocols

Designed with secure communication channels in mind
(can be extended with TLS in the future)

Safety Features

Watchdog

Fail-safe mechanisms aimed at automatic recovery from abnormal states


System Architecture – Role Split Between Central Control and Edge Nodes

Central traffic management system → Edge router → Local network → Smart traffic node

Central Traffic Management (Cloud / Server)

Collects and analyzes traffic data from the entire city

Sends high-level policy and strategy commands

Edge Router & Local Network

Network that connects multiple edge nodes installed at sites such as intersections and road segments

Smart Traffic Node (this project)

Collects sensor inputs (vehicles, pedestrians, etc.)

Performs local decision-making on STM32F103 + FreeRTOS + micro-ROS

Exchanges ROS 2 messages with the central system via the W5500 Ethernet interface

This architecture fits well with smart city designs that treat the cloud as the “brain” and the edge as the “reflex” system.


Project Structure – STM32Cube-Based Design

The GitHub repository follows the STM32CubeIDE project structure,
so you can import it directly into the IDE and build it without additional setup.

Image source : https://github.com/micro-ROS/micro_ros_stm32cubemx_utils


micro-ROS & ROS 2 Integration

The most notable feature of this project is that it communicates directly with a ROS 2 environment via micro-ROS.

Prepare a ROS 2 Environment on the Host PC

Install Ubuntu + ROS 2 (Humble, Foxy, etc.)

Example: Running the micro-ROS Agent

 
ros2 run micro_ros_agent micro_ros_agent udp4 --port 8888

STM32 Edge Node Operation

When the board boots, it automatically connects to the micro-ROS agent using the configured IP and port.

After that, it can integrate with the ROS 2 ecosystem through topic publish/subscribe, service calls, and more.

Through this, the node can:

Publish sensor data (traffic volume, pedestrian detection, event information) to ROS 2 topics

Receive traffic signal control commands from the central system


Why Use ROS 2 for a Smart Traffic System?

Treating the Smart Traffic Infrastructure as One ROS System

Both the central server (cloud) and intersection edge nodes are treated as ROS 2 nodes,
making it easy to connect them via topics and services.

Easy Implementation of Real-Time and Reliable Communication

DDS-based QoS settings (reliability, latency, history, etc.)
allow safety-critical messages and logging data to be transmitted according to their requirements.

Bringing MCUs into the ROS 2 Network

With micro-ROS + FreeRTOS, small MCUs like the STM32F103 can participate directly in the ROS 2 graph.

Leveraging ROS 2 Scalability and Ecosystem

Can fully use ros2 tools, simulations, data logging, and integration with other robots
or autonomous driving systems without reinventing the wheel.

 

Documents
  • Github Code

Comments Write