Stufin
Home Quick Cart Profile

WS2812 16 Bit RGB LED Matrix

Buy Now on Stufin

LED Type

Surface-mount RGB LEDs

LED Pitch

2.5 mm

Color Depth

16 bits (65,536 possible colors per pixel)

Refresh Rate

Up to 800 KHz

Power Consumption

0.3-0.5A per meter

Operating Voltage

5V

Communication Protocol

Serial data input

Dimensions

Varies depending on the specific module size and layout

Applications

The WS2812 16 Bit RGB LED Matrix is an ideal component for various IoT projects, including

Wearable devices, such as smartwatches and fitness trackers

Interactive installations, like interactive art and ambient lighting systems

Ambient displays, such as mood lighting and decorative displays

Advertising and signage displays

IoT-enabled home automation systems

By offering high-density, addressable LEDs with 16-bit color depth, the WS2812 16 Bit RGB LED Matrix provides a versatile and powerful display solution for a wide range of IoT applications.

Pin Configuration

  • WS2812 16-Bit RGB LED Matrix Pinout and Connection Guide
  • The WS2812 16-Bit RGB LED Matrix is a popular IoT component used to create stunning visual effects and interactive displays. This documentation provides a detailed explanation of the pins and their connections.
  • Pinout:
  • The WS2812 16-Bit RGB LED Matrix has a total of 4 pins:
  • Pin 1: VCC (Power Supply, +5V)
  • Function: Provides power to the LED matrix
  • Connection: Connect to a 5V power supply or a Power Bank
  • Note: Ensure a stable 5V power supply to avoid damage to the LED matrix
  • Pin 2: GND (Ground, 0V)
  • Function: Provides a common ground reference for the LED matrix
  • Connection: Connect to the ground terminal of the power supply or Power Bank
  • Note: A solid ground connection is essential for proper operation and to prevent electrical noise
  • Pin 3: DIN (Data Input)
  • Function: Receives data signals from a microcontroller or other control device
  • Connection:
  • + Connect to a digital output pin of a microcontroller (e.g., Arduino, Raspberry Pi, or ESP32)
  • + Use a level shifter if the microcontroller operates at a voltage different from 5V
  • + Ensure proper signal integrity and noise reduction measures are taken
  • Pin 4: DOUT (Data Output)
  • Function: Outputs data signals to the next LED matrix or other devices
  • Connection:
  • + Leave unconnected if this is the last LED matrix in the chain
  • + Connect to the DIN pin of the next LED matrix in the chain
  • + Use a level shifter if the next device operates at a voltage different from 5V
  • Connection Structure:
  • To connect multiple WS2812 16-Bit RGB LED Matrices, follow this structure:
  • 1. Connect the VCC pin of each LED matrix to a 5V power supply or Power Bank.
  • 2. Connect the GND pin of each LED matrix to the ground terminal of the power supply or Power Bank.
  • 3. Connect the DIN pin of the first LED matrix to a digital output pin of a microcontroller.
  • 4. Connect the DOUT pin of each LED matrix to the DIN pin of the next LED matrix in the chain.
  • Important Notes:
  • Ensure proper power supply and grounding to avoid damage to the LED matrices.
  • Use a level shifter if the microcontroller operates at a voltage different from 5V.
  • Take necessary measures to reduce electromagnetic interference (EMI) and radio-frequency interference (RFI) in your design.
  • Refer to the WS2812 datasheet and application notes for more detailed information on usage and limitations.
  • By following this pinout and connection guide, you can successfully integrate the WS2812 16-Bit RGB LED Matrix into your IoT project and create stunning visual effects.

Code Examples

WS2812 16 Bit RGB LED Matrix Documentation
Overview
The WS2812 16 Bit RGB LED Matrix is a popular IoT component used for creating vibrant, high-resolution displays for various applications, including signage, art installations, and interactive projects. This matrix consists of 16-bit, 5-channel RGB LEDs, each capable of producing 16 million colors, with a maximum refresh rate of 400 Hz.
Pinout and Connections
The WS2812 LED Matrix has a single signal wire that requires only one digital pin from a microcontroller to control the entire matrix. The pinout is as follows:
| Pin | Function |
| --- | --- |
| VCC | Power supply (5V) |
| GND | Ground |
| DIN | Data input |
Code Examples
### Example 1: Basic Color Cycling with Arduino
In this example, we will demonstrate how to control the WS2812 LED Matrix using an Arduino board. We will create a simple color cycling effect that transitions between red, green, and blue.
Hardware Requirements
WS2812 16 Bit RGB LED Matrix
 Arduino Board (e.g., Arduino Uno)
 Breadboard and jumper wires
Software Requirements
Arduino IDE (version 1.8 or later)
Code
```c++
#include <FastLED.h>
#define LED_PIN 6
#define NUM_LEDS 16
CRGB leds[NUM_LEDS];
void setup() {
  FastLED.addLeds<WS2812, LED_PIN, GRB>(leds, NUM_LEDS);
}
void loop() {
  static uint8_t hue = 0;
  for (int i = 0; i < NUM_LEDS; i++) {
    leds[i] = CHSV(hue, 255, 255);
  }
  FastLED.show();
  hue += 1;
  delay(50);
}
```
In this code, we use the FastLED library to control the WS2812 LED Matrix. We define the number of LEDs, the pin used to control the matrix, and the color order (GRB). In the `loop()` function, we cycle through hues from 0 to 255, assigning each LED a color based on the current hue value.
### Example 2: Interactive Pattern Display with Raspberry Pi (Python)
In this example, we will create an interactive pattern display using a Raspberry Pi and the WS2812 LED Matrix. We will use Python and the RPi.GPIO library to control the matrix.
Hardware Requirements
WS2812 16 Bit RGB LED Matrix
 Raspberry Pi (any model)
 Breadboard and jumper wires
Software Requirements
Raspbian OS (version 10 or later)
 Python 3.x
 RPi.GPIO library (install using `pip install RPi.GPIO`)
Code
```python
import time
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setup(18, GPIO.OUT)
leds = [0xFF0000, 0x00FF00, 0x0000FF, 0xFFFFFF, 0x000000]  # Red, Green, Blue, White, Black
pattern = [0, 1, 2, 3, 4]
while True:
    for i in range(16):
        GPIO.output(18, leds[pattern[i % len(pattern)] >> (i % 3)  8)
        time.sleep(0.05)
```
In this code, we use the RPi.GPIO library to set up the GPIO pin 18 as an output. We define a list of colors and a pattern to cycle through. In the main loop, we output the color values to the WS2812 LED Matrix, shifting the bits to address each LED individually.
These examples demonstrate the basic usage of the WS2812 16 Bit RGB LED Matrix with Arduino and Raspberry Pi. You can modify and extend these examples to create complex, interactive displays for your IoT projects.