Arduino UNO
NeoPixel Ring
Light Show
Daisy-chain multiple WS2812B NeoPixel rings with Arduino UNO for programmable rainbow cycles, breathing effects, and dynamic lighting animations — all through a single data wire.
Project Overview
Arduino Uno drives up to 6 daisy-chained NeoPixel rings (72 LEDs total) through a single digital data pin. Each LED is individually addressable, creating stunning animations with minimal wiring — just one data line for the entire chain.
Components Required
Available from Amazon, Robu.in, or AliExpress. Estimated total: ₹500–700 / $7–10 USD for a full 6-ring setup.
Circuit Diagram
Arduino Pin 6 connects through a 330Ω resistor to the DIN of Ring #1. Each ring's DOUT connects to the next ring's DIN. All rings share 5V and GND from the external supply. Capacitor stabilises the power bus.
🔌 Arduino UNO ↔ 6× NeoPixel Ring — Wiring Schematic
Single-pin daisy-chain configuration · External 5V power rail · Common GND between Arduino and supply
🔗 Daisy-Chain Connection Flow
DOUT of each ring connects directly to DIN of the next. Power rails run in parallel to all rings.
📌 Pin Connection Reference
| From | To | Wire | Notes |
|---|---|---|---|
| Arduino Pin 6 | 330Ω → Ring #1 DIN | 🟣 Purple | One data line controls all 72 LEDs |
| Ext. 5V (+) | All ring 5V pads + Cap (+) | 🔴 Red | External supply only — not Arduino 5V pin! |
| PSU GND + Arduino GND | All ring GND pads + Cap (−) | ⚫ Black | Common GND between Arduino and supply |
| Ring N DOUT | Ring N+1 DIN | 🟢 Green | Repeat for each ring in the chain |
| 1000µF Capacitor | — | Across 5V & GND as close to Ring #1 as possible | |
Step-by-Step Instructions
Follow these steps in order. Read each tip before proceeding — especially the power warnings.
② Connect Ring #1's GND pad to the common GND bus.
③ Connect Arduino Pin 6 → 330Ω resistor → Ring #1 DIN pad.
① Connect DOUT of the previous ring to DIN of this ring.
② Connect 5V and GND pads to the shared power bus.
Repeat until all 6 rings are connected in a chain.
PIN is set to 6 and NUMPIXELS to 72. Select Tools → Board → Arduino UNO and your correct COM port. Click Upload and wait for "Done uploading".NUMPIXELS 96 (6 × 16). Using only 3 rings? Set NUMPIXELS 36. The library handles the rest automatically.loop() to customise your show. For a sound-reactive version, connect a MAX4466 mic module to A0 and map analogRead(A0) to brightness.Arduino Sketch
Full multi-effect sketch — breathing yellow, rainbow cycle, color wipe, and theatre chase. Copy the base code from the project, or use this expanded version for a complete light show.
// ═══════════════════════════════════════════════════════════ // Arduino UNO NeoPixel Ring Light Show | MakeMindz.com // Hardware: 6× NeoPixel Ring (12 LEDs each) = 72 LEDs // Library: Adafruit NeoPixel // Data Pin: D6 → 330Ω → Ring #1 DIN // Ring chain: DOUT → DIN → DOUT → DIN ... // ═══════════════════════════════════════════════════════════ #include <Adafruit_NeoPixel.h> // ── Hardware Configuration ─────────────────────────────── #define PIN 6 // Arduino digital pin D6 #define NUMPIXELS 72 // 6 rings × 12 LEDs — adjust as needed #define BRIGHTNESS 100 // Global max brightness (0-255) #define STEP_DELAY 10 // Breathing animation step delay (ms) Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800); // ═══════════════════════════════════════════════════════════ // SETUP // ═══════════════════════════════════════════════════════════ void setup() { pixels.begin(); pixels.setBrightness(BRIGHTNESS); pixels.clear(); pixels.show(); Serial.begin(9600); Serial.println("NeoPixel Light Show — Ready!"); } // ═══════════════════════════════════════════════════════════ // LOOP — cycles through all 4 effects // ═══════════════════════════════════════════════════════════ void loop() { // ── Effect 1: Breathing Yellow (from original sketch) ──── for (int brightness = 0; brightness < 256; brightness++) { setAllPixels(255, 255, 0, brightness); delay(STEP_DELAY); } for (int brightness = 255; brightness >= 0; brightness--) { setAllPixels(255, 255, 0, brightness); delay(STEP_DELAY); } // ── Effect 2: Rainbow Cycle ────────────────────────────── rainbowCycle(5); // ── Effect 3: Color Wipe (R → G → B → clear) ──────────── colorWipe(pixels.Color(255, 0, 0), 30); // Red colorWipe(pixels.Color(0, 255, 0), 30); // Green colorWipe(pixels.Color(0, 0, 255), 30); // Blue colorWipe(pixels.Color(0, 0, 0), 15); // Clear // ── Effect 4: Theatre Chase ────────────────────────────── theatreChase(pixels.Color(127, 0, 127), 50); // Purple theatreChase(pixels.Color(0, 127, 127), 50); // Teal } // ═══════════════════════════════════════════════════════════ // EFFECT FUNCTIONS // ═══════════════════════════════════════════════════════════ // Set all pixels to an RGB colour scaled by a brightness value void setAllPixels(uint8_t r, uint8_t g, uint8_t b, uint8_t bri) { uint32_t c = pixels.Color( (r * bri) / 255, (g * bri) / 255, (b * bri) / 255 ); for (int i = 0; i < NUMPIXELS; i++) pixels.setPixelColor(i, c); pixels.show(); } // Fill pixels one-by-one with a solid colour void colorWipe(uint32_t color, uint8_t wait) { for (int i = 0; i < NUMPIXELS; i++) { pixels.setPixelColor(i, color); pixels.show(); delay(wait); } } // Distribute rainbow hues evenly across the entire strip void rainbowCycle(uint8_t wait) { for (int j = 0; j < 256 * 3; j++) { for (int i = 0; i < NUMPIXELS; i++) { pixels.setPixelColor(i, Wheel(((i * 256 / NUMPIXELS) + j) & 255)); } pixels.show(); delay(wait); } } // Theatre-style running lights effect void theatreChase(uint32_t color, uint8_t wait) { for (int j = 0; j < 10; j++) { for (int q = 0; q < 3; q++) { for (int i = 0; i < NUMPIXELS; i += 3) pixels.setPixelColor(i + q, color); pixels.show(); delay(wait); for (int i = 0; i < NUMPIXELS; i += 3) pixels.setPixelColor(i + q, 0); } } } // Map 0-255 input to an RGB colour wheel value uint32_t Wheel(byte pos) { pos = 255 - pos; if (pos < 85) return pixels.Color(255 - pos * 3, 0, pos * 3); if (pos < 170) { pos -= 85; return pixels.Color(0, pos * 3, 255 - pos * 3); } pos -= 170; return pixels.Color(pos * 3, 255 - pos * 3, 0); }
How It Works
setAllPixels(r, g, b, brightness) function multiplies each colour channel by the brightness value and divides by 255. This scales colours proportionally — so yellow (255, 255, 0) at brightness 128 becomes (128, 128, 0), preserving the hue perfectly. This technique produces smoother dimming than changing setBrightness() globally, which applies gamma correction and can cause colour shifts.Wheel() function maps a 0–255 input to a smooth RGB rainbow by dividing the input into three 85-unit zones — red→blue, blue→green, green→red — creating seamless hue transitions. The rainbowCycle() function offsets each LED's wheel input by its index, spreading the full rainbow across all 72 pixels simultaneously while rotating the pattern over 256 × 3 frames.Online Simulations
Simulate the full 72-LED light show in your browser — no components, no soldering needed.
count to 72, wire DIN to Pin 6. Paste the sketch above, click Play and watch the full light show — breathing yellow, then rainbow, then color wipes, all in real time.
Comments
Post a Comment