✨ Build a Spinning NeoPixel Ring Light Show!
Combine glowing NeoPixel rings with spinning servo motors to create a mesmerizing robotic light show — controlled entirely by an Arduino Mega. Perfect for a room decoration, talent show, or science fair showstopper!
What You'll Build
A display of three NeoPixel LED rings, each mounted on its own servo motor so it can slowly rotate back and forth. An Arduino Mega controls both the colorful light patterns and the spinning motion together, creating a swirling, glowing light show that moves and changes color in sync.
🎯 Why Kids Love This Robotics Project
This Arduino Mega robotics project is pure magic — it mixes colorful programmable LEDs with moving motors for a result that looks like something from a concert stage! It's a fantastic way to learn about RGB color values, addressable LEDs, and motor control while building something genuinely beautiful.
🧰 Materials You Need
⚠️ Power Safety Note
NeoPixel rings can draw a lot of current at full brightness. Always power them from an external 5V supply (not directly from the Arduino's 5V pin) and have an adult double-check wiring before plugging anything in.
🛠️ Step-by-Step Building Instructions
Build the Mounting Stands
Attach each servo motor to the top of a small wooden dowel or 3D-printed stand, so the servo's rotating arm faces upward, ready to hold a ring.
Attach the NeoPixel Rings
Glue or screw each NeoPixel ring onto a servo's rotating arm so the ring spins smoothly when the servo turns left and right.
Arrange Your Display
Place the three stands in a pleasing pattern — a row, a triangle, or a curve — on a base board so the light show looks great from the front.
Wire the Power System
Connect your external 5V power supply to all three NeoPixel rings and all three servos, making sure to add the capacitor across the power lines near the rings (this protects them from power spikes).
Wire the Data & Signal Lines
Connect each NeoPixel ring's data line (through the resistor) to its own Arduino Mega digital pin, and each servo's signal wire to its own PWM pin, following the circuit diagram below.
Install the Software
In the Arduino IDE, install the Adafruit_NeoPixel and Servo libraries through the Library Manager.
Upload the Code
Copy the code below, select "Arduino Mega 2560" as your board, and click Upload. Your rings should start glowing and spinning together!
Dim the Lights & Enjoy
Turn off the room lights for the best effect, and watch your spinning, color-shifting light show come alive!
🔌 Circuit Diagram
Layout (shown for one ring + one servo — repeat x3):
EXTERNAL 5V SUPPLY
┌────────────┐
│ +5V ●──────┼───┬────────────────┬────────────── Servo VCC
│ GND ●──────┼───┼────┬───────────┼────┬───────── Servo GND
└────────────┘ │ │ │ │
│ [1000µF] │ │
│ │ │ │
NeoPixel +5V NeoPixel GND
│
Data In ──[300Ω resistor]── ARDUINO MEGA Pin 6
(Servo Signal → Pin 9)
| Component | Wire | Connection |
|---|---|---|
| NeoPixel Ring 1 | Data In | Mega Pin 6 (via 300Ω resistor) |
| NeoPixel Ring 2 | Data In | Mega Pin 7 (via 300Ω resistor) |
| NeoPixel Ring 3 | Data In | Mega Pin 8 (via 300Ω resistor) |
| NeoPixel Rings (all) | Power / GND | External 5V supply (with 1000µF capacitor) |
| Servo 1 | Signal | Mega Pin 9 (PWM) |
| Servo 2 | Signal | Mega Pin 10 (PWM) |
| Servo 3 | Signal | Mega Pin 11 (PWM) |
Tip: Always connect the Arduino Mega's GND to the external power supply's GND too — this "common ground" keeps the signals working correctly.
💻 Arduino Code
neopixel_ring_lightshow.ino#include <Adafruit_NeoPixel.h>
#include <Servo.h>
#define NUM_PIXELS 16
#define NUM_RINGS 3
int ringPins[NUM_RINGS] = {6, 7, 8};
int servoPins[NUM_RINGS] = {9, 10, 11};
Adafruit_NeoPixel rings[NUM_RINGS] = {
Adafruit_NeoPixel(NUM_PIXELS, ringPins[0], NEO_GRB + NEO_KHZ800),
Adafruit_NeoPixel(NUM_PIXELS, ringPins[1], NEO_GRB + NEO_KHZ800),
Adafruit_NeoPixel(NUM_PIXELS, ringPins[2], NEO_GRB + NEO_KHZ800)
};
Servo servos[NUM_RINGS];
int servoAngle[NUM_RINGS] = {0, 0, 0};
int servoDir[NUM_RINGS] = {1, 1, 1};
unsigned long lastMove = 0;
unsigned long lastColor = 0;
int colorOffset = 0;
void setup() {
for (int i = 0; i < NUM_RINGS; i++) {
rings[i].begin();
rings[i].setBrightness(80);
rings[i].show();
servos[i].attach(servoPins[i]);
servos[i].write(90); // start centered
}
}
uint32_t wheel(byte pos) {
// Generates rainbow colors across 0-255
if (pos < 85) {
return rings[0].Color(pos * 3, 255 - pos * 3, 0);
} else if (pos < 170) {
pos -= 85;
return rings[0].Color(255 - pos * 3, 0, pos * 3);
} else {
pos -= 170;
return rings[0].Color(0, pos * 3, 255 - pos * 3);
}
}
void updateLights() {
for (int r = 0; r < NUM_RINGS; r++) {
for (int p = 0; p < NUM_PIXELS; p++) {
int colorIndex = (p * 256 / NUM_PIXELS + colorOffset + r * 80) % 256;
rings[r].setPixelColor(p, wheel(colorIndex));
}
rings[r].show();
}
colorOffset = (colorOffset + 4) % 256;
}
void updateServos() {
for (int i = 0; i < NUM_RINGS; i++) {
servoAngle[i] += servoDir[i] * 2;
if (servoAngle[i] >= 60) servoDir[i] = -1;
if (servoAngle[i] <= -60) servoDir[i] = 1;
servos[i].write(90 + servoAngle[i]);
}
}
void loop() {
if (millis() - lastColor > 30) {
updateLights();
lastColor = millis();
}
if (millis() - lastMove > 40) {
updateServos();
lastMove = millis();
}
}
wheel() function turns a number (0-255) into a rainbow color. Each ring's lights slowly cycle through this rainbow, while each servo gently rocks back and forth — together creating a swirling, moving light show!
🌟 Tips for an Even Better Light Show
- Try syncing the rotation speed with the color-cycling speed for different moods (slow & dreamy vs. fast & energetic).
- Add music using a simple buzzer or phone speaker nearby for a full audio-visual show.
- Experiment with brightness levels — lower brightness uses less power and creates a softer glow.
- Try giving each ring a different color pattern instead of the same rainbow for more variety.
- Mount the rings at slightly different heights for a more dynamic, 3D look.
❓ Frequently Asked Questions
Do I need to know how to code to build this?
No! The code above is ready to copy and upload. You can tweak colors, speed, and angles once it's working to make it your own.
Why do I need an Arduino Mega instead of an Uno?
The Mega has more memory and pins, which makes it easier to control multiple NeoPixel rings and servos at the same time without running out of resources.
Can I add more rings?
Yes! Just increase NUM_RINGS, add more entries to the pin arrays, and wire up additional rings and servos the same way.
What age group is this project good for?
With adult help for wiring and power setup, kids aged 10 and up can enjoy building and customizing this light show.
🏆 You Did It!
You just built a glowing, spinning robotic light show! Try adding sound reactivity with a microphone module, or program different "show modes" you can switch between with a button press.

Comments
Post a Comment