1

I'm trying to use FastLed on some WS2811 led strips but I get a weird behaviour. I'm using a simple code to debug the issue but still not working. Some leds are red but most are blue. I tried all the different LED strip type available in the FastLed Blink example without much difference.

#include <FastLED.h>

#define NUM_LEDS 30
#define DATA_PIN 6

CRGB leds[NUM_LEDS];

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

void loop() {
  for (int pos = 0; pos != NUM_LEDS; pos++) {
    leds[pos] = CRGB::Red;
  }
  FastLED.show();
  delay(500);
}

LED strip

LED strip picture

LEDs are powered with an external 12v power supply (https://www.amazon.com/gp/product/B00D7CWSCG).

Arduino is powered with a usb cable from my PC.

I tried with a Arduino Mega and Arduino Nano no difference. Schematic

(No the correct led strip, I have a WS2811 but it's the closest I found)

Any idea what can be the issue? Thanks

Joel Spolsky
  • 33,372
  • 17
  • 89
  • 105
Marchah
  • 160
  • 14
  • the leds are powered with a external 12v power supply and the arduino with my PC (I edited my question to add those infos) – Marchah Mar 26 '19 at 19:54
  • what do you mean by _both_ ends? do i need to close the circuit? – Marchah Mar 26 '19 at 19:58
  • 1
    The power supply in question doesn't matter if you don't show a schematic of how you've got things wired. Please add a schematic. – stevieb Mar 26 '19 at 20:30
  • i added a schematic to the question – Marchah Mar 26 '19 at 21:49
  • 2
    have you connected the grounds of the arduino and the power supply together? – Fitzi Mar 26 '19 at 21:54
  • no the arduino is only connected to the data pin of the led strip, i will try that i report the result thanks – Marchah Mar 26 '19 at 21:58
  • they are 12v LED strip, the arduino is powered by a usb cable. Datasheet for the led strip? i don't have anything they were cheap LED strip and the online listing is not available anymore. How can i protect the GPIO? – Marchah Mar 26 '19 at 23:22
  • thanks by grounding the arduino to the power supply and changing RGB to BRG it's works. But it look like i can only address the led by block of 3, did i got the wrong type to address them one by one? (added a picture of the led strip in the question) – Marchah Mar 27 '19 at 01:19

1 Answers1

2
  • This was already answered in the comments, but, yes, you need to connect the ground from the power supply to the arduino GND pin.

  • I don't recognize that LED strip but it does physically look, from the picture, like it only lets you set colors in blocks of 3.

Joel Spolsky
  • 33,372
  • 17
  • 89
  • 105