Go Down

Topic: WS2812b, only two LEDs working (Read 297 times) previous topic - next topic

lucabre

Apr 18, 2020, 06:17 pm Last Edit: Apr 19, 2020, 03:42 pm by lucabre
First of all, im completely new when it comes to this device, i've used it for 45 mins so forgive me. I want to control a WS2812b LED Strip via my Arduino UNO and i use the FastLED Library. For Power Supply i connected it to the 5V pin on the Arduino, Ground to Ground obviously and the Data Pin to Pin 11. I got all of this from a tutorial online, in which they also used a resistor for the Data Pin, which i oversaw and connected it straight without one. It did work but with wrong colors and very bright, so when i noticed my mistake i immediately disconnected the Arduino and put 2 220 Ohm Resistors in between because these were the only ones i had. Now, the LEDs work, but only the first two. When i upload my sketch that is supposed to set the first one red, the second one to yellow and the third to green, the first and second are red and the third is just off. First of all, did i break anything by having no resistor on the data pin? Or am i just missing something really obvious? Thanks for any responses, here's my sketch:

Code: [Select]
#include "FastLED.h"

#define ANZAHL_LEDS 10
#define LED_PIN 11
CRGB leds[ANZAHL_LEDS];

void setup() {
  // put your setup code here, to run once:
  FastLED.addLeds<NEOPIXEL, LED_PIN>(leds, ANZAHL_LEDS);
}

void loop() {
  // put your main code here, to run repeatedly:
  leds[0].setRGB(255,0,0);
  leds[1].setRGB(255,255,0);
  leds[2].setRGB(0,255,0);
  FastLED.show();
}

lucabre

Just to add, my LED Strip has 60 LEDS and in my Sketch i used 10 because i've read that powering more than 10 with just the Arduino can break it, might that be the issue?

Paul__B

Please go back and modify your first post to put the code in "code" tags (the "</>" icon on the posting window).

It is not clear what you ave been doing with the resistors!  Need a diagram.  :smiley-eek:

What are you actually using as a 5 V supply?  The Arduino does not "power" anything, it is not a power supply.

Note that a 60 LED strip will itself draw approximately 60 mA with no LEDs illuminated.  :smiley-roll:

Go Up