The WS2811, WS2812, WS2812B, WS2813, and SK6812x are known as NeoPixel or Pixel. They are RGB LEDs with a controller. Particularly WS2811 RGB LED strings are commonly sold in India during Diwali and in North America during Halloween, Christmas etc. Bhoot Chaturdashi in India and Halloween in North America are equivalent. Indian wedding typically involves a lot of lighting. These occasions increased demand for NeoPixel and as a result, you’ll find WS2811 RGB LED strings to be sold anywhere during these occasions. The shops which deal with lighting, refer to them as 2811 Pixel. NeoPixel is a phrase mostly used in the maker community.
Ready-to-use controllers are available for 2811 Pixels. In certain use cases, they are easy to use. But, you can not use a big controller box for a few Pixels or a wearable. That is the reason we talk about controlling with ESP32, Arduino etc. By now you already know that 2811 is original NeoPixel compatible. That means you can use all the libraries and examples developed so far for NeoPixels.
If you are looking to create a waterfall like a sheet of NeoPixel to decorate the outdoors of your house (in India, we say it RGB LED jhalar), then ready-to-use controllers and SMPS is the better choice. Also, there are commercial controllers powered by ESP32. In those cases, you’ll add the strings in the S pattern. There are two types of connections, S and Z. S is commonly used. The ready-to-use controllers and SMPS reduce the complexity when you are using more than 512 pixels.
---
The DIP package in WS2811 has a built-in reset on the power loss circuit. If your supplied power’s voltage, and amperage drop then you’ll face odd issues such as random blinking. As per the datasheet, for 512 Pixels, it can give you up to 30 FPS speed, and for 1024 Pixels, up to 20 FPS. Also, there is a signal reshaping amplification drive circuit, and data latch. There are 3 output channels in the WS2811. We need to program ESP32/Arduino which will control the IC. There is a library known as Neo Pixel Arduino library which will reduce your manual work. You need jumper wires, connecting cables etc. Easy connection since there are three wires. VCC will go to Arduino/ESP32’s 5V (or external power supply), GND will go to Arduino/ESP32’s GND and data will get connected with the pin you’ll mention in the code (Pin 5 in our example). Using a separate 5V 5 Amp power supply is optional for a few Pixels. A basic code will be like the below, this is modified from official examples provided by AdaFruit:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | #include <Adafruit_NeoPixel.h> #define PIN 5 #define NUMPIXELS 15 Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800); int delayval = 100; // timing delay in milliseconds int redColor = 0; int greenColor = 0; int blueColor = 0; void setup() { pixels.begin(); } void loop() { setColor(); for (int i=0; i < NUMPIXELS; i++) { pixels.setPixelColor(i, pixels.Color(redColor, greenColor, blueColor)); pixels.show(); delay(delayval); } } void setColor(){ redColor = random(0, 255); greenColor = random(0,255); blueColor = random(0, 255); } |
A 470 ohms resistor should be used in series with data and a capacitor of 1000uF and 6.3V can be added across the power (GND and VCC). These are not mandatory to use but you should use these with more LEDs.
Tagged With https://thecustomizewindows com/2022/10/esp32-arduino-ws2811-pixel-neopixel-programming/