Using Multiple Power Supplies with RGB Leds and Arduino

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 3x3 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/

• Wow, those are some whopping big LEDs! – Olin Lathrop Jun 8 '12 at 11:45

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):

• I just set up links to schematics. The Arduino and DC grounds are not connected. Can I connect all 3 grounds together? (do I need to use diodes to the PWM inputs?) Will the PWM work in this case for all 3 seperate power operated LED STRIPS? Thanks. – Michael Jun 8 '12 at 5:37
• Ahh, okay. See updated answer then, you need to connect them all together in order for it to work. – Oli Glaser Jun 8 '12 at 6:15

Your description will be very very very hard on most brains. A drawing - even hand drawn and scanned or photographed, would be better.

IF you are using the Lady ADA diagram exactly it should work.
Note that the MOSFETS:
MUST be logic level with Vth <= 2V.
MUST be N Channel.
MUST match pinout shown.

All TO220 MOSFETS you meet are likely to have this pinout.
If you use the horriuble little BSS170 or whatever MOSFETS they have a different pinout and Vth is far too high.

• Sorry about that. I set up links to schematics because I can't post images due to newbie status. The second schematic works for the one strip, but I don't believe the PWM will work for the other two strips. The first schematic doesn't allow the PWM to work at all. The MOSFETS are TO220, correct pinout. – Michael Jun 8 '12 at 5:36