How salamzantout/smart-traffic-light works
Project type and purpose
• This is an IoT-enabled Smart Traffic Light System prototype.
• It uses Arduino Uno boards to sense real-world traffic via distance/vehicle-counting sensors, processes that data, and adjusts traffic light behavior dynamically. There’s also a simple web component (FinalIndex.php) for data display or control.
File structure
Top-level artifacts:
• Final Report & Presentation PDFs (documentation)
• README.md (project overview)
• Raw Data/ (experimental & real street datasets)
• Software Code/ (all Arduino sketches and a PHP endpoint)
Under Software Code/:
• CarCountingSensor/CarCountingSensor.ino – counts vehicles
• IncDec/IncDec.pde – incremental/decremental logic (traffic density algorithm)
• InternetConnection/InternetConnection.ino – handles Wi-Fi or serial link to server
• RecFromArd/RecFromArd.pde + data/ – receives and logs data on a host device
• FinalIndex.php – simple web interface for viewing or controlling the system
Extract insights from the README
• Purpose: Replace fixed traffic-light cycles with data-driven cycles.
• Hardware: Arduino Uno chosen for sufficiency and simplicity.
• Future: Inter-light communication and V2X (vehicle-to-everything).
Main components & their interactions
a. Edge Sensing Layer (Hardware)
• Ultrasonic/vehicle-counting sensor + Arduino Uno (CarCountingSensor)
• Additional Arduino boards for Inc/Dec logic and Internet connectivity
b. Communication Layer
• Arduino → HTTP POST or serial over InternetConnection.ino
• RecFromArd sketch on a gateway device or PC that aggregates incoming data
c. Data Persistence & Processing
• Raw Data files stored locally (Excel, TXT) or in a simple database (optional)
• IncDec logic applies thresholds or statistical models to decide light phases
d. Presentation Layer
• FinalIndex.php: Web interface showing real-time or historical traffic metrics
e. System Documentation
• PDFs (report + presentation) and demo video for stakeholders
Key architectural patterns & design principles
• Edge-cloud split: sensing and pre-processing on Arduino (edge), storage/visualization on server (cloud).
• Modular firmware: separate sketches for counting, communication, and control logic.
• Data-driven control loop: measurement → analysis (IncDec) → actuation (traffic light).
Technologies & frameworks
• Arduino IDE (C/C++ sketches: .ino, .pde)
• PHP (web endpoint)
• HTTP or serial protocols for IoT messaging
• Excel/TXT for offline data analysis