Case Study Functional Testing Traffic Light
Case Study Functional Testing Traffic Light
IoT
Using Arduino IDE, Arduino Uno, and
Traffic Light Controller
Objective
• To implement and functionally test a traffic
light controller using Arduino Uno, simulating
standard traffic signal behavior through
sequential LED control.
Components Used
• • Arduino Uno
• • Red, Yellow, and Green LEDs
• • 220-ohm resistors (3x)
• • Breadboard and jumper wires
• • Arduino IDE
Setup & Circuit
• • Connect each LED to a digital pin (e.g., Red -
8, Yellow - 9, Green - 10) via 220Ω resistors.
• • Connect cathodes of all LEDs to GND.
• • Upload the control logic using Arduino IDE.
Arduino Code
• void setup() {
• pinMode(8, OUTPUT); // Red
• pinMode(9, OUTPUT); // Yellow
• pinMode(10, OUTPUT); // Green
• }
• void loop() {
• digitalWrite(10, HIGH); // Green ON
• delay(5000);
• digitalWrite(10, LOW);
Functional Testing Steps
• 1. Upload the traffic light control code using
Arduino IDE.
• 2. Observe LED sequence: Green → Yellow →
Red.
• 3. Validate the time intervals (Green - 5s,
Yellow - 2s, Red - 5s).
• 4. Ensure smooth transitions with no
flickering.
• 5. Check correct pin connections for each LED.
Test Results
• • Green LED: Lights for 5s — PASS ✅
• • Yellow LED: Lights for 2s — PASS ✅
• • Red LED: Lights for 5s — PASS ✅
• • Sequence Repeats Properly — PASS ✅
• • No flicker or glitches — PASS ✅
Conclusion
• • Functional testing verified accurate traffic
light sequencing.
• • Demonstrated real-time control and timing
logic with Arduino Uno.
• • A reliable and simple IoT simulation for
urban infrastructure use.