UNIVERSITY OF WEST ATTICA
SCHOOL OF ENGINEERING
DEPARTMENT OF COMPUTER ENGINEERING AND INFORMATICS
University of West Attica · Department of Computer Engineering and Informatics
Internet of Things
Vasileios Evangelos Athanasiou
Student ID: 19390005
Angelos Vasileios Mantzoukas
Student ID: 19390128
Christos Pylarinos
Student ID: 20390278
Supervision
Supervisor: Panagiotis Karkazis, Associate Professor
Co-supervisor: Rania Garofalaki, Laboratory Teaching Staff
Athens, January 2025
This project focuses on the development of an automated traffic light system using an Arduino UNO, integrated with the ThingSpeak IoT platform for real-time monitoring and remote control. The system simulates a classic traffic light sequence and transmits its operational state to the cloud via an ESP-01 (ESP8266) WiFi module.
| Section | Folder | Description |
|---|---|---|
| 1 | assign/ |
Assignment material for the Traffic Lights project |
| 1.1 | assign/Final-Project.pdf |
Final project description in English |
| 1.2 | assign/Τελικη-Εργασία.pdf |
Τελική εργασία (Greek) |
| 2 | docs/ |
Project documentation and theoretical background |
| 2.1 | docs/Electrical-Signal-Light.pdf |
Electrical traffic light theory (EN) |
| 2.2 | docs/Ηλεκτρικός-Φωτεινός-Σηματοδότης.pdf |
Θεωρία ηλεκτρικού φωτεινού σηματοδότη (EL) |
| 3 | src/ |
Arduino source code and execution outputs |
| 3.1 | src/A4/A4.ino |
Arduino implementation – Scenario A4 |
| 3.2 | src/B/B.ino |
Arduino implementation – Scenario B |
| 3.3 | src/C1/C1.ino |
Arduino implementation – Scenario C1 |
| 3.4 | src/C2/C2.ino |
Arduino implementation – Scenario C2 |
| 3.5 | src/Output/A4.txt |
Execution output for scenario A4 |
| 3.6 | src/Output/B.txt |
Execution output for scenario B |
| 3.7 | src/Output/C1.txt |
Execution output for scenario C1 |
| 3.8 | src/Output/C2.txt |
Execution output for scenario C2 |
| 4 | README.md |
Repository overview |
| 5 | INSTALL.md |
Usage instructions |
-
Classic Traffic Light Sequence:
Automatically cycles through:- Red: 30 seconds
- Green: 30 seconds
- Orange: 20 seconds
-
Real-Time Monitoring:
Live visualization of traffic light status through the ThingSpeak platform. -
Bi-directional Communication:
- Data Upload: Sends numeric status values to the cloud:
1→ Red2→ Orange3→ Green
- Remote Control: Reads values from Field 8 of the ThingSpeak channel to switch between normal operation and standby mode.
- Data Upload: Sends numeric status values to the cloud:
-
Hardware Protection:
Uses a voltage divider to safely step down Arduino 5V signals to 3.3V for the ESP-01 module.
- Microcontroller: Arduino UNO
- WiFi Connectivity: ESP-01 (ESP8266) module
- Circuitry: Breadboard, jumper wires
- Passive Components: Resistors (used for voltage division)
The Arduino is programmed in C/C++ to control both the traffic light logic and network communication.
- Timing Control:
Uses thedelay()function to define each light phase. - Network Communication:
Sends AT commands to the ESP-01 to:- Connect to WiFi
- Open TCP connections
- Transmit HTTP requests to ThingSpeak
A dedicated ThingSpeak channel (ID: 2749755) is used for data visualization and control.
- Field 1: Red signal status
- Field 2: Orange signal status
- Field 3: Green signal status
- Field 8: Alert signal / remote control switch
The system periodically retrieves data from ThingSpeak in JSON format to determine operating mode:
- Value
0:
Normal traffic light sequence (Red → Green → Orange) - Value
1:
Standby / out-of-service mode (Orange light only)
This allows remote intervention without physical access to the system.
- Connect the Arduino UNO to the ESP-01 module.
- Ensure:
- Arduino TX → ESP-01 RX through a voltage divider (5V → 3.3V)
- Proper common ground (GND)
- Configure WiFi credentials in the Arduino code using:
AT+CWJAP="SSID","PASSWORD"- Insert the following into the code:
- Write API Key: For uploading traffic light status
- Read API Key: For reading control commands from Field 8
This project demonstrates a practical IoT-based traffic control system, combining embedded programming, wireless communication.

