Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino UNO Controlled WS2812 RGB LED Strip with Custom Color Patterns

View and Edit Project In Cirkit DesignerImage of Arduino UNO Controlled WS2812 RGB LED Strip with Custom Color Patterns

Circuit Documentation

Summary

This circuit consists of an Arduino UNO microcontroller connected to a WS2812 RGB LED strip. The Arduino UNO provides power and control signals to the LED strip, allowing for the control of individual LEDs on the strip.

Component List

Arduino UNO

WS2812 RGB LED strip

Wiring Details

Arduino UNO

WS2812 RGB LED strip

Code Documentation

Arduino UNO Code

#include <Arduino.h>
#include <FastLED.h>

#define PIN 8
#define PIXELCOUNT 5

CRGB leds[PIXELCOUNT];  // Define the array of LEDs

void setup() {
  FastLED.addLeds<WS2811, PIN, RGB>(leds, PIXELCOUNT);
  delay(2000);  // Wait two seconds
  leds[0].setRGB(255, 0, 0);  // Color the first LED in red
  leds[1].setRGB(0, 255, 0);  // Color the second LED in green
  leds[2].setRGB(255, 0, 0);  // Color the third LED in red
  FastLED.show();  // Send the new color settings to the strip
}

void loop() {}

This code initializes the FastLED library to control the WS2812 RGB LED strip. It sets up the LED strip on pin 8 of the Arduino UNO and defines an array of 5 LEDs. In the setup function, it initializes the LED strip, waits for 2 seconds, and then sets the colors of the first three LEDs. The loop function is empty as no continuous operation is required.