A 5V LED Traffic Light Module is a compact module with Red, Yellow, and Green LEDs arranged vertically to simulate traffic lights. It is widely used in Arduino, ESP8266/ESP32, Raspberry Pi projects, and educational demonstrations.
Key Specifications
Operating Voltage: 5V DC
LED Colors: Red, Yellow, Green
Control Pins: Usually 3 (one for each LED)
Current per LED: ~10–20mA
Dimensions: ~3–5 cm (varies by manufacturer)
Interface: Direct GPIO control via current-limiting resistors (often built-in)
Features
Plug-and-play design for NodeMCU, Arduino, or any microcontroller.
Comes with built-in resistors (check your module – if not, add 220Ω per LED).
Can simulate real traffic light sequences for IoT, robotics, or traffic control projects.
Wiring with NodeMCU (ESP8266)
Example pin mapping:
Red LED → D1 (GPIO5)
Yellow LED → D2 (GPIO4)
Green LED → D3 (GPIO0)
Sample Arduino Code for NodeMCU
#define RED D1
#define YELLOW D2
#define GREEN D3
void setup() {
pinMode(RED, OUTPUT);
pinMode(YELLOW, OUTPUT);
pinMode(GREEN, OUTPUT);
}
void loop() {
// Red Light ON
digitalWrite(RED, HIGH);
digitalWrite(YELLOW, LOW);
digitalWrite(GREEN, LOW);
delay(5000);
// Yellow Light ON
digitalWrite(RED, LOW);
digitalWrite(YELLOW, HIGH);
digitalWrite(GREEN, LOW);
delay(2000);
// Green Light ON
digitalWrite(RED, LOW);
digitalWrite(YELLOW, LOW);
digitalWrite(GREEN, HIGH);
delay(5000);
}





















