Go Down

Topic: How to: drive common cathode led with Arduino? (Read 9038 times) previous topic - next topic

JohannesTN

Jan 14, 2015, 06:03 pm Last Edit: Jan 14, 2015, 06:04 pm by JohannesTN
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:
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:

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.

Grumpy_Mike

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.

JohannesTN

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

weedpharma

#3
Jan 15, 2015, 01:02 am Last Edit: Jan 15, 2015, 01:06 am by weedpharma
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

polymorph

Where are you putting the red and black leads of your meter?
Steve Greenfield AE7HD
Drawing Schematics: tinyurl.com/23mo9pf - tinyurl.com/o97ysyx - https://tinyurl.com/Technote8
Multitasking: forum.arduino.cc/index.php?topic=223286.0
gammon.com.au/blink - gammon.com.au/serial - gammon.com.au/interrupts

Grumpy_Mike

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.

JohannesTN

#6
Jan 15, 2015, 10:04 pm Last Edit: Jan 16, 2015, 12:19 am by JohannesTN
Thank's for all your replies.

I've put my meter here:

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

Grumpy_Mike

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.

JohannesTN

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

Grumpy_Mike

#9
Jan 16, 2015, 05:22 am Last Edit: Jan 16, 2015, 05:22 am by Grumpy_Mike
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.

JohannesTN

Here comes information about my leds :-)

The load consists of two of these connected in parallel:


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 :-)

Paul__B

Oh dear!

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

Grumpy_Mike

#12
Jan 16, 2015, 02:37 pm Last Edit: Jan 16, 2015, 02:42 pm by Grumpy_Mike
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.

weedpharma

#13
Jan 16, 2015, 03:45 pm Last Edit: Jan 16, 2015, 03:55 pm by weedpharma
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

JohannesTN

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

Go Up