Go Down

Topic: A few LED's from one pin (Read 830 times) previous topic - next topic

DaveyK

Hi,
I think I'm heading in the right direction with this one but could do with a few pointers to check I'm not missing anything obvious and to sort out the details.

I need to power 4 RGB LED's. Each of the LED's will only show one single colour at any time. I have this working with one led by putting the resistor on the common cathode then making the r, g or b pins high as and when necessary.

When the led is on red, however I want all four of the LED's to be on. If i put all 4 LED's from one digital pin, I understand that this would draw too much current. Now I am only making a small circuit with plenty spare pins so I could just use 4 individual pins but I would need to turn all four on and off every time I needed them. I would prefer to run them all from one pin, (times 3 for each colour), at some point I will run out of pins and this is useful stuff to know.

I suspect the answer is to use a transistor, with the base connected to the digital pin, when set to high, this should allow flow through the transistor which can then drive the LED's..... RIGHT?

If there are other options out there, please let me know, I'm sure there are many.

If a transistor is the best way to go, please could you let me know if I need any protection resistors / diodes (other than for the LED's) and how on earth do i go about specifying the correct values for the transistor etc.

If all this is covered elsewhere, just point me in that direction. Many thanks in advance.

Dave.

dc42

Simplest solution is a PNP transistor such as BC327 with emitter to +5v, base to the Arduino pin through a 4k7 resistor, collector to the LED anodes. This will turn the LEDs on when the output pin is low, so you will need to drive the pin the other way round.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

magagna

Hi,

Any special reason to use a PNP transistor to turn the LEDs on when the output low, as opposed to a NPN transistor that would turn them on when the output pin is high?

Thanks,

Chris
http://en.wiktionary.org/wiki/magagna <-- My last name.  Pretty apt.

dc42


Hi,

Any special reason to use a PNP transistor to turn the LEDs on when the output low, as opposed to a NPN transistor that would turn them on when the output pin is high?

Thanks,

Chris



Yes, he's using RGB LEDs with common cathodes.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

MarkT

As opposed to refined cathodes  ;)
[ I won't respond to messages, use the forum please ]

DaveyK

thanks for the help guys... I will need to get hold of some transistors but will give that a go.

Where is the best place to learn, (in very basic terms), what the transistors do..... i would be interested to understand why that one makes a good choice.... what considerations do I need make?

ibourdon

This will give you alot of info on transistors and which you should use depending on your end goal for the circuit.

http://en.wikipedia.org/wiki/NPN_transistor#NPN

Grumpy_Mike

Quote
Where is the best place to learn, (in very basic terms), what the transistors do

Also this might be helpful:-
http://www.kpsec.freeuk.com/trancirc.htm

DaveyK


Quote
Where is the best place to learn, (in very basic terms), what the transistors do

Also this might be helpful:-
http://www.kpsec.freeuk.com/trancirc.htm

Cheers Mike, this is exactly the info I was after.....
I'm happy at some level just to be told which components to use but I know I will be asking the same question again for the next application. I now know how to work it out for myself..... onto the calculations!

DaveyK



Hi,

Any special reason to use a PNP transistor to turn the LEDs on when the output low, as opposed to a NPN transistor that would turn them on when the output pin is high?

Thanks,

Chris


Yes this is right.... sorry but I thought it made no difference until I tried to draw a schematic! Makes perfect sense.

Yes, he's using RGB LEDs with common cathodes.

Go Up