Summary
This guide shows how to make colour-changing festive lights with an Arduino Uno, a WS2812 12-LED ring or 16-LED matrix, and 5V power. It covers parts, how addressable LEDs work, wiring, code for five patterns, kid-safety tips, and ideas for diyas, stars, and window displays.
You can make colour-changing festive lights at home with an Arduino, an addressable LED ring, and a 5V power supply. The project runs at low voltage, so it is safe for kids with adult help, and takes about an hour. This guide covers parts, wiring, ready-to-use light patterns, and how to make it run from a power bank.
|
Parts used in this guide
Also handy: a USB cable, one 330Ω resistor (from our resistor kit) and one 1000µF capacitor. |

These DIY LED lights with Arduino twinkle like Christmas lights, flicker like a diya, and switch patterns on their own. It makes a good first Arduino project.
What you need
We use two setups: setup A is one ring on USB power, and it is the one we recommend for kids. Setup B chains the ring and the 16-LED matrix, which need more power than USB gives.
|
Part |
What it does |
Setup A (one ring) |
Setup B (ring + matrix) |
|
Arduino Uno R3 compatible |
Runs the code |
Yes |
Yes |
|
WS2812 12-bit LED ring |
12 lights in a circle |
Yes |
Yes |
|
WS2812 16-bit LED matrix |
16 lights in a 4x4 grid |
No |
Yes |
|
Jumper wires |
Connect everything |
3 wires |
7 wires |
|
5V 2A adapter or 5V 5A SMPS |
Powers the LEDs |
No |
Yes |
Setup A needs only three parts: the Uno, one ring, and jumper wires.
For more colours, browse our LEDs collection.
|
Arduino Uno R3 Board (compatible) Runs all five light patterns |
Our main light: 12 colour LEDs |
Jumper Wire Set (M2M, M2F, F2F) Plug-in wires, no breadboard needed |
Components and Supplies
How addressable LEDs work
A normal RGB LED needs three Arduino pins for one colour. A WS2812 LED has a tiny controller chip inside every LED. The Arduino sends a string of colours down one data wire. The first LED keeps the first colour (24 bits of red, green, and blue) and passes the rest along. The next LED does the same.
So one pin controls 12, 16, or hundreds of LEDs, each in its own colour. A WS2812B LED strip with Arduino works the same way, so this code runs on a strip too.

Each LED can draw up to 60 mA at full white, so we cap brightness in the code:
|
Build |
LEDs |
Full white (max) |
At brightness 60 |
Power it from |
|
12-bit ring |
12 |
about 0.7 A |
about 0.2 A |
USB or power bank |
|
16-bit matrix |
16 |
about 1 A |
about 0.25 A |
USB or power bank |
|
Ring + matrix (Setup B) |
28 |
about 1.7 A |
about 0.4 A |
5V 2A adapter |
Wiring diagram

Red is 5V, black is GND and green is data. Always use the DIN (data in) pad, not DOUT.
Setup A: one ring on USB
-
Connect the ring's 5V pad to the Uno's 5V pin (red wire).
-
Connect the ring's GND pad to a GND pin on the Uno (black wire).
-
Connect the ring's DIN pad to pin D6 through the 330Ω resistor (green wire).
-
Plug the Uno into USB.
Setup B: ring and matrix on a 5V adapter
Chain the matrix after the ring: run the ring's DOUT to the matrix DIN, and join their 5V and GND pads. Connect the 5V adapter's 5V and GND to the ring, join the Uno's GND to the ring's GND, and run D6 to the ring's DIN through the resistor. The Uno stays on USB. Never connect the adapter's 5V to the Uno's 5V pin. A 1000µF capacitor across 5V and GND at the ring smooths the power. For a longer display, see our SMPS range.
Running it from a power bank
Plug the Uno into a power bank and keep brightness at 60. A 10,000 mAh power bank lights the 12-LED ring for roughly 20 hours, enough for Christmas Eve and New Year's Eve.
Code: 5 ready light patterns
-
Install the Arduino IDE and open Tools > Manage Libraries.
-
Search for FastLED and click Install.
-
Paste the code below, choose Arduino Uno as the board and pick your port.
-
Click Upload. The pattern changes every 15 seconds.
#include
#define DATA_PIN 6
#define NUM_LEDS 12 // 16 for the matrix, 28 for ring + matrix
#define BRIGHTNESS 60 // keep at 60 or lower on USB power
CRGB leds[NUM_LEDS];
uint8_t pattern = 0;
uint8_t hue = 0;
void setup() {
FastLED.addLeds(leds, NUM_LEDS);
FastLED.setBrightness(BRIGHTNESS);
FastLED.setMaxPowerInVoltsAndMilliamps(5, 400); // safety cap for USB
}
void loop() {
EVERY_N_SECONDS(15) { pattern = (pattern + 1) % 5; }
switch (pattern) {
case 0: rainbow(); break;
case 1: christmasTwinkle(); break;
case 2: diyaFlicker(); break;
case 3: goldChase(); break;
case 4: newYearSparkle(); break;
}
FastLED.show();
delay(20);
}
void rainbow() {
fill_rainbow(leds, NUM_LEDS, hue++, 255 / NUM_LEDS);
}
void christmasTwinkle() {
fadeToBlackBy(leds, NUM_LEDS, 20);
if (random8() < 80) {
leds[random16(NUM_LEDS)] = random8(2) ? CRGB::Red : CRGB::Green;
}
}
void diyaFlicker() {
for (int i = 0; i < NUM_LEDS; i++) {
if (random8() < 40) leds[i] = CHSV(random8(18, 32), 255, random8(140, 255));
}
}
void goldChase() {
static uint8_t pos = 0;
EVERY_N_MILLISECONDS(120) { pos = (pos + 1) % 3; }
for (int i = 0; i < NUM_LEDS; i++) {
leds[i] = ((i + pos) % 3 == 0) ? CRGB::Gold : CRGB::Black;
}
}
void newYearSparkle() {
fadeToBlackBy(leds, NUM_LEDS, 40);
if (random8() < 40) leds[random16(NUM_LEDS)] = CRGB::White;
if (random8() < 20) leds[random16(NUM_LEDS)] = CHSV(random8(), 200, 255);
}
|
Pattern |
What it looks like |
Best for |
|
Rainbow |
Colours rolling around |
Christmas tree |
|
Christmas twinkle |
Red and green sparkles |
Christmas lights with Arduino |
|
Diya flicker |
Warm oil-lamp glow |
Diwali, lanterns |
|
Gold chase |
Running marquee lights |
Doorway, party table |
|
New Year sparkle |
White and colour flashes |
Midnight countdown |
The code is set for the 12-LED ring. For the 16-LED matrix, set NUM_LEDS to 16. For Setup B (ring and matrix chained), set it to 28 and raise the 400 in the power line to 1500. If no port shows up, install the CH340 USB driver.
Kid-safe tips (low voltage, no mains)
|
SAFETY FIRST: never connect to mains. Never connect the Arduino, the LEDs or any wire to a wall socket or 230V mains wiring. Only the plug-in adapter goes into the wall, and an adult plugs it in. The 5V 5A SMPS has open mains screw terminals: adults only, inside a closed box. |
-
Everything the kids touch runs on 5V, the same as a phone charger.
-
An adult does the soldering.
-
Unplug the USB cable before changing any wire.
-
Keep brightness at 60 or lower. It is easier on the eyes.
-
Tape over bare solder joints and keep the build away from water.
-
Keep loose parts away from children under five.
Ideas: diya lights, star, window display
|
Idea |
Parts |
Pattern |
How we built it |
|
Diwali lights DIY: electric diya |
12-bit ring |
Diya flicker |
Set the ring inside a clay diya or paper lantern. |
|
Christmas star |
12-bit ring |
Christmas twinkle or rainbow |
Fix the ring behind a cardboard star with a tracing-paper centre. |
|
Window display |
16-bit matrix |
New Year sparkle |
Tape the matrix behind tracing paper on a window. |



Need an LED light for a science project? Start with the 12-LED ring on its own. It runs from a laptop's USB port, and the rainbow pattern shows how red, green and blue mix into every colour. For a New Year countdown, add a display with our guide to interfacing a 16x2 LCD with Arduino.
Build it: everything for your festive LED lights
|
Arduino Uno R3 Board (compatible) Runs all five light patterns |
Our main light: 12 colour LEDs |
Jumper Wire Set (M2M, M2F, F2F) Plug-in wires, no breadboard needed |
Plug-in power for Setup B |
|
4x4 panel for a star or window display |
Power for longer runs (adult setup only) |
1000µF 25V Electrolytic Capacitor Smooths the power at the LEDs |
Looking for your next build? Try our 20 Arduino projects for beginners.













