

The WS2812B is an addressable LED pixel board manufactured by WorldSemi Co. Ltd. This component is a type of LED strip that allows individual control of each LED's color and brightness through a single data line. It is commonly used for creating dynamic lighting effects in various applications such as decorative lighting, displays, and indicators.








| Parameter | Value |
|---|---|
| Manufacturer | WorldSemi Co. Ltd. |
| Part ID | WS2812B |
| Operating Voltage | 3.5V - 5.3V |
| Operating Current | 60mA per LED (max) |
| Power Consumption | 0.3W per LED (max) |
| Communication | Single-wire data line |
| LED Color | RGB (Red, Green, Blue) |
| LED Control | PWM (Pulse Width Modulation) |
| Data Transfer Rate | 800 Kbps |
| Operating Temperature | -25°C to 80°C |
| Pin Number | Pin Name | Description |
|---|---|---|
| 1 | VDD | Power supply (3.5V - 5.3V) |
| 2 | DOUT | Data output to the next LED in the chain |
| 3 | GND | Ground |
| 4 | DIN | Data input from the microcontroller or previous LED |

#include <Adafruit_NeoPixel.h>
// Define the number of LEDs in the strip
#define NUM_LEDS 16
// Define the pin connected to the DIN of the WS2812B
#define DATA_PIN 6
// Create an instance of the Adafruit_NeoPixel class
Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUM_LEDS, DATA_PIN, NEO_GRB + NEO_KHZ800);
void setup() {
// Initialize the LED strip
strip.begin();
strip.show(); // Initialize all pixels to 'off'
}
void loop() {
// Example: Set all LEDs to red
for (int i = 0; i < NUM_LEDS; i++) {
strip.setPixelColor(i, strip.Color(255, 0, 0)); // Red color
}
strip.show(); // Update the strip with new colors
delay(500); // Wait for 500 milliseconds
// Example: Turn off all LEDs
for (int i = 0; i < NUM_LEDS; i++) {
strip.setPixelColor(i, strip.Color(0, 0, 0)); // Turn off
}
strip.show(); // Update the strip with new colors
delay(500); // Wait for 500 milliseconds
}
By following this documentation, users can effectively utilize the WS2812B addressable LED pixel board in their projects, creating stunning and dynamic lighting effects with ease.