Remote-controlled RGB mood light
Warm, cool, rainbow or breathing: cycle lighting moods from your sofa.
Shop by category
Shop all componentsFast, repeated flashes are just a short on-off pattern run several times. A for loop repeats the 150 ms flash three times for the red LED on D8, then three times for the blue LED on D9, and loop() starts over. Change the count or the timing to make your own pattern.
Every part for this build comes in the Geekobot Spark Kit box, a Geekobot exclusive, together with the parts for all 24 projects, from a first blinking LED to a smart fan and a reaction game. The wiring below is the kit's own wiring.
Tick anything you already have and the total updates.
The brain of every Spark Kit project
Sensor Shield v5.0 from the kit: every pin has its own G, V, S header, so modules plug in with female jumpers
Follow the colours: red is power, dark grey is ground, blue is a signal.
spark_kit_06_police_light_effect.inoVerify & upload in Electrolark// Spark Kit 06: police light effect
int redLED = 8;
int blueLED = 9;
void flash(int pin, int times) {
for (int i = 0; i < times; i++) {
digitalWrite(pin, HIGH);
delay(150);
digitalWrite(pin, LOW);
delay(150);
}
}
void setup() {
pinMode(redLED, OUTPUT);
pinMode(blueLED, OUTPUT);
}
void loop() {
flash(redLED, 3);
flash(blueLED, 3);
}
Use the kit's USB cable (some phone cables carry power only), install the CH340 driver on Windows if the port does not appear, and pick Tools > Board > Arduino Uno.
Normal: blue LEDs need about 3 V. Use a 220 ohm resistor for the blue one if you want them closer.
Check the other LED's direction and its wire to D8 or D9.
Lower both delay(150) values, for example to 80.
Yes: add the passive buzzer from project 08 on D11 and play two alternating tones while the LEDs flash.
Yes. It is one of the 24 projects in the Geekobot Spark Kit, and every part on the list comes in the kit box. You can also buy the parts one by one from the list above.
No. Every Spark Kit project is wired on the breadboard or the Sensor Shield with jumper wires.
7 parts: Uno R3 CH340G ATmega328p Compatible Development Board, Arduino USB-A to USB-B Data Cable for UNO/MEGA, 2 × Through-Hole LED Pack (Pack of 10), Carbon Film Resistor 1/4W 5% (Pack of 10), Solderless Breadboard, Dupont Jumper Wires (40 pcs) and Arduino Sensor Shield V5 Expansion Board. 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 20 minutes. The build on this page has 5 steps.
No. This page has the complete, tested code (spark_kit_06_police_light_effect.ino).
About ₹442 for the parts at the prices on this page. Quantity price breaks lower the cost when you build several.
Digital outputs; for loops; Fast timing for visual effects.
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.