---
title: "Smart Traffic Light : AI-Powered Intelligent Traffic Signal Control System"
url: "https://maker.wiznet.io/Hannah/projects/smart-traffic-light/"
markdown_url: "https://maker.wiznet.io/Hannah/projects/smart-traffic-light/md"
type: "UCC: User Created Content"
author: "Hoang_Long"
author_url: "https://github.com/HoangLong69/Smart-Traffic-Light"
editor: "WIZnet"
editor_url: "https://maker.wiznet.io/"
original_author: "Hoang_Long"
original_url: "https://github.com/HoangLong69/Smart-Traffic-Light"
published: "2025-11-21"
language: "en"
likes: 0
views: 409
comments: 0
source: "WIZnet Makers (https://maker.wiznet.io/)"
---

# Smart Traffic Light : AI-Powered Intelligent Traffic Signal Control System

> A smart traffic light system using Ethernet to connect PC software with the traffic light controller.

Original author: Hoang_Long (source: https://github.com/HoangLong69/Smart-Traffic-Light)

## Article

#### Project Overview

The Smart Traffic Light project combines **AI-based object detection** and **MCU-based signal control** to build an intelligent traffic system.
Two cameras monitor traffic flow, and an AI model (YOLOv5) detects vehicles in real time.
Based on the detected traffic density, the green/red duration of each signal is **automatically adjusted** to optimize traffic flow.

> Smart Traffic Light 프로젝트는 **영상 기반 차량 인식(AI)**과 **MCU 기반 신호등 제어 시스템**을 결합한 지능형 교통 관리 솔루션입니다.
> 두 대의 카메라로 교차로의 차량 수를 실시간 감지한 뒤, 각 도로의 차량 밀도에 따라 **신호등의 녹색·적색 지속시간을 자동으로 제어**합니다.
>
> 본 프로젝트는 영상 처리, 실시간 통신, 신호 제어를 통합한 구조로 구성되어 있으며,
> 저비용 하드웨어 환경에서도 **지능형 신호 제어 시스템이 가능함**을 보여주는 교육·연구용 사례입니다.

![USR-ES1 W5500 Ethernet Converter SPI to LAN TCP/IP Module - Picture 3 of 7](https://i.ebayimg.com/images/g/q~gAAOSwcxZmU-yF/s-l500.webp)

This project uses a "W5500 lite" board (also called USR-E1)

This project was developed by Group 8 from class DHDTVT17Dat **Industrial University of Ho Chi Minh City (IUH)**.

> 이 프로젝트는 **Industrial University of Ho Chi Minh City(호치민시 공업대학교) **DHDTVT17D 반 8조(Group 8) 학생들이 개발하였습니다.

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

A full demonstration video and detailed explanation of the system are available on their YouTube channel.

- **Approximately 2.8K views**

- **17 comments**

- **Solid engagement for a student-built AI/embedded systems project**

The positive feedback and steady viewership indicate that the project holds **high external value**,
with meaningful impact in the maker, education, and AI traffic control communities.

> 팀은 프로젝트 진행 과정을 직접 영상으로 제작하여 YouTube에 업로드했습니다.
>
> - **조회수: 약 2.8천 회(2,800 views)**
>
> - **댓글: 17개**
>
> - **짧은 기간 안에 높은 관심을 받은 UCC 콘텐츠**
>
> 이는 교육용/메이커 분야에서 이 프로젝트의 **외부 가치와 시장 반응이 매우 긍정적임**을 보여줍니다.
>
> 영상의 조회수뿐 아니라, 댓글에서도 시스템 완성도·활용성·구현 과정에 대한 긍정적인 반응이 이어지고 있습니다.

[Embedded media](https://www.youtube.com/embed/pHkLzqRRZPc)

#### System Architecture

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

**Data Flow**

1. Video input from 2 cameras

2. YOLOv5 vehicle/motorbike detection

3. Traffic density calculation

4. Adaptive signal timing algorithm

5. Raspberry Pi Pico controls the LED/relay traffic lights

6. PC GUI displays real-time traffic data and charts

> **전체 흐름**
>
> 1. 카메라 2대에서 영상 수집
>
> 2. YOLOv5 AI 모델로 차량/오토바이 탐지
>
> 3. 방향별 차량 수 계산
>
> 4. AI 기반 신호 시간 결정
>
> 5. MCU(라즈베리파이 피코)가 신호등 제어
>
> 6. PC GUI에서 상태 모니터링 및 그래프 표시

#### Hardware Components

![1_Top layer PCB_Altium.png](https://github.com/HoangLong69/Smart-Traffic-Light/blob/main/PCB%20Desgin-Giao%20di%E1%BB%87n%20%C4%91i%E1%BB%81u%20khi%E1%BB%83n-Ho%C3%A0n%20thi%E1%BB%87n%20m%C3%B4%20h%C3%ACnh/1_Top%20layer%20PCB_Altium.png?raw=true)

| Component | Description |
| --- | --- |
| **Raspberry Pi Pico** | Controls traffic lights & communicates via Ethernet |
| **Ethernet Module (USR-E1 / W5500)** | Stable wired communication |
| **Two Cameras** | Real-time video input |
| **PC (PyQt5 GUI)** | Visualization & manual control |
| **Traffic light module** | LED/relay output |

#### YOLOv5 Training Details

![스마트 신호등 시스템](https://github.com/HoangLong69/Smart-Traffic-Light/raw/main/Group8_trainModel/results.png)

The system relies on a YOLOv5 model trained to detect “car” and “motorbike”.

- **Model:** YOLOv5s

- **Epochs:** 50

- **Batch Size:** 16

- **Image Size:** 640×640

- **Classes:** Car, Motorbike

- **Training Setup:**
  - Intel Core i7-12700F
  - NVIDIA RTX 4060 Ti

All training scripts and the pretrained model file (.pt) are included, ensuring **high reproducibility**.

> 본 프로젝트의 핵심은 차량을 인식하는 **YOLOv5 AI 모델**입니다.
>
> - **사용 모델:** YOLOv5s
>
> - **Epoch:** 50
>
> - **Batch Size:** 16
>
> - **Input Size:** 640×640
>
> - **클래스:** Car, Motorbike
>
> - **학습 환경:**
>   - Intel Core i7-12700F
>   - NVIDIA RTX 4060 Ti
>
> 모델 파일(.pt)과 학습 코드가 모두 공개되어 있어 누구나 쉽게 **재학습 및 성능 개선**이 가능합니다.

#### Communication Structure

![4_SOFT_ver3_Control and Detection Interface.png](https://github.com/HoangLong69/Smart-Traffic-Light/blob/main/GUI%20Evolution/4_SOFT_ver3_Control%20and%20Detection%20Interface.png?raw=true)

The system uses wired Ethernet for reliable, low-latency communication.

**Flow**

- PC GUI sends control commands

- Ethernet module transmits data

- Pico receives and updates signal output

- Traffic count logs stored as CSV

Using **WIZnet **hardware further improves performance through:

- Hardware TCP/IP offloading

- Industrial-grade stability

- Lower latency

- PoE options

> Ethernet 기반으로 PC와 MCU가 연결되어 실시간으로 신호 제어 데이터를 주고받습니다.
>
> **통신 흐름**
>
> - PC GUI → 제어 명령 생성
>
> - Ethernet 전송 → Pico 수신
>
> - Pico → LED/릴레이 출력
>
> - 차량 카운트 데이터는 CSV로 저장 및 그래프 분석 가능
>
> **WIZnet **Ethernet 칩셋 적용 시:
>
> - HW TCP/IP Offload
>
> - 낮은 지연
>
> - 높은 안정성
>
> - 산업용 환경 대응
>
> - 등의 장점이 더해집니다.

#### Key Characteristics

- Full pipeline integration: **video → AI → control → visualization**

- Low-cost hardware with high functionality

- Strong documentation and organized structure

- Ideal for Maker projects, research, and education

- Highly expandable using **WIZnet Ethernet products**

> - AI 영상 분석 + MCU 신호제어 + GUI를 통합한 완성형 구조
>
> - 저비용 하드웨어 기반으로 **지능형 교통 시스템의 핵심 기능 구현**
>
> - 문서 구성 및 코드 품질이 높아 Maker 프로젝트로 적합
>
> - WIZnet Ethernet 제품과 결합 시 스마트시티 실용 솔루션으로 발전 가능

---

Source: https://maker.wiznet.io/Hannah/projects/smart-traffic-light/
