Chained NeoPixel Rings with Arduino UNO – WS2812B Animation
Control three daisy-chained WS2812B RGB LED rings with a single Arduino digital pin. Build stunning animations, rainbow effects and chasing patterns across all 36 LEDs simultaneously.
🗓 Updated: April 2026⏱ Build time: ~25 min⚡ Difficulty: Beginner💡 36 LEDs · 1 data pin
1 Project Overview
This project chains three 12-LED WS2812B NeoPixel rings into one continuous 36-LED strip, all controlled from Digital Pin 6 on an Arduino UNO. Each LED has a built-in driver chip — it reads its colour data, then passes the remaining data to the next LED in the chain at 800 KHz.
The result: one Arduino pin controls 36 individually addressable, full-colour RGB LEDs. Perfect for ambient lighting, wearables, music visualisers, robotics indicators, and STEM demonstrations.
Ring 1 · LEDs 0–11
→
Ring 2 · LEDs 12–23
→
Ring 3 · LEDs 24–35
▲ Live animation preview — watch the chasing effect across all 3 rings
2 Components Required
🔵
Arduino UNO
× 1
💚
NeoPixel Ring 12
× 3 rings
WS2812B, 12 LED each
🔌
USB Cable
× 1 (Type-B)
🟡
Jumper Wires
× 10–14
⬜
Breadboard
× 1
⚡
330Ω Resistor
× 1 (data line)
Optional but recommended
🔋
100–1000µF Cap
× 1 (power)
Optional, protects LEDs
⚡ Power Consumption Warning
Each WS2812B LED draws up to 60mA at full white. All 36 LEDs at full brightness = up to 2.16A. The Arduino 5V pin can supply ~500mA max. For full-brightness effects, use an external 5V 3A power supply connected directly to the NeoPixel rings' VCC/GND, with common GND to Arduino.
WS2812B LEDs communicate over a single-wire serial protocol. The key to chaining is that each LED consumes the first colour packet in the data stream, then forwards all remaining data downstream to the next LED at the same 800 KHz speed.
🔵
Arduino UNO
Pin 6 (DIN)
DATA
→
💚
Ring 1
LEDs 0–11 · DIN→DOUT
DOUT→DIN
→
💚
Ring 2
LEDs 12–23 · DIN→DOUT
DOUT→DIN
→
💚
Ring 3
LEDs 24–35 · DIN
🔑 Key Principle
All three rings share the same VCC (5V) and GND rails. Only the DATA wire is daisy-chained: Ring 1's DOUT connects to Ring 2's DIN, and Ring 2's DOUT connects to Ring 3's DIN. From the Arduino's perspective, it's talking to one 36-LED strip.
4 Circuit & Wiring Diagram
Fig 1 — Arduino Pin 6 → 330Ω → Ring 1 DIN → Ring 1 DOUT → Ring 2 DIN → Ring 2 DOUT → Ring 3 DIN. All rings share 5V and GND.
Pin Connection Reference
Connection
From
To
Colour
Data signal
Arduino Pin 6
330Ω → Ring 1 DIN
🟡 Yellow
Power (all rings)
Arduino 5V
Ring 1, 2, 3 VCC
🟢 Green
Ground (all rings)
Arduino GND
Ring 1, 2, 3 GND
⚫ Black
Chain: Ring 1 → Ring 2
Ring 1 DOUT
Ring 2 DIN
🟡 Yellow
Chain: Ring 2 → Ring 3
Ring 2 DOUT
Ring 3 DIN
🟡 Yellow
6 Step-by-Step Instructions
1
Install the Adafruit NeoPixel Library
Open Arduino IDE → Sketch → Include Library → Manage Libraries. Search "Adafruit NeoPixel" and click Install. No other libraries are needed.
Use Arduino IDE 2.x for a faster library search experience via the left panel.
2
Connect Power to All Three Rings
Wire every ring's VCC pin → Arduino 5V and every ring's GND pin → Arduino GND. You can share these on a breadboard power rail. All three rings need independent power connections — don't daisy-chain power.
For low-brightness code testing only. At full brightness, use an external 5V 3A supply connected directly to all ring VCC/GND pins, with GND also connected to Arduino GND.
3
Connect the Data Line
Place a 330Ω resistor in series on the data line. Then wire: Arduino Pin 6 → 330Ω resistor → Ring 1 DIN. This resistor protects against ringing and signal noise on long lines.
Place the resistor as close to Ring 1's DIN pin as possible, not next to the Arduino.
4
Daisy-Chain the Data Between Rings
Connect: Ring 1 DOUT → Ring 2 DIN, then Ring 2 DOUT → Ring 3 DIN. Ring 3 has no DOUT connection needed. The data flows sequentially through all 36 LEDs.
Ring 1 DIN ← Arduino Pin 6 (via 330Ω)
Ring 1 DOUT → Ring 2 DIN
Ring 2 DOUT → Ring 3 DIN
5
Configure the Code Constants
In the code, ensure these values match your hardware:
#define PIN 6 // Your data pin
#define NUMPIXELS 36 // 3 rings × 12 LEDs each
If you use different ring sizes (e.g. 16-LED rings), update NUMPIXELS accordingly: 3 × 16 = 48.
6
Upload and Test
Upload the code from Section 7. You should see a green chasing animation light up LED-by-LED across all three rings, then all LEDs switch off for 1 second before repeating.
Expected: LEDs 0→35 light green one by one (100ms each)
Then: 1 second pause → loop restarts
7
Customise Your Animation
Change pixels.Color(0, 255, 0) to any RGB value. Uncomment pixels.clear(); inside the loop for a single-chase trail. See Section 8 for animation ideas with sample colour values.
Try pixels.Color(255, 0, 0) for red, pixels.Color(0, 0, 255) for blue, or pixels.Color(255, 100, 0) for warm amber.
8
Simulate Online (No Hardware)
Go to Wokwi.com → New Arduino UNO project → paste diagram.json into the diagram tab and the code into sketch.ino → press ▶ Play. The NeoPixel rings animate live in the browser.
7 Full Arduino Code
chained_neopixel_rings.ino
#include <Adafruit_NeoPixel.h>
// ── Configuration ──────────────────────────────────────────#define PIN 6// Data pin (connect via 330Ω resistor)#define NUMPIXELS 36// 3 rings × 12 LEDs each// NEO_GRB = WS2812B colour order | NEO_KHZ800 = 800 KHz protocol
Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
voidsetup() {
pixels.begin(); // Initialise NeoPixel strip
pixels.clear(); // Turn all LEDs off
pixels.show(); // Push the clear state to all LEDs
pixels.setBrightness(80); // 0-255 · keep low for USB power!
}
voidloop() {
// ── Chasing green animation ──────────────────────────────for (int i = 0; i < NUMPIXELS; i++) {
// Uncomment the line below for a single-LED chase trail:// pixels.clear();
pixels.setPixelColor(i, pixels.Color(0, 255, 0)); // Green
pixels.show();
delay(100);
}
// ── All off, then 1-second pause before restart ───────────
pixels.clear();
pixels.show();
delay(1000);
}
📝 About setBrightness()
Setting brightness to 80 (≈31%) keeps power consumption safe for USB-powered builds. At this level all 36 LEDs draw about 650mA — within the Arduino 5V pin limit. Remove setBrightness() only when using an external power supply.
8 Animation Ideas & Code Snippets
🌈
Rainbow Cycle
Use pixels.ColorHSV(hue, 255, 200) in a loop. Increment hue by 65536/NUMPIXELS per LED for even spacing.
☄️
Comet Trail
Light current LED bright, then dim the previous 4–5 LEDs using decreasing brightness values to simulate a trailing comet.
💫
Twinkle/Sparkle
Set random LEDs to white at random intervals using random(NUMPIXELS) then fade them out. Beautiful ambient effect.
🔴🟢🔵
Ring-by-Ring Color
Fill LEDs 0–11 red, 12–23 green, 24–35 blue using three separate setPixelColor() loops. Cycle through hues each iteration.
🌊
Breathing Pulse
Use setBrightness() in a sine wave pattern. Fade all LEDs in and out together for a calm breathing light effect.
🎵
Music Reactive
Read analog audio from a microphone module on A0. Map the signal amplitude to the number of lit LEDs across the chain.
9 Simulation Links
Test the full chained NeoPixel animation in your browser — no hardware, no soldering required.
🚀 Quick Start on Wokwi
1. Go to wokwi.com → Start New Project → Arduino UNO. 2. Click diagram.json tab → paste JSON from Section 5. 3. Click sketch.ino tab → paste code from Section 7. 4. Press ▶ Play — watch the green chase animation across all 3 rings instantly!
10 Key Features
🎯
Single Pin ControlAll 36 LEDs controlled from one Arduino digital pin
🎨
16M ColoursFull 24-bit RGB colour per LED — 16,777,216 combinations
🔗
Expandable ChainAdd more rings — just update NUMPIXELS
⚡
800 KHz ProtocolWS2812B operates at 800 KHz for smooth, lag-free animation
🔆
Software BrightnesssetBrightness() dims all LEDs without changing colour values
📦
Minimal WiringOnly 5 connection types needed for the full 3-ring system
🎓
Beginner FriendlyAdafruit library handles all low-level timing complexity
🛠️
Highly ModifiableEasily create any animation with just a few lines of code
Comments
Post a Comment