The Grove RGB LED Ring (20 - WS2813 Mini) is a versatile LED display solution that combines powerful WS2813 addressable LEDs with Grove's plug-and-play simplicity. Perfect for creating stunning visual effects and indicators.
- 🎨 20 Individually Addressable RGB LEDs
- 💡 WS2813 Chipset with Built-in Controllers
- 🛡️ Intelligent Reverse-connection Protection
- 🔄 Signal Break-point Continuous Transmission
- 📊 256 Gray Levels
- 🎨 16,777,216 Colors
- Operating Voltage: 3.3V/5V
- Quiescent Current: 0.7mA/LED
- RGB Channel Current: 16mA/LED
- Refresh Rate: 2KHz
- Operating Temperature: -25℃ to 85℃
This project implements three stunning LED patterns with smooth transitions:
void DisplayRainbowPattern() {
for (int i = 0; i < kNumLeds; i++) {
int hue = (g_position + (i * 65536 / kNumLeds)) % 65536;
g_ring.setPixelColor(i, g_ring.gamma32(g_ring.ColorHSV(hue)));
}
}Creates a smooth rainbow effect by:
- Calculating unique hue values for each LED
- Using HSV color space for smooth transitions
- Applying gamma correction for natural-looking colors
void DisplayChasePattern() {
const uint8_t kTrailLength = 5;
for (int i = 0; i < kTrailLength; i++) {
int pos = (g_position - i) % kNumLeds;
uint8_t intensity = 255 - (i * 50);
g_ring.setPixelColor(pos, color);
}
}Implements a "comet" effect with:
- Leading bright pixel
- Fading tail of 5 pixels
- Smooth circular movement
void DisplayBreathePattern() {
float brightness = (exp(sin(millis()/2000.0*PI)) - 0.36787944)*108.0;
g_ring.setBrightness(brightness);
}Creates a pulsing effect using:
- Sinusoidal brightness calculation
- Exponential scaling for natural-looking fade
- Synchronized LED brightness control
-
Hardware Connection
- Connect LED Ring data pin to GPIO 6
- Connect VCC to 3.3V/5V
- Connect GND to ground
-
Software Setup
# Create project directory mkdir LED_Ring_Control cd LED_Ring_Control # Create main sketch file touch LED_Ring_Control.ino
-
Library Installation
- Open Arduino IDE
- Go to Tools > Manage Libraries
- Search for "Adafruit NeoPixel"
- Click Install
Key parameters you can modify:
const uint8_t kLedPin = 6; // Change pin number
const uint8_t kBrightness = 50; // Adjust brightness (0-255)
const uint32_t kPatternDuration = 10000; // Pattern duration in msMIT License - Use as is, no liability to the Author and Partners
If you find this code useful, please consider supporting us!
We welcome contributions! Areas for improvement:
- New pattern designs
- Performance optimizations
- Additional configuration options
- Documentation improvements
Common issues and solutions:
-
LEDs not lighting up
- Check power supply voltage
- Verify data pin connection
- Ensure correct PIN number in code
-
Colors not displaying correctly
- Check power supply current capacity
- Verify LED ring model compatibility
- Check for correct color order (RGB vs GRB)
Made with ❤️ by HeySalad

