m*3m_SKU__FIT0352 - jimaobian/DFRobotWiki GitHub Wiki

Introduction

This is a kind of chip_inside LED strip, so you can control each LED individually! There are 60RGB LEDs per meter, it is so wonderful when you change the color of them. And for the control of the LEDs, it only need one digital pin of your Arduino of other MCU power supply from 3.3V-5V.

The chip in every LED called WS2812, you can find the datasheet in our website. And once we know how long your strip is, you can get the amount of the LEDs easily.

Technical Specifications

  • 60 LEDs/meter *3m
  • Power supply: 5V @ 1A/m (can work at 3.3V to 5V)
  • For this strip you need 5V/3A at least as it is 3m long, if current was not enough, the color may not be correct
  • IC name: WS2812
  • Brightness Grade Amount: 256
  • Weatherproof contains

Connection Guide

Connection

As the LED strip needs about over 3A current, so the power should be able to supply 5V@3A so we can make our Arduino work use this source. And the image upon shows how to uses a 5V power to feed our Arduino.

Sample Code

/*
 This code can be a good test code for your strip
 function: leds.setPixelColor(i,y) can be used to let number i of your led turn on with color of y
 and you can draw your idea easily with this function but never forget function: led.show()
*/

#include <Adafruit_NeoPixel.h>

#define PIN 6     //The signal pin connected with Arduino
#define LED_COUNT 180 // the amount of the leds of your strip

// Create an instance of the Adafruit_NeoPixel class called "leds".
// That'll be what we refer to from here on...
Adafruit_NeoPixel leds = Adafruit_NeoPixel(LED_COUNT, PIN, NEO_GRB + NEO_KHZ800);

void setup()
{
  leds.begin();  // Call this to start up the LED strip.
  clearLEDs();   // This function, defined below, turns all LEDs off...
  leds.show();   // ...but the LEDs don't actually update until you call this.
}

void loop()
{
    for (int i=0; i<LED_COUNT; i++)
  {
    rainbow(i);
    delay(50);  // Delay between rainbow slides
  }
}


// Sets all LEDs to off, but DOES NOT update the display;
// call leds.show() to actually turn them off after this.
void clearLEDs()
{
  for (int i=0; i<LED_COUNT; i++)
  {
    leds.setPixelColor(i, 0);
  }
}

// Prints a rainbow on the ENTIRE LED strip.
//  The rainbow begins at a specified position.
// ROY G BIV!
void rainbow(byte startPosition)
{
  // Need to scale our rainbow. We want a variety of colors, even if there
  // are just 10 or so pixels.
  int rainbowScale = 192 / LED_COUNT;

  // Next we setup each pixel with the right color
  for (int i=0; i<LED_COUNT; i++)
  {
    // There are 192 total colors we can get out of the rainbowOrder function.
    // It'll return a color between red->orange->green->...->violet for 0-191.
    leds.setPixelColor(i, rainbowOrder((rainbowScale * (i + startPosition)) % 192));
  }
  // Finally, actually turn the LEDs on:
  leds.show();
}

// Input a value 0 to 191 to get a color value.
// The colors are a transition red->yellow->green->aqua->blue->fuchsia->red...
//  Adapted from Wheel function in the Adafruit_NeoPixel library example sketch
uint32_t rainbowOrder(byte position)
{
  // 6 total zones of color change:
  if (position < 31)  // Red -> Yellow (Red = FF, blue = 0, green goes 00-FF)
  {
    return leds.Color(0xFF, position * 8, 0);
  }
  else if (position < 63)  // Yellow -> Green (Green = FF, blue = 0, red goes FF->00)
  {
    position -= 31;
    return leds.Color(0xFF - position * 8, 0xFF, 0);
  }
  else if (position < 95)  // Green->Aqua (Green = FF, red = 0, blue goes 00->FF)
  {
    position -= 63;
    return leds.Color(0, 0xFF, position * 8);
  }
  else if (position < 127)  // Aqua->Blue (Blue = FF, red = 0, green goes FF->00)
  {
    position -= 95;
    return leds.Color(0, 0xFF - position * 8, 0xFF);
  }
  else if (position < 159)  // Blue->Fuchsia (Blue = FF, green = 0, red goes 00->FF)
  {
    position -= 127;
    return leds.Color(position * 8, 0, 0xFF);
  }
  else  //160 <position< 191   Fuchsia->Red (Red = FF, green = 0, blue goes FF->00)
  {
    position -= 159;
    return leds.Color(0xFF, 0x00, 0xFF - position * 8);
  }
}

This code is changed by sample code downloaded from www.adafruit.com, and the library is also downloaded from http://www.adafruit.com, if any problems of copyright, let me know: [email protected].

How to do when my strip doesn't work

First, I am so sorry that you have to check this module, but it is not hard to make your strip work again. As your strip needs a program controlling, so one of the reason can be the code, check that if you have downloaded the code successfully. You can use the led connected with digital pin13 for the test or use the sample code Blinking.

If you can download the code well, check the power supply, it need 3.3V to 5V but no more than 6V as recommend, and the power also must be able to supply enough current for 1A/m,that means what you have bought from DFRobot is 3m and your power need to supply 3A for the strip, never forget when connect the wire ensure the voltage. If too high voltage has supplied, may good luck be with you because I used to supply more than 6V for a short while bu nothing happen.

OK, no problem with the code or the power, now you need to check whether the led is broken. Unpin the signal pin with Arduino, but let the power supply connect as usual. You need to use a jumper cable like http://www.dfrobot.com/index.php?route=product/product&filter_name=cable&page=2&product_id=130#.Ur2OT7I5uTU to connect the Arduino pin to the second signal point in the strip which means use the jumper cable to connect the Arduino and the strip but not in the origin way for maybe the first led of your strip is broken. For this way, check the third or the fifteenth until the strip shine again.Then cut the broken led off and use the new point for signal point, this step you may need to solder the cable or use a clamp to connect the line.

Documents

  • Part of the library is quoted from Adafriut which is another open source hardware company, and if any copyright problems, email [email protected]

image:nextredirectltr.pngGo Shopping [http weatherproof LED strip [TOY0047]]

category: Product Manual category: DFR Series category: Sensors category:source category:Diagram

⚠️ **GitHub.com Fallback** ⚠️