LED Strip, Arduino and ULN2003 : lost in computation

Hi,

I'm working on a project with LED Strips.
I want to use uln2003 Darlington arrays because I have some spare from a previous stepper project.

The set up is pretty simple :

Led strip have 4 "pins" :
+12V -> plugged to +12v of an old ATX power supply
R, G and B -> each on one ULN2003's base input ( 7 base input, so I could drive 2 separate strips )

the ULN2003 set up :
Emitter to ground
Common cathode to the ATX power supply +12V
1 base input to 1 analog output of the arduino
1 collector output to a R , G or B LED Strip

Arduino :
+5V from atx power supply

My questions are :

  • how many R , G or Bs can i plug to the ULN2003 ?
    I read on wikipedia that one can draw 500mA from one collector at 50V, but I can't find this on the datasheet, and how much would it be with 12v ?

  • On the LED strip it seems that there are some SMB resistors, but I find no mention of it in the datasheet, and when I measure with a ohmmeter I get just 1 or 2 ohms, so I guess there's no resistors. Then what could be those things ? ('151' , '301')
    https://cdn.sparkfun.com//assets/parts/8/5/5/0/12022_1.jpg
    Also, if I have to put some resistors, how do I compute their values ?
    I've found some online calculators but I would like to undestand how this work instead of applying without undestanding.
    ( If someone have a friendly link wich explain how those 4 pins LED work, it'll be great ^^ so far I just found how to plug them )

Links to the datasheets :

Sorry for those questions who could seem silly for someone who can read a datasheet, that's (still) not my case :wink:

Haven't used LED strips, but here's a few answers:

  • how many R , G or Bs can i plug to the ULN2003?

It depends on the total LED current on the output. Although each ULN2003 output can sink 500mA, this value decreases as you use more outputs and as you increase the duty cycle (see figure 18)

I read on wikipedia that one can draw 500mA from one collector at 50V, but I can't find this on the datasheet, and how much would it be with 12v?

Same as above. See Table 2 here.

Then what could be those things ? ('151' , '301')

151 ---> 150Ω resistor
301 ---> 300Ω resistor

LousyJohnny:
Then what could be those things ? ('151' , '301')

The first two digits are the base value, the third is the power of ten to multiply it with, e.g: '151' = 15·10^1 =150, '473' = 47·10³ = 47,000. It's the same as the first 3 bands on a 4 band resistor, but with numbers instead of colors.

But if they measure 1-2 Ohms, they could in theory be polyswitches, a kind of resettable fuses (although I've never seen one on a LED-strip). When current increases above a certain threshold, they start to get hot, and their resistance increases, resulting in a lower current.

Also, some capacitors and even other components use the same three digit code. (But that's very unlikely on a LED strip as well.)

Since you can connect the 12V directly to the strip, they probably are 150 & 300 Ohm resistors. Are you absolutely sure about your measurements?

LED strips can draw a lot of current (several amps in total), so make sure your drivers can handle that.
If you want more than 500mA per color, I'd use discrete power transistors or MOSFETs. You can also parallel the darlingtons in the ULN2003, but you should not parallel transistors from multiple chips. If you parallel two transistors that are in a different package (or on a different heatsink) they are not thermally coupled.
Because no two transistors are identical, one will always take more current than the other, so it will get hotter. When it gets hotter, it will sink more current, and as a result, get even hotter etc... You end up with a thermal runaway, killing the transistor, maybe even the Arduino, if that 12V gets to its pins through the dead transistor.

You will see better results with N-channel MOSFET, such as AOI514 from digikey, if the strips are longer.
If shorter strips, you can also go with open-drain MOSFET shift registers, like TPIC6B595 (150mA x 8 outputs) or TPIC6A595 (350mA x 8 outputs).
I offer a board with 32 of them designed to drive LED strips, here are a couple clips of it in action.
Short clip driving 9-LED strips
http://www.crossroadsfencing.com/BobuinoRev17/MVI_2864.AVI
Longer youtube clip of segments being faded up & down

http://www.crossroadsfencing.com/BobuinoRev17/

CrossRoads:
If shorter strips, you can also go with open-drain MOSFET shift registers, like TPIC6B595 (150mA x 8 outputs) or TPIC6A595 (350mA x 8 outputs).

Important to note: if you use a shift register to drive the strips, you cannot control the brightness of the individual colors (or strips), although you could control the brightness of all strips and colours simultaneously by PWM'ing the Output Enable (OE) pin.

Yes, PWM on OE/ pin can be used for all outputs, there are also libraries like shiftPWM to control brightness individually
http://www.elcojacobs.com/shiftpwm/
Hackaday article on it:

PieterP:
Important to note: if you use a shift register to drive the strips, you cannot control the brightness of the individual colors (or strips)

Wrong.

yes you can using the ShiftPWM library
http://www.elcojacobs.com/shiftpwm/

Thanks for those replies !

-the measurements i made on the resistors' strip was wrong , I get clean reading now.

dlloyd:
Haven't used LED strips, but here's a few answers:
It depends on the total LED current on the output. Although each ULN2003 output can sink 500mA, this value decreases as you use more outputs and as you increase the duty cycle

Thanks for pointing that to me!

dlloyd:
151 ---> 150Ω resistor
301 ---> 300Ω resistor

Right, I get those readings now

PieterP:
You can also parallel the darlingtons in the ULN2003, but you should not parallel transistors from multiple chips. If you parallel two transistors that are in a different package (or on a different heatsink) they are not thermally coupled.

Thanks for pointing that to me!

So i plugged one bit of strip ( = 3 LED ) to directly measure the drained current between an uln2003 pin and the LEDs.
.... And I'm more confused.
I get 0.19 mA at 100% duty cycle on the green wire , 0.15 mA at 78%, 0.11 mA at 68%, 0.07 mA at 39%
on the +12v wire, i Got 0.6mA
Visually, at 100%, the luminosity seems correct
That's really lower that what I expected. ( 100 to 300 times )

Do you guys think of something I do wrong ?

As long as you don't have a true RMS meter you can't measure the current other then @ 100% duty. But that's alright, that's all you need :wink: And a section of 3 leds will indeed draw around 20mA.

And a thing to remember, the 500mA sounds great but the real limit is the power dissipation. When you sink 500mA the voltage drop between emitter and collector is significant, @ 500mA this can be 1,5V or more (figure 1). So because I x U = P the transistor will dissipate heat. 500mA x 1,5V = 0,75W per output. So 6 outputs gives you 4,5W, that is way to much for the device. The datasheet even gives you a nice chart for it (figure 5 for DIP). It you want to be able to drive 6 outputs (2 RGB strips) up to 100% brightness you can sink a max of around 120mA per channel (= 6 sections = 30cm (on a 60leds/m strip)).

And even then you have a voltage drop of around 0,75V across the ULN which will unbalance the color mixing (because the different voltage drop (and thus resistor) for the red leds).

So although it can be done with a ULN2003 it's not really ideal. Much more efficient to use mosfets. If SMD isn't a problem I would suggest the IRF7313 which is pretty cheap.

My 200mA multimeter fuse is fried :confused:

A friend of mine passed by with his clamp amperemeter

We plugged all the 300 LEDs directly on the power supply, we got between 1.1 A and 1.5 per color channel, the power supply gave 11.84 V ( alive, while LEDs enlighten )
So thats less than 4 A for all the strip

But if we compute 0.020 Amp * 3 * 300, we should get 18 A
I don't get it.

septillion:
So although it can be done with a ULN2003 it's not really ideal. Much more efficient to use mosfets. If SMD isn't a problem I would suggest the IRF7313 which is pretty cheap.

You're right.
I salvaged 2 x D13009K NPN power transistor and one DFP2N60 .
I think I will drive them with the ULN2003 , and put some potentiometer on the arduino to control each color and luminosity, but it's just an idea for now I still not have really think of the feasibility.

PieterP:
Important to note: if you use a shift register to drive the strips, you cannot control the brightness of the individual colors (or strips), although you could control the brightness of all strips and colours simultaneously by PWM'ing the Output Enable (OE) pin.

You can PWM the strips by rewriting the shift register fast enough. It might not be brilliant but you can do it.

Get some better MOSFETs. AOI514 from digikey, 50 cents each. Rds just 0.012 ohm, V drop across the part just 0.192V at 4A.

I use 32 of them on this board that I offer for sinking current thru lots of strips.
http://www.crossroadsfencing.com/BobuinoRev17/

And now you see why the ULN2003 is not a very useful component. It's good for sinking 100-200mA per channel, maybe 250mA - the 500 is it's peak at low duty cycle.

BJTs (NPN/PNP transistors, as opposed to MOSFETs), including arrays of them like the '2003 are obsolete for pretty much all power switching applications. You might drop 1.5v over a BJT (that is, 1.5v less that your supply voltage is being applied to the load - and it doesnt' get much lower at low current), and that energy is being dissipated in the transistor as heat. Power dissipation limits your total current, and besides, they're wasteful. With a decent mosfet (see Crossroads' post), there isn't a "minimum" voltage drop (they spec Rds(on) - and it's common for this to be a few milliohms. I've got some rice-grain sized MOSFETs spec'ed for 6A continuous, and that's normal...

Keep in mind the voltage over the resistor is less then 3V. So when you power it with 11,85V that is already 5% less voltage over (so 5% less current) resistor. And they indeed choose the resistor in a way they can handle car "12V". So at real 12V they indeed consume a bit less then 20mA per segment per color.

And if you want to power 300led (5m I guess) then do yourself a favour and drop the 2003 and get a mosfet. That 1V++ drop over the transistor not only gives you a lot of heat, you also end up with less the 70% of the light output.