Help controlling 12V LED light strip from PWM

I'm looking to purchase the Arduino Mega to control three 12V RGB LED light strips like this one (http://dealextreme.com/details.dx/sku.11304).

From what I understand, the pwm outputs are 5v but the leds need 12v. So I assume I need some kind of external power source, but still be controlled from the pwm outputs.

Any tips on the easiest way to accomplish this would be appreciated.

You will need a 12V supply which can be converted to 5V by the on-board Arduino regulator. You also need a way to switch on the 12V supply to the LED strips. One way to do this is with a FET.

A little more sophisticated solution is to use a MOSFET driver that is TTL compatible and has a low turn on current. Enter the Micrel 5014/5015 high- or low-side switch. The only difference between the two chips is that the 5015 has an inverting input.

The simplest way is to just run the PWMs into a ULN2003: one cheap chip, no external components, easy to wire on a piece of perfboard or stripboard. Don’t forget to ground the unused inputs.

If you don’t have one, check the examples in the playground for using an NPN transistor to drive relays, solenoids, and such.

And make sure you have a good connection between the 12V power supply’s ground and the Arduino’s ground: all the current driving the LEDs will go through it, so don’t just jumper it with a little chunk of wire-wrap wire.

Ran

Ran is correct - I forgot the humble ULN2003 which I use to drive LEDs on a test board I have.

Because the ULN2003 inverts the signal you need to drive the outputs as current sources meaning that the 12V is connected to pin 10 of the ULN2003 and to the anode of the LED via a resistor. The LED cathode is connected to an output pin (pins 11 through 18)

Judging from from the colors of the 4 wires on the RGB strip, it's probably wired common anode, with the +12 going to the yellow. It also looks like there are resistors already on the module. One hopes it comes with documentation to confirm all this. ::slight_smile:

Since it's not an inductive load, there's no need to wire the +12 to the ULN2003 in this case.

Btw, one of the great things about the ULN2003 (and its 8-transistor ULN2803 brother) is the pin layout: having all the inputs grouped on one side, with the outputs on the other, makes it really easy to quickly wire gadgets on a stripboard or IC-pattern protoboard. Say you want to monitor an I/O port. You just plunk a ULN2803, a DIP resistor pack, and an LED bargraph next to each other on the board, and almost all the connections needed are already made.

Ran

Thanks for the replies, guys

Thanks again for the input guys, and I think I figured out how its going to be wired up

This is my first try with anything like this so I could be way off :o

That looks correct (I’m not familiar with the Mega, so I’m assuming that those “PWM” outputs are all separately controllable).

Ran