Dealextreme 12V 5m RGB LED strip pwm control.

Hello all.
I'm quite new to Arduino and electronics in general.

I have played around with a few different sets of 5 meter 12 volt RGB LED strips from dealextreme.com
I'd love to be able to control these via pwm from my arduino mega, preferably at least 6 rgb strips at one time.

I've played around a bit with rgb pwm code using a few individual LEDs hooked directly to the arduino in both common anode and common cathode configs.
I don't know how to go about controlling and powering the 12 volt strips I have though.

I don't have specs for the strips, they run fine from a 2 amp power supply though, I have run 6 strips from a 10 amp supply for days on end no problem.
I have power supplies to use, I'm just unsure as to how to connect the strips to the arduino so I can still power the strips from their higher powered supply.
I do know that I have common anode strips mostly, they're the ones I want to work on now. I do have some chaser strips with three separate rgb channels that are common cathode that I'd like to play with eventually too though.

Here is a link to an example of what I have: http://www.dealextreme.com/p/rgb-150x5050-smd-led-multicolored-light-strip-5-meter-dc-12v-41523

Any help much appreciated.

well after some head scratching and googling I've come up with this:

The fets are STP16NF06 and the LED is representing the 12V RGB strip.

Look any good?

Still me...

Hooked it up and it worked!

Looking for some code to play with now.
I'd like to try figure out how to come up with some different rgb patterns that can be switched between with a button or dial. I'd also like a couple of sliders/dials for speed and brightness.

Anyone got some better tips than google for where to start looking?

I've got some rgb cycling happening now thanks to some code ripped off the net but I'd love to get some help with coding my own stuff. That part is completely new to me.
If anyone can point me towards some good tutorials on coding for rgb I'd be grateful.

This arduino was well worth the money, It's like a puzzle without a set solution.

Update..
Found some potentiometer code to play with here: RGB LED :: mbeckler.org
When I try it out though I get some probs.
It seems to work ok but I cannot turn the lights off.
I think I may have grounding issues as when I touch a lead from the LED that colour will get brighter...

Hmm, Anyone around? this has me stumped.

Hmm still no replies.. maybe I need to show some code?
I have been working on trying to get 2 separate RGB LEDs to fade through six colours each at a different colour at the same time. Like a chasing sequence I guess, I plan to scale it up to more rgb lights later.

I found some code that produced a nice cycling effect and have tried to implement changes to make both LEDs fade together showing different colours.
I got the example code from here: products:rgbledstrip:index.html [AdaWiki]

I have a problem in that my first RGB LED is not fading between colours whilst my second one is. The first LED is flashing through the colours rather than fading.
Can anyone tell me why?
My edited code:

// color swirl! connect an RGB LED to the PWM pins as indicated
// in the #defines
// public domain, enjoy!
 
#define REDPIN 12
#define GREENPIN 13
#define BLUEPIN 11
#define REDPIN2 9
#define GREENPIN2 10
#define BLUEPIN2 18
 
#define FADESPEED 5// make this higher to slow down
 
void setup() {
  pinMode(REDPIN, OUTPUT);
  pinMode(GREENPIN, OUTPUT);
  pinMode(BLUEPIN, OUTPUT);
  pinMode(REDPIN2, OUTPUT);
  pinMode(GREENPIN2, OUTPUT);
  pinMode(BLUEPIN2, OUTPUT);
}
 
 
void loop() {
  int r, g, b, r2, g2, b2;
 
  // fade from blue to violet
  for (r = 0; r < 256; r++) { 
    analogWrite(REDPIN, r);
  }
   // fade from yellow to green
  for (r2 = 255; r2 > 0; r2--) { 
    analogWrite(REDPIN2, r2);
    delay(FADESPEED);
  } 
  // fade from violet to red
  for (b = 255; b > 0; b--) { 
    analogWrite(BLUEPIN, b);
  }
     // fade from green to teal
  for (b2 = 0; b2 < 256; b2++) { 
    analogWrite(BLUEPIN2, b2);
    delay(FADESPEED);
  } 
  // fade from red to yellow
  for (g = 0; g < 256; g++) { 
    analogWrite(GREENPIN, g);
     // fade from teal to blue
  }
  for (g2 = 255; g2 > 0; g2--) { 
    analogWrite(GREENPIN2, g2);
    delay(FADESPEED);
  } 
  // fade from yellow to green
  for (r = 255; r > 0; r--) { 
    analogWrite(REDPIN, r);
      // fade from blue to violet
  }
  for (r2 = 0; r2 < 256; r2++) { 
    analogWrite(REDPIN2, r2);
    delay(FADESPEED);
  } 
  // fade from green to teal
  for (b = 0; b < 256; b++) { 
    analogWrite(BLUEPIN, b);
  }
      // fade from violet to red
  for (b2 = 255; b2 > 0; b2--) { 
    analogWrite(BLUEPIN2, b2);
    delay(FADESPEED);
  } 
  // fade from teal to blue
  for (g = 255; g > 0; g--) { 
    analogWrite(GREENPIN, g);
  }
      // fade from red to yellow
  for (g2 = 0; g2 < 256; g2++) { 
    analogWrite(GREENPIN2, g2);
    delay(FADESPEED);
  } 
  }

I have a problem in that my first RGB LED is not fading between colours whilst my second one is. The first LED is flashing through the colours rather than fading.
Can anyone tell me why?

Yes, it seems all loops regarding the second RGB LED have a delay(FADESPEED) in them, but the loops for the first LED does not.

// fade from blue to violet
for (r = 0; r < 256; r++) {
analogWrite(REDPIN, r);
}
// fade from yellow to green
for (r2 = 255; r2 > 0; r2--) {
analogWrite(REDPIN2, r2);
delay(FADESPEED);
}

..etc..

Also, the comments for the loops don't seem to be true (depending on how you connect the LEDs).

I have been working on trying to get 2 separate RGB LEDs to fade through six colours each at a different colour at the same time. Like a chasing sequence I guess, I plan to scale it up to more rgb lights later.

Your code above won't do the different fades at the same time, each for() loop executes in sequence. You need to rethink your algorithm if you want simultaneous fading.

Maybe you should simply scale down in the beginning, to one RGB LED.

Some inspiration in this thread: http://arduino.cc/forum/index.php/topic,8320.0.html
And here are some RGB math formulaes: http://www.easyrgb.com/index.php?X=MATH

Might also be a good idea to look at blink-without-delay tutorial, to see how one might get along without using the delay() function, which basically stops Arduino from doing anything while it waits. http://arduino.cc/en/Tutorial/BlinkWithoutDelay

More tutorials here: http://arduino.cc/en/Tutorial/HomePage

The fade tutorial seems relevant: http://arduino.cc/en/Tutorial/Fade I know its just one regular LED, but you could maybe expand on this in time.

EDIT: typo

Thanks raron. That was a super helpful post.
I have played around with different single RGB LED fading code and felt that the one I was modifying (didn't modify the comments I guess) was the one I understood best.
I just don't really understand arduino coding.

I had assumed leaving the fade delay for one pin would have left both to do it at the same time. I see now how it is not in the loop for one of the pins and therefore not effecting it. I did just add the delay to the other pin but as you said it is not doing both together then.

I'll have a look through your links, thanks so much again. You've restored my faith in the arduino community.

By the way those MOSFETs aren't rated to run at 5V gate drive - they are not logic level devices. This could cause problems with partial turn-on.

Also where are the current-limiting resistors? Perhaps these two problems are cancelling each other out - the partial turn-on limits the current and prevents the LEDs burning out - however this is poor design and not guaranteed to work as the devices age, or at different temperatures or loads.

FYI if the datasheet for a MOSFET has a specification for Ron at Vgs=4.5V, then its rated for logic level use. If it only has a spec at Vgs=10V then it isn't.

MarkT:
By the way those MOSFETs aren't rated to run at 5V gate drive - they are not logic level devices. This could cause problems with partial turn-on.

Thanks for that info. I was using these as suggested by someone else. I'll look into a better option

Also where are the current-limiting resistors?

The strips have resistors built in.

Just wandering how your project is progressing.
I'm thinking of starting a similar project.
Once your finished, will you be posting a video clip on YouTube?

Did you succeed?
Because I am looking for something similair.