Addressable RGB LED Strip-WS1812B

The WS2812B LED strip is an addressable RGB LED strip. It works with other similar LED strips, such as strips of the WS28XX family, Neopixel strip and others. The WS2812B addressable LED strip comes in several varieties that differ in size, sealant or LED density. Choose the one that best fits your purposes.WS1812B Addressable RGB LED strip
This WS2812B LED strip is 5 meters long and the LEDs are enclosed in a weatherproof silicone. You can control the brightness and the color of each LED individually,

which allows you to produce amazing and complex effects in a simple way. This LED strip is made by WS2812B LEDs wired in series. These LEDs have an IC built right into the LED. This allows a communication via a one-wire interface. This means that you can control lots of LEDs using just one digital pin of your Arduino.
In the following figure you can see the chip inside the LED. The LED is an RGB LED and works like so.
This kind of strips are very flexible and can be cut to any length you want. As you can see, the strip is divided into segments, and each segment contains one RGB LED.
You can adjust its size by cutting the strip with a scissors in the right place. These strips come with connectors at each end. I’ve decided to cut the connectors, and solder header pins. It’s handier if you want to connect the strip to an Arduino or to a breadboard.
HOW TO USE POWER TO STRIP LEDS:
The LED strip should be powered using a 5V power source. At 5V, each LED draws abo50mA, when set to its full brightness. This means that for every 30 LEDs, the strip may draw as much as 1.5 A. Make sure you select a power source that matches the strip’s needs. If you end up using an external supply, don’t forget to connect the power supply ground to the Arduino ground.
USEFUL TIPS TO STRIP LEDS:
1. Connect a capacitor with a capacitance between 100uF and 1000uF from power to ground to smooth out the power supply.
2. Add a 220 or 470 Ohm resistor between the Arduino digital output pin and the strip data input pin to reduce noise on that line.
3. Make your wires between the Arduino, power supply and the strip as short as possible to minimize voltage loss.
4. If your strip gets damaged and doesn’t work, check if the first LED is broken. If so, cut it, resolder the header pins, and it should be working again.
ADDRESSABLE LED STRIP WITH ARDUINO UNO CIRCUIT:
STRIP LED WITH ARDUINO UNO CODE:
//Circuito.io is an automatic generator of schematics and code.
//Copyright (C) 2016 Roboplan Technologies Ltd.
// Include Libraries
#include “Arduino.h”
#include “Adafruit_NeoPixel.h”
// Pin Definitions
#define LEDSTRIP_PIN_DI 2
// Global variables and defines
#define NUMOFPIXEL 60 * 1
// object initialization
Adafruit_NeoPixel ledStrip(LEDSTRIP_PIN_DI);
// define vars for testing menu
const int timeout = 10000; //define timeout of 10 sec
char menuOption = 0;
long time0;
// Setup the essentials for your circuit to work. It runs first every time your circuit is powered with electricity.
void setup()
{
// Setup Serial which is useful for debugging
// Use the Serial Monitor to view printed messages
Serial.begin(9600);
while (!Serial) ; // wait for serial port to connect. Needed for native USB
Serial.println(“start”);
ledStrip.begin(); // This initializes the NeoPixel library.
ledStrip.show(); // Initialize all pixels to ‘off’
menuOption = menu();
}
// Main logic of your circuit. It defines the interaction between the components you selected. After setup, it runs over and over again, in an eternal loop.
void loop()
{
if(menuOption == ‘1’) {
// LED RGB Strip – Addressable, Sealed (1m) – For LED Strip – Test Code
for(int i=0 ; i <= NUMOFPIXEL ; i++){ // set pixels Color to RGB values, from 0,0,0 up to 255,255,255 ledStrip.setPixelColor(i, ledStrip.Color(0,150,0)); // turn on green color on led #i. if (i > 0)
ledStrip.setPixelColor(i-1, ledStrip.Color(0,0,0)); // turn off last led
ledStrip.show(); //update pixel color to the hardware.
delay(50);
}
}
if (millis() – time0 > timeout)
{
menuOption = menu();
}
}
// Menu function for selecting the components to be tested
// Follow serial monitor for instrcutions
char menu()
{
Serial.println(F(“\nWhich component would you like to test?”));
Serial.println(F(“(1) LED RGB Strip – Addressable, Sealed (1m) – For LED Strip”));
Serial.println(F(“(menu) send anything else or press on board reset button\n”));
while (!Serial.available());
// Read data from serial monitor if received
while (Serial.available())
{
char c = Serial.read();
if (isAlphaNumeric(c))
{
if(c == ‘1’)
Serial.println(F(“Now Testing LED RGB Strip – Addressable, Sealed (1m) – For LED Strip”));
else
{
Serial.println(F(“illegal input!”));
return 0;
}
time0 = millis();
return c;
}
}
}
Download Arduino Sketch here.Addressable rgb led strip

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.