Hi,
For a home project I am doing, I planned on using 3 meter WS2813 LED strip with a motion sensor to automatically turn ambient lights on. However, I am having trouble getting the strip to work reliably.
The problems:
- The LED strip does not turn on at all when using a 220 or 470 ohm resistor on the data pin.
- The LED strip flashes random colors after being on for a while.
My setup is wired up as follows:
The PSU is this exact unit: https://www.conrad.nl/p/mean-well-lpv-100-5-led-transformator-constante-spanning-60-w-0-12-a-5-vdc-niet-dimbaar-pfc-schakeling-overbelasti-1293711
To upload sketches I remove the barrel jack power supply and power the Arduino using my (android) tablet.
The LED strip is mounted on an aluminium rail.
I followed the tutorial on Circuitgeeks the wiring. (I cannot put two links in apparently).
First script ran is the first script from Circuitgeeks.com, three LEDs in red, green and blue turn on only if I remove the 470 ohm resistor on the data pin. Although everywhere the resistor is recommended I cannot get the strip to do anything with the resistor attached. I left this running for around 1,5h to see if it would also glitch. Upon returning, LEDs were off. After resetting everything a couple of times, the three LEDs randomly turn on or off at each reset.
#include <FastLED.h>
#define DATA_PIN 3
#define NUM_LEDS 8
#define BRIGHTNESS 64
#define LED_TYPE WS2812B
#define COLOR_ORDER GRB
// Define the array of leds
CRGB leds[NUM_LEDS];
#define UPDATES_PER_SECOND 100
void setup() {
FastLED.addLeds<LED_TYPE, DATA_PIN, COLOR_ORDER>(leds, NUM_LEDS);
FastLED.setBrightness(BRIGHTNESS);
}
void loop() {
// Turn the LED on
leds[0] = CRGB::Red;
leds[1] = CRGB::Green;
leds[2] = CRGB::Blue;
FastLED.show();
delay(10);
}
Second script is where the real fun starts.
First attempt I defined NUM_LEDS 178 to turn all the LEDs on. The program ran fine for about an hour, after which the whole strip flashes random colors until I remove the data pin. After resetting everything, the problem persists. After retrying just now, the strip does not turn on at all.
include <FastLED.h>
#define DATA_PIN 3
#define NUM_LEDS 18
#define BRIGHTNESS 64
#define LED_TYPE WS2812B
#define COLOR_ORDER GRB
CRGB leds[NUM_LEDS];
#define UPDATES_PER_SECOND 100
void setup() {
FastLED.addLeds<LED_TYPE, DATA_PIN, COLOR_ORDER>(leds, NUM_LEDS);
FastLED.setBrightness(BRIGHTNESS);
}
void loop() {
for (int i = 0; i < NUM_LEDS; i++) {
leds[i] = CRGB::Red;
delay(50);
FastLED.show();
}
for (int i = 0; i < NUM_LEDS; i++) {
leds[i] = CRGB::Blue;
delay(50);
FastLED.show();
}
}
//https://www.circuitgeeks.com/ws2812b-addressable-rgb-led-strip-with-arduino/
What am I doing wrong here? Any help would be much appreciated!

