WS2811 LED's are not lit up properly

hi,
I'm hoping this is the correct forum to post my (first) question.
If not please let me know what the right place would be. - Thanks

I have a problem with my first test of a LED strip.
This is my configuration

  1. Arduino Uno R3 powered via 5v power supply
  2. 1x 12V WS2811 RGB Led strip 1mtr, 30 LED's
  3. 12V Power supply (for LED strip)
  4. Example sketch with FastLED library. (30 LED, pin 3)
/// @file    myTest01.ino
/// @brief   lit up all LEDS, wait and set them 'black'
/// @example myTest01

#include <FastLED.h>

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

#define DATA_PIN 3
#define CLOCK_PIN 13

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

void setup() { 
        FastLED.addLeds<WS2811, DATA_PIN, RGB>(leds, NUM_LEDS);
    
}

void loop() { 
  // Turn the LED on, then pause
  for ( int i = 0; i < NUM_LEDS; i++) {
    leds[i] = CRGB::Red;
    
  }
  // now show them all
  FastLED.show();
  delay(500);

  // Now turn the LED off, then pause
  for ( int i = 0; i < NUM_LEDS; i++) {
    leds[i] = CRGB::Black;
    
  }
  FastLED.show();

  delay(2000);
}

/ *********************************

Compiled and uploaded to the board, only ~20 LED's are lit up on the strip.

My suspicion is that the LED strip is faulty.
I repeated the test with a 3mtr strip and here also not all LED are lit up.

Is there something I did not right or can it be that both strips are faulty?

What can I do to do some further trouble shooting.
Any feedback is much appreciated
Thanks in advance

I'll attach a brief drawing of the circuit I'm currently using.

Connect Arduino GND to LED power (-). That data signal needs a reference, GND is it.

2 Likes

What is the capacity of your PS? (How many Amps is it rated for)

It is possible your power is not sufficient. WS28x will reboot the sketch, freeze and be random.

not in my case.

The power supply has 3A.

Before we go further, did you note post # 2?

I did that and now it's running better.
However, I did another test (different sketch, same setup).

#include <FastLED.h>

// describe the LED
#define NUM_LEDS 30
#define DATA_PIN 3

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

void setup() { 
    // Uncomment/edit one of the following lines for your leds arrangement.
    // ## Clockless types ##
    FastLED.addLeds<WS2812B, DATA_PIN>(leds, NUM_LEDS);  // GRB ordering is assumed
}

void loop() { 
  for(int i = 0; i < NUM_LEDS; i++) {
   leds[i] = CRGB::Blue;

  }
  // Turn the LED on, then pause
  FastLED.show();
  delay(2000);

  for(int i = 0; i < NUM_LEDS; i++) {
    leds[i] = CRGB::Green;

  }
  delay(2000);

  for(int i = 0; i < NUM_LEDS; i++) {
    leds[i] = CRGB::Black;

  }

  // Now turn the LED off, then pause
  leds[0] = CRGB::Black;
  FastLED.show();
  delay(5000);
 
}

In this case the colour from the 1st for ( int i = 0 ....... { .... } is not showing up ('Green'), only the 2nd is visible.

I tried also FastLED.addLeds<WS2811,..., FastLED.addLeds<WS2812,..., same results.

I'm thinking perhaps the LED is getting to much power. Should I try to hook up a resistor or capacitor?
Any advice is much appreciated.

Is the LED strip 5v or 24v? I see you really want to blame the LED strip. Always add a 470 ohm resistor on the data leg and a 1000uF electrolytic capacitor across power.

Did you want to try fixing your code first? Try actually calling
FastLED.show();
after you change colour each time.

oops. Is the only thing I can say.
I fixed that and made a slight modification.

#include <FastLED.h>
#define NUM_LEDS 30
#define DATA_PIN 3
CRGB leds[NUM_LEDS];

void setup() { 
   FastLED.addLeds<WS2811, DATA_PIN>(leds, NUM_LEDS);  // GRB ordering is assumed
   //FastLED.addLeds<WS2812, DATA_PIN>(leds, NUM_LEDS);
   //FastLED.addLeds<WS2812B, DATA_PIN>(leds, NUM_LEDS);
}
void loop() { 
  for(int i = 0; i < NUM_LEDS; i++) {
   leds[i] = CRGB::Blue;
  }
  FastLED.show();
  delay(2000);

  for(int i = 0; i < NUM_LEDS; i++) {
    leds[i] = CRGB::Green;
  }
  FastLED.show();
  delay(2000);

  for(int i = 0; i < NUM_LEDS; i++) {
    leds[i] = CRGB::Black;
  }
  leds[0] = CRGB::White;
  FastLED.show();
  delay(2000);

  leds[0] = CRGB::Black;
  FastLED.show();
  delay(5000);
}

And it shows the following colours: a) 'Green', b) 'Red' and c) 'white on LED[0-2].
I tried the following drivers: 1) WS2811, 2) WS2812 and 3) WS2812B.
Is that a problem with the LED strip or still the code?
I assume the code is not bug-free, isn't it?

I'm waiting for the delivery of a NeoPixel ring to test with another LED strip.
Cheers

PS: Is there no 'preview' of the post in this forum available before submitting?

It is to the right of your edit box.

As mentioned in my initial post, the LED is a 12V strip.
And no, I don't want to blame anyone or anything.
It's just my assumption as noob :slight_smile:

Thanks for the tip re. resistor and capacitor.
Always good to learn new things.

You can test code in the Wokwi.com simulator. Get a free account. Click the blue "+", select a device (like the Neopixel Ring) and connect the wires (the simulator does not need resistors or capacitors).

"Black" is a "not a color" and turns the neopixels off.

Verify your code matches your physical strand. Try BRG, BGR and RGB.

Here is a simulation of your code, with RGB rather than GRB. Blue, "green" (red), black, white, black.
ezgif-4da29cd95257d

Thank you so much.
The hint with the GRB ordering was excellent.
After some testing I found out the proper calibration(BRG).
This was a new detail to me. Its never too late to learn new things.
The next is to figure out why instead of 1 LED (leds[0]) three LED's are being lit up (on a different sketch).

Thanks again

WS2811 counts by three, and use three LEDs per leds[]. If you were to use leds[0] and leds[1] you should see six light. Sorry for the worst description ever. I can't "word" today.

This from one of the more legible "datasheet" links: WS2811 Everything You Need To Know - LEDSuntech

WS2811 12V LED Strip: Three RGB lights can be cut and one WS2811 IC controls the brightness and color of these three lights at the same time.

Cons of WS2811:
The minimum control granularity is 3 LEDs because one IC controls 3 LEDs.
High power consumption due to operation under 12V voltage.
The 8-bit data limitation for each color results in a less smooth dimming curve.
No data redundancy is available.

1 Like

Thanks for the link to the datasheet.
Its way better than the information provided by the supplier @ AliExpress.

One last question, the strip has 2 sets of wire connected to it
a) a three-wire set with connectors, and
b) two single 'loose' wires (no connectors, red&white)

Do you happen to know in which cases those two wires are being used?
Are these 12V & GND wires?
Are they're used in addition to the three-wires-set?

Apologize for asking. :slight_smile:

The three wire is data, vcc, gnd and the two wire is vcc, gnd. The two wire is for "power injection" (search ws2812 power injection) to keep the colors from fading due to the resistance in the copper wires carrying power, and effected by LEDs per meter.

THANK YOU! That solved my problem :slight_smile: A lot of "instructables" don't show that.
Now it's working perfectly.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.