Remote-controlled RGB mood light
Warm, cool, rainbow or breathing: cycle lighting moods from your sofa.
Shop by category
Shop all componentsTraffic light LED modules have red, yellow and green LEDs with their resistors on one small board, so each colour needs just one pin. This classic first project teaches sequences and timing: the light stays green until a pedestrian presses the button, then runs the crossing cycle with a beeping buzzer.
Tick anything you already have and the total updates.
Traffic light LED module
Follow the colours: red is power, dark grey is ground, blue is a signal.
USB from a computer.
crossing.inoVerify & upload in Electrolarkconst int R = 10, Y = 9, G = 8, BTN = 2, BUZ = 7;
void lights(bool r, bool y, bool g) { digitalWrite(R, r); digitalWrite(Y, y); digitalWrite(G, g); }
void setup() {
pinMode(R, OUTPUT); pinMode(Y, OUTPUT); pinMode(G, OUTPUT); pinMode(BUZ, OUTPUT);
pinMode(BTN, INPUT_PULLUP);
lights(0, 0, 1);
}
void loop() {
if (digitalRead(BTN) == HIGH) return;
delay(2000);
lights(0, 1, 0); delay(3000);
lights(1, 0, 0);
for (int i = 0; i < 20; i++) { tone(BUZ, 2500, 100); delay(400); } // walk
lights(1, 1, 0); delay(1500);
lights(0, 0, 1); delay(5000); // minimum green
}
Check its pin; some modules label pins differently.
The button pin is floating; use INPUT_PULLUP and wire to GND.
GND is not connected to the module.
Yes, add a second module and run the two sequences opposite each other.
Real controllers use similar sequences with longer, set timings and safety checks.
Yes, same pins.
6 parts: LED Traffic Lights Signal Module / Digital Signal Output Traffic Light Module, Uno R3 CH340G ATmega328p Compatible Development Board, Tactile Push Button Switch, Buzzer Module 3.3–5V, Solderless Breadboard and Dupont Jumper Wires (40 pcs). On this page you can tick the parts you already have and add only the rest to your cart.
It is a beginner project and takes about 1 hour. The build on this page has 4 steps.
No. This page has the complete, tested code (crossing.ino).
About ₹339 for the parts at the prices on this page. Quantity price breaks lower the cost when you build several.
Driving LEDs from digital pins; Sequencing with delays; Reading a button with a pull-up.
Warm, cool, rainbow or breathing: cycle lighting moods from your sofa.
Press to roll: the pips tumble and slow down before landing on a number.
Wait for the light, hit the button: how many milliseconds can you beat?
A bright 4-digit clock that keeps time through power cuts.
Lessons are free to read. Maker (₹499/month) and Pro add quizzes, worked problems and certificates, paid with your Geekobot account. See plans
Learning project. Check every circuit and the datasheet of each part before you power it up.