How to: drive common cathode led with Arduino?

Yes, the LED specifications are fairly straightforward, they are five 1W LEDs in series (you can almost see the connections in the photograph), and their working voltage is about 3V so they require about 330 mA controlled current drive to show full rated brightness.

The beauty of LEDs is that you do not have to drive them to full brightness to get the right colour.

You need a current driver circuit to power them, and if you are going to use two, then since you need more than 15V anyway, it would be better to run both in series from some sort of 35V supply using a current driver: For 330 mA, the "sense" value here is about (0.7V / 0.33A) 2.2 ohms. The base resistor could be about 470 ohms and the feedback transistor any general[purpose NPN. The power transistor needs to be rated for a few watts with a heatsink but actually does not need to be rated for the full 35V for two of those modules in series.

Thanks for your reply Paul__B :-) I would like to know, why I need to use the current driver circuit? wouldn't i be enough to use a current limiting resistor. Wiring them in series is sadly not an option, they have to be connected like my diagram in the former post.

Best regards Joe

know these should have a current limiting resistor,

No you should not!

With high power LEDs like this you should be using a constant current supply, resistors just do not cut it.

The other thing is why you think this is a common cathode LED? There is no common connection at all. You could have done exactly the same as you are doing now with a NPN transistor or N channel FET.

Anyway that page says the device has a SMD 5252 Integrated Chip, not sure where but that is what it says. From bits of a data sheet I have managed to find for a QX5252 it looks like it is a switching regulator. However that does not square up with the 110 to 220V input.

What do you want to do with these LEDs? Are they for serious lighting? If so you are going to have to push a hell of a lot more current down them than 75mA.

This is my guess. The eBay seller hasn't got a clue what he has got, he probable just picked up a batch of random junk and this was in it. That specification looks to me like it was the specification of the whole finished lighting unit before it was pulled to bits. It looks like you just have five bare 1W LEDs. These normally take 350mA, so look for a constant current circuit that can provide that. Get two of them, one for each LED plate.

Grumpy_Mike:
From my former picture showing the wiring of my leds, I guessed it would be correct to call them common cathodes since they all share the ground wire. Now I know they shouldn’t be called that… :slight_smile:

I’ve installed these in my ceiling planning to use them as ceiling lights. They give the right amount of light, and I am happy by the result driving them from my 15v power supply.

I know nothing about constant current driver circuits, but would it be possible to find/build a current driver that could drive two led-pcbs at once, as that’s how I already wired them, instead of supplying each led-pcb with a driver?

Are there one such standard led current driver circuit, or do they vary a lot for these kind of leds? - I am thinking of which circuit to use to drive the led-pcbs.

Whoa… I’ve got much to learn, constant current drivers are a whole new world to me… :smiley:

Best regards
Joe

So I found this driver circuit which I guess would be appropriate: LED Current Driver

and then I would be able to PWM it with this added: PWM

Am I totally wrong here? :-)

Yes that is the sort of thing. Note you will need a voltage greater than 15v and you need one for each LED group. You can not wire them in parallel because they will not shair current equally. At the moment disasister has been avoided because you are totally under running the LEDs but that is not a long term stratagy for any electronic design.

Yes you will be able to PWM that circuit.

I will supply each led-pcb with their own controller. What specifications should I go for?

  • 17v - because it have to be more than 15v (can it be much more than 17v)?
  • minimum 5W - because that's what each led-pcb is? (does it matter if it's larger than 5W, as long as it isn't under?)
  • 350mA or more, does it matter if it can deliver lets say 700mA? I guess the led "takes what it needs"

Thank you very much Grumpy_Mike :-)

Best regards Joe

Would a driver like this be appropriate if I choose to buy a driver instead of making my own? each led-pcb would have it's own? LED Driver

JohannesTN: So I found this driver circuit which I guess would be appropriate: LED Current Driver

Yes, that would be the circuit I just gave you above - it happens to have a FET instead of a power transistor - the difference in this case is quite immaterial.

JohannesTN: Would a driver like this be appropriate if I choose to buy a driver instead of making my own? each led-pcb would have it's own?

Well, it might, but it depends on whether you mean "like" that or that one in particular, which is rated at 1.5 Amp whereas you specifically want 330 mA. And at $4 each for six of them assuming it could be re-adjusted to 330 mA, it would be rather more expensive than the circuit I gave you.

17V would be quite a reasonable voltage. However you can easily get 19V laptop power supplies rated at 3 or 4A (dirt cheap second hand too) which would work just fine in this application. If each current driver is dropping 4V at 330 mA, then the dissipation in the control transistor would be no more than 1.5W.

17v - because it have to be more than 15v (can it be much more than 17v)?

Yes but as Paul says get what you can, I have never seen a 17V power supply, you can’t get all values.

  • minimum 5W - because that’s what each led-pcb is?

That is the wrong way to think about it. You need a power supply to deliver the voltage at the current you want. So if you need 75mA or even 350mA for each LED plate then you have to provide that current times the number of plates. As it is never a good idea to run a power supply at its maximum current then look for one that provides at least 20% more than this current. Remember the current rating is only what it can supply not what it will supply.

I guess the led “takes what it needs”

No the LED takes what it is given, the constant current supply gives that. What you need to do is to power the constant current supply with a power supply that will deliver that voltage and current.

Would a driver like this be appropriate if I choose to buy a driver instead of making my own?

As it stands no. This is because it will deliver 1.5A into your LED and fry it. You might be able to modify it to only give 350mA but that will take a bit of understanding and some test equipment. Look for one that delivers 350mA or less if you don’t want it as bright.

I would like to make my own current driver, one for each led following your schematic Paul__B :-) I've "calculated" a fitting power supply to be 19V 6*350mA=2.1. This means I'll use a laptop power supply at 19v, 4.5A. If I send 19V in to the current led driver, would I get 19V out in the led-pcbs or how do I control that?

But what about the values in the schematic, what is the easiest way to calculate those? - Is it possible to use the BC337 NPN transistor in the making, I've got that on hand already. Which power transistor/Mosfet would be suitable? :-)

Best regards Joe

if I send 19V in to the current led driver, would I get 19V out in the led-pcbs

No you get what ever voltage that is needed to drive the current through the LEDs. That is what a constant current supply does. It automatically and constantly, adjusts the voltage so that the current is guess what - constant.

Is it possible to use the BC337 NPN transistor

For the feedback transistor yes.

Which power transistor/Mosfet would be suitable?

Lots, it depends on what you can get locally.

I feel like I'm finally getting a hold on this :-) - Are there any advantages/disadvantages choosing a transistor over a mosfet in this particular case? if not, I feel like buying some mosfets for the job.

I believe that both a mosfet or a transistor would allow me to still operate the driver with a PWM signal?

What values should I look out for when choosing a N-type mosfet for the job? :)

Best regards Joe

JohannesTN: Are there any advantages/disadvantages choosing a transistor over a mosfet in this particular case? if not, I feel like buying some mosfets for the job.

I would think that the transistors would be cheaper, but nowadays that may not be so. Note however the point below.

JohannesTN: I believe that both a mosfet or a transistor would allow me to still operate the driver with a PWM signal?

Absolutely. That's what they are for.

JohannesTN: What values should I look out for when choosing a N-type mosfet for the job? :)

It must be a "logic level" device if the control input is to come from an Arduino (or any other microcontroller at 5V). It must turn on fully at 3V on the gate and be able to dissipate 2W if you are going to use a 19 or 20V power supply.

Note that I said 3V on the gate, and an Arduino running at 5V. All transistors - except for Darlingtons which you should in general avoid - switch on at 0.7V or so, so this is no problem with transistors.

I will get a hold on some transistors/mosfets on monday and then report back when I know what I've got my hands on :-)

  • where in Paul__B's circuit would I apply the pwm-signal coming from the arduino? - is it just where I normally would connect the Arduino, that would be the control-line following his circuit :-)

Best regards Joe

The leds are diodes. They only conduct in the one direction. If the led cathode is connected to ground (schematic in Reply#6) , you shouldn’t have a reverse current (opposite of the direction when the led is on) flowing through the led because it should block current flow in the reverse direction . In order to read -9 V across the led as you indicated, the cathode would have have to be biased positive with respect to the anode.

JohannesTN: where ... would I apply the PWM signal coming from the Arduino? - is it just where I normally would connect the Arduino, that would be the control-line following his circuit

Curiously enough, that is what PWM actually is - you turn the LED on and off.

I really don't understand why I sometimes read -9v to -15v raschemmel, I know a led is only conducting in one direction, so I find it mysterious too. For now, I hope I will not read any weird values by using a proper driver :)

Thank you Paul__B I'll report back on monday.

You guys are great ;)

Best regards Joe

So I got some of these IRLZ34N power mosfets: IRLZ34N

Are they usable in Paul's circuit? :)

Best regards Joe

I played around with the constant current driver circuit I found on Pcbheaven, because it's build around a mosfet like I'm using: Constant current driver

I built the following circuit:

I've calculated the RS-resistor by using the BC337's Vbe-value which is 1.2V following the datasheet. The rs-resistor is calculated by 2.1V/0.35A = 3.4ohm. (I used a 3.6ohm resistor because that's what I had on hand (2x1.8ohm))

The RG-resistor is just a 10k as it's stated at pcbheaven that it should be fine - should I also calculate this to be sure?

The circuit works great with PWM and all. But there's something I find a little strange... With the above circuit the led-pcb draws 160mA, I guess it should actually draw 350mA as that's what the RS-resistor is calculated for (to my knowledge). If I lower the value of the RS-resistor I can get it to draw more from the power-supply, but then the calculation for the RS-resistor isn't what I calculated it to be anymore.

If anyone knows why, I would like to know what can cause that my led-pcb isn't actually drawing 350mA when that's what I calculated the RS-resistor for :-)

Best regards Joe