Electronic – arduino – Using Multiple Power Supplies with RGB Leds and Arduino

arduinoledpowerpower supply

I'm trying to control 3x 5m RGB LED strips using an Arduino Mega's PWM pins. Building off ladyada's tutorial: http://www.ladyada.net/products/rgbledstrip/. I created a 3×3 bank of N-channel mosfets, each being supplied by a seperate 12V, 5a power supply. As a diagram if each P is its own 12V DC power supply (P1 powering led strip 1, etc.) , and M is a mosfet:

    R  G  B

P1 – M -M -M (per mosfet: left leg pwm, middle leg to led rgb power strip, right leg ground)
P2 -M -M -M
P3 -M -M -M

I can't seem to get each row to be controlled by pwm when supplying power directing to the mosfets.

To test, I powered P1 with DC power and had the arduino plugged into USB. The colors remained fixed blue despite a script that was to cycle colors. When I powered the same row through the Vin and ground through the arduino, everything worked fine.

Why is this? Is there any way to power each row without utilizing the arduino Vin? Can I use 3 seperate power supplies and one Arduino Mega to do this? Or do I need to get 3 arduino unos or equivalents?

Thanks,
Michael

Here are two schematics. The first the arduino is plugged into a USB, and each bank of mosfets is connected to its own power source. The second the arduino Vin is powering one of the banks but not the other two.

(Because I'm a new user I can't upload photos, but they can be found here:
http://www.flickr.com/photos/80053489@N06/7165312673/
http://www.flickr.com/photos/80053489@N06/7165313015/

Best Answer

Do you have the DC supplies and Arduino grounds connected together? If not then any PWM from the Arduino will not work.
Most small plug type DC supplies are floating, so their grounds will not be connected to USB ground (of course the USB ground may be floating if e.g. on laptop battery)

As Russell mentioned a diagram of your connections would be useful.

Thanks for the diagrams:

Your problem is as stated above, you need to connect the grounds together. Otherwise, the Arduino PWM signal has no return path (remember a voltage is always relative to something) to Arduino ground since the grounds are not connected.
It's okay to connect all the grounds together (arduino and DC supplies)
The only time is isn't is in the very rare case where you might have a supply "ground" that is above earth ground relative to supply grounds (e.g. a 20 V supply with V+ at 50V and V- at 30V relative to earth/AC ground could not be connected to a 20V supply with V+ at 20V and V- at 0V)
If in doubt you can test for any voltage between the grounds with a multimeter (e.g. one probe to one ground, one to the other ground) but since most DC supplies are floating (not referenced to earth ground) then essentially the outputs are just like batteries.

Hope I haven't confused things here :-) Connect them together and let us know how it goes. Here's an altered version of your diagram (note extra black ground lines):

RGB strip grounding