Go Down

Topic: WS2812B LEDs powered by Arduiono go crazy (Read 1 time) previous topic - next topic

JoGie_

Hello everybody,
I'm totally new to the arduino stuff and also on using LEDs and I really need help, because I don't understand this problem at all.

First of, I'm trying to reattempt this project http://www.instructables.com/id/Make-Your-Own-10x10-LED-Matrix/ which consists of using LEDs to build a frame that is controllable by an arduino.

I already soldered all LEDs into place and bought a fitting power supply (see attachement 3).

I then tried running a simple test code
Code: [Select]
    #include <FastLED.h>
    #define NUM_LEDS 100
   
    #define DATA_PIN 6
        CRGB leds[NUM_LEDS];

       
void setup() {
  // put your setup code here, to run once:
FastLED.addLeds<WS2812B, DATA_PIN>(leds, NUM_LEDS);
}

void loop() {
  // put your main code here, to run repeatedly:
        for(int dot = 0; dot < NUM_LEDS; dot++) {
            leds[dot] = CRGB::Blue;
            FastLED.show();
            // clear this led for the next time around the loop
            leds[dot] = CRGB::Black;
            delay(30);
        }
}

which works just fine, all LEDs light up after each other.

But if I change the color to for example red, all LEDs light up after each other, but in green.
If I change the color to green, they just go crazy:
https://youtu.be/aZOe5NVm2B8

I first tried to power the with my PSU (see attachment 3 and 5) , but they only started blinking and doing random stuff, the PSU also made weird noises, so I power them now with my arduino and USB until the capacitor and resistor arrives (which I read about here http://forum.arduino.cc/index.php?topic=410154.0).

I hope you can help me solving this problem and could explain, why blue works and red gives me problems which I absolutely don't understand.

Thanks in advance.

JoGie_

I somehow can't upload the pictures, I always get
Code: [Select]
413 Request Entity Too Large, so they can be found here:
[1]https://dl.dropboxusercontent.com/u/47611022/Arduino_Bug/1-min_1.jpg
[2]https://dl.dropboxusercontent.com/u/47611022/Arduino_Bug/2-min_1.jpg
[3]https://dl.dropboxusercontent.com/u/47611022/Arduino_Bug/3-min_1.jpg
[4]https://dl.dropboxusercontent.com/u/47611022/Arduino_Bug/4-min_1.jpg
[5]https://dl.dropboxusercontent.com/u/47611022/Arduino_Bug/5-min_1.jpg
[6]https://dl.dropboxusercontent.com/u/47611022/Arduino_Bug/6-min_1.jpg

mcnobby

Are you sure the power supply was 5v ?
Perhaps you have damaged the leds ?
http://www.youtube.com/user/Recovered
http://www.smartshow.lighting

INTP

WS2812B's are GRB, not RGB

FastLED.addLeds<WS2812B, DATA_PIN>(leds, NUM_LEDS);

should be

 FastLED.addLeds<WS2812B, DATA_PIN, GRB>(leds, NUM_LEDS);



Do you have a ground wire from your power supply connected to Arduino ground?

Grumpy_Mike

Quote
First of, I'm trying to reattempt this project http://www.instructables.com/id/Make-Your-Own-10x10-LED-Matrix/
Most instructables are crap and this is no exception. There is no resistor between the data pin and the LEDs, also there is no large capacitor across the supply.

Read how to do it properly here:-
https://learn.adafruit.com/adafruit-neopixel-uberguide/basic-connections

There ought to be a law banning this crappy site.

JoGie_

Are you sure the power supply was 5v ?
Yes, my power supply is definitely rated at 5V:
https://dl.dropboxusercontent.com/u/47611022/Arduino_Bug/3-min_1.jpg

WS2812B's are GRB, not RGB

FastLED.addLeds<WS2812B, DATA_PIN>(leds, NUM_LEDS);

should be

 FastLED.addLeds<WS2812B, DATA_PIN, GRB>(leds, NUM_LEDS);


Do you have a ground wire from your power supply connected to Arduino ground?
Thanks for the tip, I also noticed that when I ran an example script by FastLED, but this also doesn't solve my problem unfortunately.
Most instructables are crap and this is no exception. There is no resistor between the data pin and the LEDs, also there is no large capacitor across the supply.

Read how to do it properly here:-
https://learn.adafruit.com/adafruit-neopixel-uberguide/basic-connections

There ought to be a law banning this crappy site.
I also read about the resistor and capacitor on another thread in this forum and already ordered them. Is it likely that this will solve my problem, or could my WS2812B LEDs already have been damaged by running the project without these components?

INTP

Blinking and going crazy is a symptom of a power supply issue. If only certain colors run as they should, then your program is essentially fine.

JoGie_

#7
Aug 25, 2016, 02:52 pm Last Edit: Aug 25, 2016, 02:57 pm by JoGie_
Blinking and going crazy is a symptom of a power supply issue. If only certain colors run as they should, then your program is essentially fine.
Ok, thanks for your answer.
I will then just wait for the capacitors to arrive and see whether that solves my problem or not :)

oh and btw:
Is there a certain orientation in which the capacitors or resistors have to be soldered on?

INTP

I frankly wouldn't pin too much hope on that, the power brick should have enough regulation in it. How are you physically plugging/unplugging the power to the leds, brick to wall or brick to leds?

JoGie_

I connect/disconnect the PSU directly to the leds, I don't unplug the whole power supply from the wall each time. Should I rather do that?

INTP

Would've been quicker just to try it, no?

JoGie_

It doesn't make any difference wheter I connect/disconnect the PSU directly to the LEDs or to the power.

INTP

Okay, gonna have to take it really slow then.
Remove the for loop from the code, extend the delay, and manually manipulate the led number and colors.
So, be able to turn on an led to different colors. It's a good learning exercise to lead into making your own animations, but can help with troubleshooting, too.

Grumpy_Mike

#13
Aug 25, 2016, 05:41 pm Last Edit: Aug 25, 2016, 05:42 pm by Grumpy_Mike
Quote
Is there a certain orientation in which the capacitors or resistors have to be soldered on?
Resistors no, electrolitic capacitors yes.

If you get a capacitor the wrong way round it will explode.

The capacitors are marked with + and - to show you the right way to connect it. Sometimes however, just the - is marked.

JoGie_

Hi,
sorry for the late response, I had to wait for the resistors and capacitors to arrive.

I already figured out a solution by powering each LED after each other and when I toggled one LED, others changed their colors and went crazy. After replacing the failing LEDs, everything works fine now.

Thanks for your answers!

Btw: Soldering in the capacitors worked fine, but when I add a resistor, the LEDs receive no signal from my Arduino.. :(

Go Up