ADAFRUIT 240LEDS/4m RGBW with 5V/10A making random colors

Hi everybody,

For a friend I'm making a project with leds strip.
So he give me all the items:

  • Arduino Mega 2560
  • Shield V2.2
  • Touchscreen display 3.2"
  • Power supply 5V / 10A (Lien)
  • Adafruit RGBW 60LEDS/m - 4m (Lien)

The Strange thing is this: I tested the LEDS without the display, with the power coming from the Arduino. That was working perfectly.
Because I need more power for the application, I needed the power supply for the Ledstrip.

But when I tried with the power supply and just a test code, it is like the leds are taking a random color, even Leds that I didn't adressed with a color.

I checked the power supply, it is at 5.2V at the beginning of the strip and 4.8 at the end.
And the documentation of adafruit is saying that it is OK for 5V, maximum 6V input.
So it seems OK.

From the arduino, thre is a 470 Ohm resistor between the DIN pin and the PWM pin from arduino.
But I reeded that somebody is using a 100µF capacitor between the 5V and the GND, do I need it?

Do you know where this bug can came from?

Below you'll find the code to test it.

#include <UTFT.h> 
#include <URTouch.h>
#include <Adafruit_NeoPixel.h>

#define LED_PIN  9
#define NB_LED   240

//==== Creating Objects
UTFT    myGLCD(ILI9341_16,38,39,40,41); //Parameters should be adjusted to your Display/Schield model
URTouch  myTouch( 6, 5, 4, 3, 2);
Adafruit_NeoPixel strip = Adafruit_NeoPixel(NB_LED, LED_PIN, NEO_GRBW + NEO_KHZ800);

//==== Defining Variables
extern uint8_t SmallFont[];
extern uint8_t BigFont[];
extern uint8_t SevenSegNumFont[];


int x, y;

char currentPage, selectedUnit;

// RGBW LEDs
int GreenLed = 0;
int RedLed = 0;
int BlueLed = 50;
int WhiteLed = 0;
int Tempo = 200;

// ====== Main Funtions ======

void setup() {
// Initial setup
  myGLCD.InitLCD();
  myGLCD.clrScr();
  myTouch.InitTouch();
  myTouch.setPrecision(PREC_MEDIUM);


  //Setup des LEDS
  strip.begin();
  strip.show(); // Initialise tous les pixels à 'off' 
  
  //Setup de l'écran
  drawHomeScreen();  
}

void loop() { 
  // Home Screen
   for (int i = 0; i < (NB_LED/2); i++) {
   strip.setPixelColor(i, RedLed, GreenLed, BlueLed, WhiteLed);
  strip.show();
  delay(Tempo);
  }
  delay(1000);
}

Thanks,

Alex

You can also ask in the French forum if you like.

240 leds, each requiring 60mA, is a total of 14.4A. So unless you declare that the brightness is less than 69% this problem may come from your supply (amps and not volts).

Have you tried your code with a lower value for NB_LED, such as 100 for example?

But I reeded that somebody is using a 100µF capacitor between the 5V and the GND, do I need it?

Yes and a bit bigger than that actually. I would use a capacitor between 1000 and 4700uF.

lesept:
You can also ask in the French forum if you like.

240 leds, each requiring 60mA, is a total of 14.4A. So unless you declare that the brightness is less than 69% this problem may come from your supply (amps and not volts).

Have you tried your code with a lower value for NB_LED, such as 100 for example?

As you can see in the code I linked, I used for the test only the blue led up to 50/255.
And the number of leds, I limited it to 120 instead of 240.

So it should be using less than 1A so I don't think that it's coming from the amps.
But yes, I tried also to just light up 5 leds only, same result.

Grumpy_Mike:
Yes and a bit bigger than that actually. I would use a capacitor between 1000 and 4700uF.

OK, then I will try that. But, I don't see what a capacitor between +5V and GND in parallel can help?
About this, do I need a "big" 1.5mm² wire that can support 10A or can I just use the small 0.2mm² for the bridge between +5V and GND with a 4700µF capacitor?

But, I don't see what a capacitor between +5V and GND in parallel can help?

That is why you are asking questions and I am answering them. It helps to smooth out voltage variations caused by large short changes in current draw. These voltage variations cause chips to not work correctly. The whole field is known as supply decoupling and it is essential it is not optional.

You need the capacitor to be capable of handling the large ripple current the strip creates. If it can then the manufacturers ensure the capacitor leads are up to the job. You must cut them down to be as short as possible to minimise the stray inductance that they will present, to keep the capacitor acting as a capacitor.

Thanks for your answer Mike,

So with your advice, I can just use a 10mm length of 0.2mm² wire cable to connect the capacitor, between the + and - of the power supply that's it?

that's it?

Yes, but are they not leads that long on the capacitor already?

Right but I thought that maybe it was better to add some wire.
But you're right, I will use it directly between the pins

amalard:
Right but I thought that maybe it was better to add some wire.

Hmmm. What was your thought process on that?

And - the capacitor does not go across the power supply terminals (because there is already one in the power supply!), it goes between the 5 V and ground terminals on the LED strip itself.

Similarly, though it may not be so important, the 470 Ohm resistor in series with the data wire goes at the connection to the LED strip itself.

An example here :

Thanks for your help.

But, on the image below it is between the terminals of the power supply, isn't it?

lesept:
An example here :

But, on the image below it is between the terminals of the power supply, isn't it?

Electrically speaking the between the terminals of the power supply and across the 5V supply is the same place.

But physically it is closer to the LED strip than it is to the power supply which is on the end of that long black cable. The closer to the LED strip the more effective it is, but the margins are small.

That photograph shows the capacitor attached to the end of the power supplie's lead. If you want to move it actually onto the strip it will be more effective but often it is physically easier to connect it where it is shown, and compared to not having a capacitor at all, there is little difference having it a little bit away from the best place.

As shown, the distance between the capacitor and LED strip is a lot shorter than the metre or more length of the cord to the power block.