Arduino Forum

Using Arduino => General Electronics => Topic started by: JohannesTN on Jan 14, 2015, 06:03 pm

Title: How to: drive common cathode led with Arduino?
Post by: JohannesTN on Jan 14, 2015, 06:03 pm
Hello forum :-)
For quite some time I've been using transistors (mostly npn) to control all sorts of loads with great results. But this time I ran my head against the wall...

My problem is simple: How can I drive a common cathode led (15v, 150mA) from the Arduino Uno?

Since it's common cathode I guess I have to use a PNP transistor, So I came up with the following schematic: (http://i.imgur.com/6OUlbjG.png)
which doesn't work, was the leds are lit regardless of whether the pin is set high or low...

I did a little digging around Google and found the following schematic: (http://i.stack.imgur.com/4c3if.gif)

As far as I can read, I'll have to use such setup, but are there anything smarter? my requirements are that the circuit should be able control the led which is 15v, 150mA and be able to do it by analogWrite, so it has to support PWM. I have the BC327 and BC337 transistors on hand already. If I have to use the schematic above, how do I figure out the resistors R2 and R3? :-)

I hope a clever head can shine some light on this ;-)

Best regards
Joe.
Title: Re: How to: drive common cathode led with Arduino?
Post by: Grumpy_Mike on Jan 14, 2015, 06:52 pm
Quote
I'll have to use such setup, but are there anything smarter?
Yes you do unless you want to use a top switch IC, which is a lot more expensive.

Quote
how do I figure out the resistors R2 and R3?
They are super non critical and almost anything will do. R3 keeps the transistor off so it is just a pull up resistor, 10K will do. R2 limits the base current of Q1 so limit it to the gain times the load, in fact limit it to three times at least to be on the safe side. However 1K will do fine.
Title: Re: How to: drive common cathode led with Arduino?
Post by: JohannesTN on Jan 15, 2015, 12:56 am
Hello Grumpy_Mike
First of all thank you for your quick reply :-)

I guess I've found the right schematic to solve my problem? - I mean are there any (that you're aware of) smarter ways of solving the problem by this few components, I still don't know much about electronics, but it seems to do the job. I was just wondering if there was an even easier way of achieving it, I'm happy to learn something :-)

So.. I've tried building the circuit, using the resistors you suggested it works fine. But there's something I'm wondering about. If i measure the voltage between gnd and the PNP's collector when the leds are off, I measure a negative voltage, something like -9.xV, do you know why that's possible? - will it affect the circuit in a negative way, if yes, can I sort it out by applying a diode somewhere or something? :)

It's great to learn from someone who knows! - thank you.

Best regards
Joe
Title: Re: How to: drive common cathode led with Arduino?
Post by: weedpharma on Jan 15, 2015, 01:02 am
The first circuit will not turn off as there is always forward bias. 15v on the emitter and a max of 5v on the base.


The only way you can get negative voltage is connecting the meter back to front or a wiring error so your earth is not earth.

Weedpharma
Title: Re: How to: drive common cathode led with Arduino?
Post by: polymorph on Jan 15, 2015, 01:04 am
Where are you putting the red and black leads of your meter?
Title: Re: How to: drive common cathode led with Arduino?
Post by: Grumpy_Mike on Jan 15, 2015, 01:18 am
To be honest no I don't know with you are seeing a -ve voltage unless it is a meter fault or you are purring the probes in the wrong place.
Title: Re: How to: drive common cathode led with Arduino?
Post by: JohannesTN on Jan 15, 2015, 10:04 pm
Thank's for all your replies.

I've put my meter here:
(http://i.imgur.com/EtXPRcC.png)
As I said, when the lights are on, I measure approximately 15V as I should, but when they're of I measure -9V.. I am pretty sure it's not a meter error as it Would the first time I've had my Fluke fail on me :-)

Best regards
Joe
Title: Re: How to: drive common cathode led with Arduino?
Post by: Grumpy_Mike on Jan 15, 2015, 10:10 pm
Quote
I measure approximately 15V as I should, but when they're of I measure -9V.
Do you actually mean -9V? How can you measure 15V when there is only 9V connected to it according to that diagram.
What you are saying makes no sense at all, therefore I suspect you are not measuring what you think you are.

Note when the transistor Q1 is off then effectively there is nothing to measure and so the inputs to the meter floats. You will not see minus nine volts but you might get a bit of pickup. This is true because the load is sevral LEDs so it is not a linear load.
Title: Re: How to: drive common cathode led with Arduino?
Post by: JohannesTN on Jan 16, 2015, 12:23 am
Sorry for the confusion Grumpy_Mike
I've corrected the schematic in my former post to reflect the circuit I'm currently having :-)

- When the Arduino I/O is high, I measure 15V (probing points marked in former post), when it's low I measured -9.7V and just before at the same conditions -15, The value drifts a little, I don't know why.

If I remove the led, and still measure at the two points marked, I measure 15V when Arduino I/O high, and 0V when low :-)

Best regards
Joe
Title: Re: How to: drive common cathode led with Arduino?
Post by: Grumpy_Mike on Jan 16, 2015, 05:22 am
Quote
if I remove the led, and still measure at the two points marked, I measure 15V when Arduino I/O high, and 0V when low
Which is as it should be.

I think we need to know more about the 15V LED. No LED actually takes 15V, that is just physics, so this must be something like a chain of LEDs with built in resistors or constant current drives.

There is clearly something going on with this load that we haven't been told yet. Perhaps something to do with capacitors in the 'LED' load.
Title: Re: How to: drive common cathode led with Arduino?
Post by: JohannesTN on Jan 16, 2015, 01:36 pm
Here comes information about my leds :-)

The load consists of two of these connected in parallel:
(http://i.imgur.com/AoTKs6k.jpg)

The leds on the pcb is connected in series, no extra components added to the pcb or anything. Each led-pcb draws 75mA when connected to a 15V power supply.

Regards
Joe :-)
Title: Re: How to: drive common cathode led with Arduino?
Post by: Paul__B on Jan 16, 2015, 02:02 pm
Oh dear!

Mike is not going to like you using them in parallel and without current limiting resistors. :smiley-eek:
Title: Re: How to: drive common cathode led with Arduino?
Post by: Grumpy_Mike on Jan 16, 2015, 02:37 pm
Oh dear!

Mike is not going to like you using them in parallel and without current limiting resistors. :smiley-eek:

Quite right strike two.
Time to do some serious reading about LEDs and how to drive them. Time to look at your power supply and see if it can still output the full voltage when you have that load on. Time to ask some serious questions about your meter.

Have you got a link to those LEDs? Couldn't find anything under FS-0441 LED when I googled it.

Quote
Each led-pcb draws 75mA when connected to a 15V power supply.
Dream on sunshine.
Title: Re: How to: drive common cathode led with Arduino?
Post by: weedpharma on Jan 16, 2015, 03:45 pm
Dream on sunshine.

I think Mike may be trying to say you need to do a refresher on Ohm's Law.

P= I x E

I = P/E

I = 5/15

I = 1/3A

Quod erat demonstrandum, the current is greater than the 75mA you suggested by a factor of over 4.

Weedpharma
Title: Re: How to: drive common cathode led with Arduino?
Post by: JohannesTN on Jan 16, 2015, 08:15 pm
Hmm.. I know these should have a current limiting resistor, but I don't have any datasheet for the leds used on the pcb. To be honest all I did was connecting these to my power supply, and slowly cranked up the voltage until I saw light, then one pcb seemed to run great at 15v... But how do I calculate a resistor when all I really know about them is that they draw 75mA from my power supply when supplied with 15V? :-)

My power supply does output full voltage when the load is connected. I adjust my power supply to 15V, connect the load and it still says 15V. My meter is a Fluke 179.

I brought these led pcbs at Ebay, the seller doesn't really list any useful specifications, it says "Voltage 110-220V" which I find a little weird, but then again, I haven't even been able to calculate the resistor.. I clearly missed something here. I'm glad for all the help I receive :-)

The led pcbs:
http://www.ebay.com/itm/5W-Led-Spot-Light-Panel-SMD-5252-Integrated-Chip-Bead-Surface-Condenser-Lens-/221526157711?pt=US_Light_Bulbs&var=&hash=item3393fce98f

I appreciate your time.

Best regards
Joe
Title: Re: How to: drive common cathode led with Arduino?
Post by: JohnLincoln on Jan 16, 2015, 09:17 pm
It looks to me as though each of those modules have 5 LEDs in series, so they shouldn't be described as common cathode!
I think that by calling them common cathode, you have complicated the circuit requirements.

Where did the description common cathode come from?  It's not mentioned at all in the seller's description, as far as i can see.

I would imagine that each  individual LED is in fact a 350mA 1W device, to make the complete module 5W .
Are they still quite dim at 75mA? 
Title: Re: How to: drive common cathode led with Arduino?
Post by: JohannesTN on Jan 16, 2015, 09:49 pm
Sorry.. I should have stated this from the beginning. I call the setup common cathode because they're wired like this:
(http://i.imgur.com/7zQIUND.png)
Title: Re: How to: drive common cathode led with Arduino?
Post by: Paul__B on Jan 16, 2015, 09:55 pm
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:
(http://bryanduxbury.files.wordpress.com/2013/12/constant_current_driver.png?w=625) (http://bryanduxbury.com/2013/12/03/simple-constant-current-led-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.

Title: Re: How to: drive common cathode led with Arduino?
Post by: JohannesTN on Jan 16, 2015, 10:08 pm
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
Title: Re: How to: drive common cathode led with Arduino?
Post by: Grumpy_Mike on Jan 16, 2015, 11:07 pm
Quote
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.

Title: Re: How to: drive common cathode led with Arduino?
Post by: JohannesTN on Jan 17, 2015, 12:03 am
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... :-)

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... :D

Best regards
Joe
Title: Re: How to: drive common cathode led with Arduino?
Post by: JohannesTN on Jan 17, 2015, 12:25 am
So I found this driver circuit which I guess would be appropriate:
LED Current Driver (http://www.pcbheaven.com/userpages/LED_driving_and_controlling_methods/?topic=worklog&p=3)

and then I would be able to PWM it with this added:
PWM (http://www.pcbheaven.com/userpages/LED_driving_and_controlling_methods/?topic=worklog&p=4)

Am I totally wrong here? :-)
Title: Re: How to: drive common cathode led with Arduino?
Post by: Grumpy_Mike on Jan 17, 2015, 08:02 am
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.
Title: Re: How to: drive common cathode led with Arduino?
Post by: JohannesTN on Jan 17, 2015, 10:58 am
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
Title: Re: How to: drive common cathode led with Arduino?
Post by: JohannesTN on Jan 17, 2015, 11:05 am
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 (http://www.ebay.com/itm/High-Power-10W-DC-input-9V-36V-1-5A-LED-Driver-buck-power-supply-PWM-DIM-/380236759063?pt=LH_DefaultDomain_0&hash=item5887e08017)
Title: Re: How to: drive common cathode led with Arduino?
Post by: Paul__B on Jan 17, 2015, 12:47 pm
So I found this driver circuit which I guess would be appropriate:
LED Current Driver (http://www.pcbheaven.com/userpages/LED_driving_and_controlling_methods/?topic=worklog&p=3)
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.

Would a driver like this (http://www.ebay.com/itm/High-Power-10W-DC-input-9V-36V-1-5A-LED-Driver-buck-power-supply-PWM-DIM-/380236759063) 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.
Title: Re: How to: drive common cathode led with Arduino?
Post by: Grumpy_Mike on Jan 17, 2015, 02:50 pm
Quote
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.

Quote
* 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.

Quote
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.

Quote
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.
Title: Re: How to: drive common cathode led with Arduino?
Post by: JohannesTN on Jan 17, 2015, 06:06 pm
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
Title: Re: How to: drive common cathode led with Arduino?
Post by: Grumpy_Mike on Jan 17, 2015, 06:27 pm
Quote
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.

Quote
Is it possible to use the BC337 NPN transistor
For the feedback transistor yes.

Quote
Which power transistor/Mosfet would be suitable?
Lots, it depends on what you can get locally.
Title: Re: How to: drive common cathode led with Arduino?
Post by: JohannesTN on Jan 17, 2015, 06:52 pm
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
Title: Re: How to: drive common cathode led with Arduino?
Post by: Paul__B on Jan 17, 2015, 09:50 pm
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.

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.

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.
Title: Re: How to: drive common cathode led with Arduino?
Post by: JohannesTN on Jan 17, 2015, 11:42 pm
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
Title: Re: How to: drive common cathode led with Arduino?
Post by: raschemmel on Jan 18, 2015, 01:24 am
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.
Title: Re: How to: drive common cathode led with Arduino?
Post by: Paul__B on Jan 18, 2015, 08:20 am
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
(http://bryanduxbury.files.wordpress.com/2013/12/constant_current_driver.png?w=625)

Curiously enough, that is what PWM actually is - you turn the LED on and off.
Title: Re: How to: drive common cathode led with Arduino?
Post by: JohannesTN on Jan 18, 2015, 09:03 am
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
Title: Re: How to: drive common cathode led with Arduino?
Post by: JohannesTN on Jan 19, 2015, 10:23 am
So I got some of these IRLZ34N power mosfets:
IRLZ34N (http://www.irf.com/product-info/datasheets/data/irlz34n.pdf)

Are they usable in Paul's circuit? :)

Best regards
Joe
Title: Re: How to: drive common cathode led with Arduino?
Post by: JohannesTN on Jan 19, 2015, 11:10 pm
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 (http://www.pcbheaven.com/userpages/LED_driving_and_controlling_methods/?topic=worklog&p=3)

I built the following circuit:
(http://i.imgur.com/2km8q75.png)

I've calculated the RS-resistor by using the BC337's Vbe-value which is 1.2V following the datasheet (http://www.onsemi.com/pub_link/Collateral/BC337-D.PDF). 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
Title: Re: How to: drive common cathode led with Arduino?
Post by: Grumpy_Mike on Jan 19, 2015, 11:15 pm
Quote
I built the following circuit:
Why? That was not on the page you linked to.

You have two outputs connected together, a great way to screw up components.

Quote
f 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
Your input voltage is not high enough.
Title: Re: How to: drive common cathode led with Arduino?
Post by: Paulcet on Jan 19, 2015, 11:38 pm
The 1.2 Vbe (I am assuming your 2.1 above was a typo) is the Max on the datasheet, not typical.  I actually suspect it is less than 1V.

Title: Re: How to: drive common cathode led with Arduino?
Post by: JohannesTN on Jan 20, 2015, 01:34 am
Quote
You have two outputs connected together, a great way to screw up components.
I guess you're referring to the connection of the PWM pulse Grumpy_Mike? - if not, I would like to know where I've done wrong :-)

As I described I was playing around with the constant current driver circuit found at Pcbheaven here:
Constant current driver (http://www.pcbheaven.com/userpages/LED_driving_and_controlling_methods/?topic=worklog&p=3)

And then, on this page the guide says that
Quote
the best position to inject the PWM pulses is the gate of the MOSFET. The gate resistor RG will act as a pull-up resistor for the PWM generator.
Found in the bottom of the page: PWM (http://www.pcbheaven.com/userpages/LED_driving_and_controlling_methods/?topic=worklog&p=5)

I believe I did it right following the guide at PCB heaven, but as far as I can tell from your comment, it isn't right at all. I would like to know what to do then. :)


Paulcet:
You're absolutely right, the 2.1 was a typo (fixed now). If it's less than 1.2V which I haven't really thought of, that explains a lot, thanks for clearing that out :) !

Best regards
Joe
Title: Re: How to: drive common cathode led with Arduino?
Post by: Grumpy_Mike on Jan 20, 2015, 05:00 pm
Look at the circuit in reply #33, that is the way to inject a PWM signal. The way you have it then you can draw too much current out of the PWM pin when it is outputting a high but the collector of the transistor is low. There is nothing to limit the current here.
Title: Re: How to: drive common cathode led with Arduino?
Post by: JohannesTN on Jan 20, 2015, 05:21 pm
As far as I can see from the circuit in #33 to the circuit in #36 I'm using is the resistor at the control-line in #33. If I add such resistor (10k?) to my circuit, I should be good? :)

Best regards
Joe
Title: Re: How to: drive common cathode led with Arduino?
Post by: Paul__B on Jan 20, 2015, 05:26 pm
I played around with the constant current driver circuit I found on Pcbheaven, because it's build around a mosfet like I'm using
Boy, are you ever persistent in doing the wrong thing and completely ignoring the advice you get here.

I've calculated the RS-resistor by using the BC337's Vbe-value which is 1.2V following the datasheet (http://www.onsemi.com/pub_link/Collateral/BC337-D.PDF).
:smiley-eek:

You picked a number out of the datasheet without knowing what it meant.

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 :-)
Because you ignored my instructions in reply #17 and went and did something totally random.

The 1.2 Vbe (I am assuming your 2.1 above was a typo) is the Max on the datasheet, not typical.  I actually suspect it is less than 1V.
Nothing to "suspect".  I specified it in reply #17.

As far as I can see from the circuit in #33 to the circuit in #36 I'm using is the resistor at the control-line in #33. If I add such resistor (10k?) to my circuit, I should be good? :)
Don't "add" anything at random.  Use the circuit we gave you.

[Yes, it makes no difference whether it is a transistor or a logic FET.}
Title: Re: How to: drive common cathode led with Arduino?
Post by: Paul__B on Jan 20, 2015, 05:39 pm
As I described I was playing around with the constant current driver circuit found at Pcbheaven here:
Constant current driver (http://www.pcbheaven.com/userpages/LED_driving_and_controlling_methods/?topic=worklog&p=3)
Why?
Just - why?

Either you muck about trying to comprehend multiple random sources, or you get serious and believe us.  If you don't want to, well, don't post to this forum!

And then, on this page the guide says that
Found in the bottom of the page: PWM (http://www.pcbheaven.com/userpages/LED_driving_and_controlling_methods/?topic=worklog&p=5)

I believe I did it right following the guide at PCB heaven, but as far as I can tell from your comment, it isn't right at all. I would like to know what to do then. :)
Except that you didn't actually read it, because it says
Quote
Remember that the PWM controller i use sinks current and does NOT source. The base of the transistor grounds on every pulse of the generator, thus the transistor turns off completely, turning off the LED as well.
This has nothing to do with an Arduino,
Title: Re: How to: drive common cathode led with Arduino?
Post by: JohannesTN on Jan 20, 2015, 06:24 pm
Wow...

I guessed (Yes I'm new) that the circuit from PCB Heaven was just as good as the one you supplied me with, since they were close to being equal. To revert my circuit from PCB Heaven to yours #17 all I did was to remove the RG-resistor and add the 10k resistor to the control-line. It works great.

I do know what Vbe-value means, I just missed that the 1.2V was the max-value for the transistor... I used a 2.2ohm resistor for the sense-resistor as you told me to, it made my led-pcb draw 350mA from the power supply as it should. I raised the resistor to 3.4ohm to lower the current to 160mA which suits the led-pcb better as it lights a little less which suits the application great.

I use this forum to learn how to use electronic components I haven't used before. I fully believe you and the other guys helping me out, and I appreciate all the help I've got on this topic, believe it or not, I've learnt a lot in this. I used the circuit at PCB Heaven to try things out on my own, and explore while waiting on replies, I find that a good way to learn too.


Best regards
Joe :)
Title: Re: How to: drive common cathode led with Arduino?
Post by: Paulcet on Jan 20, 2015, 06:58 pm
Nothing to "suspect".  I specified it in reply #17.

LOL,

Yes, I know that and you know that.  I was hoping Johannes would figure it out.  It is quite obvious he is consulting multiple sources....

I do find it interesting, somewhat maddening actually, that people attempt to produce a working product with zero knowledge using Arduino.  Arduino has probably been responsible for more newcomers to the "hobby" of electronics than any other product, and yet equally responsible for more destroyed components than any other product!  And people like Paul, Mike, Crossroads, myself, keep coming on here trying to help teach this stuff.... This stuff that took months, and most cases years, to learn.... And many more years of experience developing our skills.  

Those of you who have been here a long time:  Is there anyone here, who gives sound instruction/teaching/advice, who learned it on a forum such as this?  I suspect not.   ;)
Title: Re: How to: drive common cathode led with Arduino?
Post by: JohannesTN on Jan 20, 2015, 07:29 pm
The reason why I consulted multiple sources (namely PCB Heaven) was to try figuring this thing out on my own, while waiting for you guys replies :) I can see now, that it wasn't my best idea do to that. I've played around with the Arduino before, and I know how to use it. I just didn't knew how to use a current driver as I never has been playing around with high power leds before.

I agree that you just can't always learn these skills from a forum, but this forums users is definitely helping people, including myself in the right direction :)


I would like to thank all of you who helped me on this, your help and guidance is highly appreciated. Hope you didn't pull out to much of your hair, or knocking your head against the wall to many times ;)

I'll be back! ;)

Over and out
Joe