WS2812 problem. Are they damaged?

Hello everyone. I got a Mega board and 1m of ws2812 LED strip and I thought its going to be easy getting it to work. It isn't! I connected the ground and 5V of the leds to a 5V supply, connected the grounds of the supply and Arduino, and connected output 6 of the board to the DI on the strip. Then I tried different examples of NeoPixels and FastLed and none of them are working. To better explain the problem: I get a waveform on pin 6, kind of looks like a PWM, I think it is fine (how can I check?) I applied this output to the DI input of first LED, but there is nothing at its output on an oscilloscope. I applied this output to the DI input of other LEDs (in case the first LED was damaged) but still I see nothing at their DO output. When I switch the supply off and on, most of the times LEDs remain unlit, but some times most of them are lit blue, and some green.

Now, in the beginning I had connected the LED strip without the 1000uF capacitor, and pin 6 directly to the DI without any series resistor. Do you think the LED drivers are damaged? Has anyone else had this problem before?

Cheers

Post the code you are using. Show or describe your setup. How many LEDs. How much power are you giving them.

The chances the LEDs are to blame are pretty low. Unless you fried them. Don't be one of those guys who set something up wrong and their first conclusion is the device is broken.

Need to see your code to see what you're working with and if you have it set up correctly.

This is one example of the code that I tried. I tried others from FastLED and NeoPixels as well without success.

#include "FastLED.h"

// How many leds in your strip?
#define NUM_LEDS 60

// For led chips like Neopixels, which have a data line, ground, and power, you just
// need to define DATA_PIN.  For led chipsets that are SPI based (four wires - data, clock,
// ground, and power), like the LPD8806 define both DATA_PIN and CLOCK_PIN
#define DATA_PIN 6
#define CLOCK_PIN 13

// Define the array of leds
CRGB leds[NUM_LEDS];

void setup() { 
      // Uncomment/edit one of the following lines for your leds arrangement.
      // FastLED.addLeds<TM1803, DATA_PIN, RGB>(leds, NUM_LEDS);
      // FastLED.addLeds<TM1804, DATA_PIN, RGB>(leds, NUM_LEDS);
      // FastLED.addLeds<TM1809, DATA_PIN, RGB>(leds, NUM_LEDS);
      // FastLED.addLeds<WS2811, DATA_PIN, RGB>(leds, NUM_LEDS);
      // FastLED.addLeds<WS2812, DATA_PIN, RGB>(leds, NUM_LEDS);
      // FastLED.addLeds<WS2812B, DATA_PIN, RGB>(leds, NUM_LEDS);
      FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS);
      // FastLED.addLeds<UCS1903, DATA_PIN, RGB>(leds, NUM_LEDS);
      // FastLED.addLeds<UCS1903B, DATA_PIN, RGB>(leds, NUM_LEDS);
      // FastLED.addLeds<GW6205, DATA_PIN, RGB>(leds, NUM_LEDS);
      // FastLED.addLeds<GW6205_400, DATA_PIN, RGB>(leds, NUM_LEDS);
      
      // FastLED.addLeds<WS2801, RGB>(leds, NUM_LEDS);
      // FastLED.addLeds<SM16716, RGB>(leds, NUM_LEDS);
      // FastLED.addLeds<LPD8806, RGB>(leds, NUM_LEDS);

      // FastLED.addLeds<WS2801, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
      // FastLED.addLeds<SM16716, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
      // FastLED.addLeds<LPD8806, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
}

void loop() { 
  // Turn the LED on, then pause
  leds[0] = CRGB::Red;
  FastLED.show();
  delay(500);
  // Now turn the LED off, then pause
  leds[0] = CRGB::Black;
  FastLED.show();
  delay(500);
}

The setup looks like this:

Arduino Mega is connected via USB. Data pin 6 is connected to DI on the LED strip via a 470 Ohm resistor. GND of the board is connected to GND of the strip. The +5V of the strip is connected to a +5V (3A rated) power supply. Supply’s ground is also connected to Arduino and LED strip grounds.
A 2200uF and 10uF parallel capacitors are placed between +5V and ground. There are 60 LEDs overall. I have bought the strip from China, they are slightly different, from top to bottom on the strip is GND, DI and +5V but that shouldn’t matter. In the code, I have tried putting the setting of LED type to NeoPixel, WS2812 and WS2812b but I have had no success.

As I mentioned, I have applied the digital output of pin 6 to DI of different LEDs and I have observed the DO of the LED with an oscilloscope, there is no data in any of the outputs.

WS2812's already have resistors, try it without. Uncomment the correct type of LED and leave that part alone, that's not the problem.

If taking out the resistor doesn't fix it, troubleshoot by ditching the power supply and powering it directly from the Arduino (5v to 5, GND to GND, pin6 to DIN) no resistor. The code is only dealing with the first LED for testing.

Quick edit: Problem solved! Thanks INTP, you were right, no additional resistors where needed. The problem was that the first LED is damaged, when I manually connect pin 6 to DI on the second LED the rest of LEDs work just fine. Cheers

I have tried with and without resistor. I have also tried powering it directly from Arduino, but it still doesn't work. All LEDs remain unlit. Why is that none of the LED/WS2812s seem to pass the DI to DO? Why do you think some of them remain blue or green sometimes when the power is applied?

Your first LED may not be damaged. Select/uncomment the WS2812B addleds line instead of neopixels and see if that works.

That resistor between DI and the Arduino output IS necessary. It should be a value > 470ohms, 2k at least. (It's not for current limiting the LED modules.)

[quote author=Runaway Pancake link=msg=2875267 date=1470759205] That resistor between DI and the Arduino output IS necessary. It should be a value > 470ohms, 2k at least. (It's not for current limiting the LED modules.) [/quote]

I have seen in many tutorials and many forum posts that the resistor IS in fact necessary. But the thing is that it didn't work for my circuit. Maybe it depends on the LED strip? Mine is one of these cheap Chinese ones. I will test it tomorrow and post the results for probable future readers.

That diagram shows LEDs that have 6 pins, that's an older the design, the newest ones only have 4. I'm guessing you have the newest one, WS2812B.

WS2812 = 6 pins WS2812B = 4 pins

Help to know what you actually have, in some cases of coding it matters.

INTP: That diagram shows LEDs that have 6 pins, that's an older the design, the newest ones only have 4. I'm guessing you have the newest one, WS2812B.

WS2812 = 6 pins WS2812B = 4 pins

Help to know what you actually have, in some cases of coding it matters.

Mine have 4 pin, and I also know from when I bought them that that they are WS2812B.

But the thing is that it didn't work for my circuit. Maybe it depends on the LED strip?

No more than likely you:- 1) Had the wrong value, 470R is yellow, violet, brown 2) The circuit was wrong, meaning that there was no electrical connection where you thought there was one.

Yes it will work without the resistor but it is necessary to include it to prevent any damage to the first LED when you have the incorrect sequence of power supply rail bring up.