Creating a neopixel light show using Arduino mega and servos

NeoPixel Ring Light Show with Arduino Mega & Servos | Robotics Project for Kids
Kid-Friendly Robotics Project

✨ 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.

Fun Fact: NeoPixels are "addressable" LEDs, meaning each tiny light on the ring can be a completely different color at the same time — that's how rainbow and chasing light effects are created with just one wire for data!

🧰 Materials You Need

🔌Arduino Mega 2560
💍3x NeoPixel Rings (16-LED)
⚙️3x Servo motors (SG90 or MG90S)
🔋5V external power supply (2A+)
🧯1000µF capacitor (for LED power)
🧰300-500Ω resistor (data line)
📦Wooden dowels or 3D-printed mounts
🔗Jumper wires

⚠️ 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

1

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.

2

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.

3

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.

4

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).

5

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.

6

Install the Software

In the Arduino IDE, install the Adafruit_NeoPixel and Servo libraries through the Library Manager.

7

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!

8

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)
      
ComponentWireConnection
NeoPixel Ring 1Data InMega Pin 6 (via 300Ω resistor)
NeoPixel Ring 2Data InMega Pin 7 (via 300Ω resistor)
NeoPixel Ring 3Data InMega Pin 8 (via 300Ω resistor)
NeoPixel Rings (all)Power / GNDExternal 5V supply (with 1000µF capacitor)
Servo 1SignalMega Pin 9 (PWM)
Servo 2SignalMega Pin 10 (PWM)
Servo 3SignalMega 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();
  }
}
How it works: The 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.

Made with ✨ light, code, and curiosity — Happy Building!

Comments

Product Cards
Buddy Bot eBook
⭐ New 2026 Release
Build Your
Own Robot!
3D design, wiring &
Arduino coding.
Young inventors love it!
🖨️
3D Print
All parts
Wire it
Circuit guide
💻
Code it
Arduino IDE
🤖
Watch it
Walk & react
📋 Your Details
Enter your name
Valid 10-digit no.
Enter a valid email
Special Website Offer
₹499 300
🌍 International: $5 USD
One-time · Instant digital delivery
🔒 Secured by Razorpay · Your data is safe
📄 Download Free Sample Copy
🔒 Secured by Razorpay · Your data is safe
🍓
Raspberry Pi Pico Mastery
21 Projects
⚡ Launch Price — 80% OFF
Learn Pico
Build 21 Projects!
MicroPython · Wokwi
IoT · Certificate
Perfect for beginners!
🖥️
Wokwi
No hardware
🐍
MicroPy
From zero
🔨
21 Projects
IoT + sensors
📄
Certificate
Verified cert
📋 Your Details
Enter your name
Valid 10-digit no.
Enter a valid email
Special Launch Offer
₹999 200 80% OFF
🌍 International: $5 USD
One-time · Lifetime access · No subscription
🔒 Secured by Razorpay · UPI · Cards · NetBanking
🎉

You're in!

Payment successful! Your Buddy Bot eBook is ready. Time to build!

📖 Access Your eBook Now
🎉

Enrolled!

Payment successful! Lifetime access to all 21 Pico Projects is yours!

🍓 Go to My Course