0

MEGA + LEDSTRIP 4m = Random colors without adressing them
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

MEGA + LEDSTRIP 4m = Random colors without adressing them

by AlexFr on Thu Oct 11, 2018 1:49 pm

Hello,
On a project, I use a Ledstrip 60Leds / m RGBW with an Arduino Mega 2560.

When I use the power supply (5V / 10A) on the ledstrip and that I made a little code just to test it (just light up the blue led from the 10 first leds at 50/255 intensity), I get just random colors on the half ledstrip and all off of the other half.
What is strange is that when I just test with powering the ledstrip by the arduino it was working well.

I get a 470 Ohm resistor between arduino and the DIN from the Ledstrip.
The links are:

+5V on the strip -> Power supply +
GND on the strip -> Power supply -
DIN on the strip -> Resistor 470 Ohm -> Arduino
GND (linked with DIN) on the strip -> Nothing

And the Arduino is getting power from USB.
I checked the voltage, at the input of the strip is around 5 - 5.2V and at the end of the strip it is around 4.8-4.9V

Do you have any idea?

Thanks,
Alex

AlexFr
 
Posts: 6
Joined: Thu Oct 11, 2018 1:37 pm

Re: MEGA + LEDSTRIP 4m = Random colors without adressing the

by nickine9 on Fri Oct 12, 2018 6:03 am

have you got a common ground connection for the board and strip?

nickine9
 
Posts: 86
Joined: Fri Jan 06, 2017 4:14 am

Re: MEGA + LEDSTRIP 4m = Random colors without adressing the

by adafruit_support_bill on Fri Oct 12, 2018 7:14 am

+5V on the strip -> Power supply +
GND on the strip -> Power supply -
DIN on the strip -> Resistor 470 Ohm -> Arduino
GND (linked with DIN) on the strip -> Nothing

You need a ground connection between the Arduino and the strip.

adafruit_support_bill
 
Posts: 70055
Joined: Sat Feb 07, 2009 10:11 am

Re: MEGA + LEDSTRIP 4m = Random colors without adressing the

by AlexFr on Fri Oct 12, 2018 1:56 pm

First,
Thaks for your answers!

OK, but it is OK to have 2 différents GND on ne same pin?
Like, if I connect GND to the - part of the power supply and the other cable to the GND of the Arduino, it is OK?

Also, I Don't have any capacitor between the + and the - of the power supply. It is ok to put a 4700µF capacitor?

AlexFr
 
Posts: 6
Joined: Thu Oct 11, 2018 1:37 pm

Re: MEGA + LEDSTRIP 4m = Random colors without adressing the

by adafruit_support_bill on Fri Oct 12, 2018 2:18 pm

Like, if I connect GND to the - part of the power supply and the other cable to the GND of the Arduino, it is OK?

It is more than OK. It is necessary. That is why there are two ground wires. The ground is the reference voltage for the signal. If the Arduino and the pixels do not have the same ground voltage, the signal is unpredictable.

Also, I Don't have any capacitor between the + and the - of the power supply. It is ok to put a 4700µF capacitor?

Yes. That is a good idea to protect your pixels from power-on spikes:
https://learn.adafruit.com/adafruit-neo ... e/overview

adafruit_support_bill
 
Posts: 70055
Joined: Sat Feb 07, 2009 10:11 am

Re: MEGA + LEDSTRIP 4m = Random colors without adressing the

by AlexFr on Fri Oct 12, 2018 3:10 pm

Thank you very much!
I will try that tomorrow, hope that is the solution of the problem :)

I thought that it isn't possible to have 2 different grounds connected to the same pin. (Sorry about my very low skills in electronics...)

AlexFr
 
Posts: 6
Joined: Thu Oct 11, 2018 1:37 pm

Re: MEGA + LEDSTRIP 4m = Random colors without adressing the

by adafruit_support_bill on Fri Oct 12, 2018 3:18 pm

It is true that improper grounding can cause problems. But it is safe to follow the connection advice in the guides.
https://learn.adafruit.com/adafruit-neo ... -practices
When connecting signals between different circuits, a common ground connection is essential for communication between them.

adafruit_support_bill
 
Posts: 70055
Joined: Sat Feb 07, 2009 10:11 am

Re: MEGA + LEDSTRIP 4m = Random colors without adressing the

by AlexFr on Sat Oct 13, 2018 4:33 am

So it is possible and OK to have 2 differents grounds connected to the same GND? Do it would it be risky for the Arduino and the TFT display or not?
Because on the advices, you are saying about a commun GND, but so doing that is making a commun GND?

Thanks,

AlexFr
 
Posts: 6
Joined: Thu Oct 11, 2018 1:37 pm

Re: MEGA + LEDSTRIP 4m = Random colors without adressing the

by adafruit_support_bill on Sat Oct 13, 2018 5:45 am

So it is possible and OK to have 2 differents grounds connected to the same GND?

If you want the two devices to talk to each other, then they MUST have a common ground.

adafruit_support_bill
 
Posts: 70055
Joined: Sat Feb 07, 2009 10:11 am

Re: MEGA + LEDSTRIP 4m = Random colors without adressing the

by AlexFr on Sat Oct 13, 2018 6:53 am

adafruit_support_bill wrote:
So it is possible and OK to have 2 differents grounds connected to the same GND?

If you want the two devices to talk to each other, then they MUST have a common ground.


Sorry if my question wasn't clear.
To do a common ground, what do I have to do?

- Connect the pin(-) of the power supply to one of the strip GND wire and connect the arduino GND to the other strip GND wire? (like in the schematic "LEDS 1")
or
- Connect the pin (-) of the power supply to the GND of the arduino and to the strip GND? (like in the schematic "LEDS 2")

I hope is the first soution OK.

Thanks
Attachments
LEDS 1.JPG
LEDS 1
LEDS 1.JPG (37.79 KiB) Viewed 79 times
LEDS 2.JPG
LEDS 2
LEDS 2.JPG (37.17 KiB) Viewed 79 times

AlexFr
 
Posts: 6
Joined: Thu Oct 11, 2018 1:37 pm

Re: MEGA + LEDSTRIP 4m = Random colors without adressing the

by adafruit_support_bill on Sat Oct 13, 2018 7:07 am

The first diagram is a better configuration than the second.

adafruit_support_bill
 
Posts: 70055
Joined: Sat Feb 07, 2009 10:11 am

Re: MEGA + LEDSTRIP 4m = Random colors without adressing the

by AlexFr on Sun Oct 14, 2018 5:06 pm

Thanks,
I tried the first diagram and this is working, thanks!
But Something Strange appear sometimes:
Sometimes, the first LED is lighting in green even if there is no instruction. And sometimes, it is working perfectly.

Do you know here it can come?

Thanks!

AlexFr
 
Posts: 6
Joined: Thu Oct 11, 2018 1:37 pm

Re: MEGA + LEDSTRIP 4m = Random colors without adressing the

by adafruit_support_bill on Sun Oct 14, 2018 7:52 pm

The initial power-up state of the pixels is not defined. The majority do power up in the 'off' state. But occasionally some will power up in some random color.

adafruit_support_bill
 
Posts: 70055
Joined: Sat Feb 07, 2009 10:11 am

Please be positive and constructive with your questions and comments.