WS2812 RGB LED Module | Botshop

WS2812 RGB LED Module

R85.00

Are you getting tired of the old fashioned LED strips where you have to set all the LEDs at the same color? With this 8 LED stick, you can give each LED its own color, and all you need is one digital pin to do so.

Out of stock - Join the waitlist to be emailed when this product becomes available

SKU: led-88 Categories: , ,

Description

Make your own little LED strip arrangement with this stick of NeoPixel LEDs. We crammed 8 of the tiny 5050 (5mm x 5mm) smart RGB LEDs onto a PCB with mounting holes and a chainable design. Use only one microcontroller pin to control as many as you can chain together! Each LED is addressable as the driver chip is inside the LED. Each one has ~18mA constant current drive so the color will be very consistent even if the voltage varies, and no external choke resistors are required making the design slim. Power the whole thing with 5VDC (4-7V works) and you’re ready to rock.

The LEDs are ‘chainable’ by connecting the output of one stick into the input of another – see the photo above. There is a single data line with a very timing-specific protocol. Since the protocol is very sensitive to timing, it requires a real-time microcontroller such as an AVR, Arduino, PIC, mbed, etc. It cannot be used with a Linux-based microcomputer or interpreted microcontroller such as the neutrino or Basic Stamp. Our wonderfully-written Neopixel library for Arduino supports these pixels! As it requires hand-tuned assembly it is only for AVR cores but others may have posted this chip driver code so please google around. An 8MHz or faster processor is required.

 

Example Sketch & Diagram

arduino_usb_and_extrenal_power_ws2812

#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
 #include <avr/power.h>
#endif

#define PIN 6

#define num_Pixels 80

Adafruit_NeoPixel strip = Adafruit_NeoPixel(num_Pixels, PIN, NEO_GRB + NEO_KHZ800);

void setup() {
 #if defined (__AVR_ATtiny85__)
 if (F_CPU == 16000000) clock_prescale_set(clock_div_1);
 #endif

 strip.begin();
 strip.show(); 
}

void loop() {

 colorWipe(strip.Color(255, 0, 0), 50); 
 colorWipe(strip.Color(0, 255, 0), 50); 
 colorWipe(strip.Color(0, 0, 255), 50); 
 colorWipe(strip.Color(255, 255, 255), 50);
 theaterChase(strip.Color(127, 127, 127), 50);
 theaterChase(strip.Color(127, 0, 0), 50); 
 theaterChase(strip.Color(0, 0, 127), 50); 

 rainbow(20);
 rainbowCycle(20);
 theaterChaseRainbow(50);
}


void colorWipe(uint32_t c, uint8_t wait) {
 for(uint16_t i=0; i<strip.numPixels(); i++) {
 strip.setPixelColor(i, c);
 strip.show();
 delay(wait);
 }
}

void rainbow(uint8_t wait) {
 uint16_t i, j;

 for(j=0; j<256; j++) {
 for(i=0; i<strip.numPixels(); i++) {
 strip.setPixelColor(i, Wheel((i+j) & 255));
 }
 strip.show();
 delay(wait);
 }
}


void rainbowCycle(uint8_t wait) {
 uint16_t i, j;

 for(j=0; j<256*5; j++) { 
 for(i=0; i< strip.numPixels(); i++) {
 strip.setPixelColor(i, Wheel(((i * 256 / strip.numPixels()) + j) & 255));
 }
 strip.show();
 delay(wait);
 }
}


void theaterChase(uint32_t c, uint8_t wait) {
 for (int j=0; j<10; j++) { 
 for (int q=0; q < 3; q++) {
 for (uint16_t i=0; i < strip.numPixels(); i=i+3) {
 strip.setPixelColor(i+q, c); 
 }
 strip.show();

 delay(wait);

 for (uint16_t i=0; i < strip.numPixels(); i=i+3) {
 strip.setPixelColor(i+q, 0); 
 }
 }
 }
}


void theaterChaseRainbow(uint8_t wait) {
 for (int j=0; j < 256; j++) { 
 for (int q=0; q < 3; q++) {
 for (uint16_t i=0; i < strip.numPixels(); i=i+3) {
 strip.setPixelColor(i+q, Wheel( (i+j) % 255)); 
 }
 strip.show();

 delay(wait);

 for (uint16_t i=0; i < strip.numPixels(); i=i+3) {
 strip.setPixelColor(i+q, 0); 
 }
 }
 }
}

uint32_t Wheel(byte WheelPos) {
 WheelPos = 255 - WheelPos;
 if(WheelPos < 85) {
 return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);
 }
 if(WheelPos < 170) {
 WheelPos -= 85;
 return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);
 }
 WheelPos -= 170;
 return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);
}

 

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.