

The Traffic Light is a signaling device designed to control traffic flow at intersections. It uses three colored lights—red, yellow, and green—to indicate stop, caution, and go, respectively. This component is commonly used in educational projects, prototyping, and IoT applications to simulate real-world traffic systems. The Traffic Light module is compatible with Arduino UNO (Manufacturer Part ID: UNO) and can be easily integrated into various projects.








The Traffic Light module typically consists of three LEDs (red, yellow, and green) and may include resistors for current limiting. Below are the key technical details:
The Traffic Light module typically has four pins for connection. The table below describes each pin:
| Pin Name | Description | Connection |
|---|---|---|
| GND | Ground pin | Connect to Arduino GND |
| VCC | Power supply pin (5V) | Connect to Arduino 5V |
| RED | Red LED control pin | Connect to a digital pin |
| YELLOW | Yellow LED control pin | Connect to a digital pin |
| GREEN | Green LED control pin | Connect to a digital pin |
Connect the Module to Arduino UNO:
GND pin of the Traffic Light module to the GND pin on the Arduino UNO.VCC pin of the module to the 5V pin on the Arduino UNO.RED, YELLOW, and GREEN pins to three digital pins on the Arduino UNO (e.g., pins 8, 9, and 10).Write and Upload Code:
Power the Circuit:
Below is an example code to simulate a basic traffic light sequence:
// Define pins for the Traffic Light module
const int redPin = 8; // Pin connected to the red LED
const int yellowPin = 9; // Pin connected to the yellow LED
const int greenPin = 10; // Pin connected to the green LED
void setup() {
// Set the LED pins as output
pinMode(redPin, OUTPUT);
pinMode(yellowPin, OUTPUT);
pinMode(greenPin, OUTPUT);
}
void loop() {
// Turn on the red light and wait for 5 seconds
digitalWrite(redPin, HIGH);
delay(5000); // 5000ms = 5 seconds
digitalWrite(redPin, LOW);
// Turn on the green light and wait for 5 seconds
digitalWrite(greenPin, HIGH);
delay(5000); // 5000ms = 5 seconds
digitalWrite(greenPin, LOW);
// Turn on the yellow light and wait for 2 seconds
digitalWrite(yellowPin, HIGH);
delay(2000); // 2000ms = 2 seconds
digitalWrite(yellowPin, LOW);
}
LEDs Not Lighting Up:
LEDs Flickering:
GND pin is properly connected to the Arduino's ground.One LED Not Working:
Module Overheating:
Q1: Can I use this module with a microcontroller other than Arduino UNO?
A1: Yes, the Traffic Light module can be used with other microcontrollers, provided they support 5V logic and have sufficient digital pins.
Q2: How can I modify the timing for the lights?
A2: Adjust the delay() values in the code to change the duration for each light.
Q3: Do I need external resistors for this module?
A3: Some modules include built-in resistors. If not, you must add resistors (e.g., 220Ω) to each LED to prevent damage.
Q4: Can I control the Traffic Light module using PWM?
A4: While PWM can be used to dim the LEDs, it is not typically necessary for standard traffic light simulations.
This documentation provides all the necessary details to get started with the Traffic Light module and Arduino UNO. Happy prototyping!