Pages: [1] 2   Go Down
Author Topic: Connecting many RGB LEDs to same PWM pins?  (Read 4500 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 24
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Halo, I want to be able to color a glass plate using a lot off RGB Leds, for now it is okay if the entire plate is the same color.
(In the end it should be wireless using the Xbee, but lets start with the basics)

I can make 1 LED dim and change color, but I need more light than 1 LED.

1.  What kind off LEDs should I use? I read that it is not possible to connect thos 4 Pins RGB LEDs (with commen cathode) in series, so is it better to get a bunch off Red, Green and Blue ones?

2. I know my Arduino can only power so many LEDs, so how do I go arround and connect them together using a second power source?

3. An idea I was thinking off PWM-ing a transistor for this, would it work? what transistor would you recommend me?

4. Isn't PWM-ing a pin and recieving DATA from the PC interfering with eachother? perhaps different ways, like using the 555.

Any other tips/hint are also welcome, thank you for your time, I am a newbee, so keep it simple.
Logged

Brisbane, Australia
Offline Offline
God Member
*****
Karma: 1
Posts: 593
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Use 3 PWM pins, hook up a transistor to each and then attach all the LED's leads to the appropriate pins in parallel. So all the red leads go to the same pin, etc...
You cant do it in series because they are common cathode. Just ground the cathode pin on all the LEDs.
AFAIK your standard transistor would be fine.

How many are you thinking of having?
Powering the Arduino off USB gives you a limit of about 8 RGB LEDs when they are all displaying white (so ~24 LEDs total). You could probably have a few more than that.
How I know is because when I used 8 RGB LEDs displaying white with a LCD attached, everything dimmed slightly.
You can just use a 9 - 12v plug pack and that will power a lot of LEDs. No need for a second power source.

PWM while receiving data is fine. Both are done in hardware not software.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 24
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

 smiley Thnx for the sweet help on explaining this.
Ehh.. (getting my Electronics for Dummies book), lets say I do this for 4pin RGB LEDs.

For 1 PWM pin:

So, I get 1 transistor that can handle enough power to use for my LEDs

Put the PWM pin off the Arduino to Basis/Gate.
Put a decent power suply to the Emitter/Source.
Put My LEDs to the Collector/Drain.

And than do this also for 2 other pins....

Than I simple hook all the Red pins together, the Green pins together, and the blue pins together (ofcours connected to the proper collectors/gains).

Next I connect all the commen, where I connect the commen? Does that goes to the negative pole from the power suply?

Also, I am sure I need some resistors here somewhere (one always needs resistors smiley-wink )

If you say this could work, I will post a drawing.

edit: something like this? (can you sugest a decent transistor?, and this is for a 4 pin RGB LED smiley-wink )


edit2: Ahh. I read It is best to give each seperate LED a Resistor, should I place it before or after my LED?
« Last Edit: November 03, 2007, 09:33:45 pm by Westbam » Logged

Brisbane, Australia
Offline Offline
God Member
*****
Karma: 1
Posts: 593
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Doesnt matter if the resistor is before or after.

That schematic is correct for individual R, G and B leds.
Its similar for RGB ones.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 24
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

smiley Is it realy that easy? HOW COOL!!!   Thnx Cheater  8-)

Now, what resistor is use-able for this? And what LEDs do you recommend me?

EDIT: DELETED DANGEROUS DRAWING

Can do some resistor calculation once I know what the LEDs want on how my powersuply will be smiley
« Last Edit: November 04, 2007, 09:27:23 pm by Westbam » Logged

Brisbane, Australia
Offline Offline
God Member
*****
Karma: 1
Posts: 593
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You dont need R1. Just one resistor per LED (per colour for RGB LEDs since they are technically 3 in one).
Logged

Copenhagen / Denmark
Offline Offline
Edison Member
*
Karma: 6
Posts: 2360
Do it !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Here's a link to a PDF with all you need to know about current limiting resistors when hooking up LED's.

I forgot where i found it so i put it on my own site.

http://www.mikmo.dk/misc/led_hook_up.pdf

EDIT: Just remember that many of the very bright LED's are NOT 2V but 3V
« Last Edit: November 04, 2007, 03:04:04 am by MikMo » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 24
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well, thnx again for the info, This is getting cool!!

I hear/read that my Arduino has 6 PWM pins, but looking to the Amtel PinMapping, I only end up with 3 PWM pins. 1 RGB Color is cool though, 2 would be cooler smiley-wink

When I got this to work, I get me some Xbeez and build a wireless table, with LED inside, a bit like this one.

Perhaps I add a 64 leds (using this turorial) starlfield.

Enough about the LEDs now, I need to find me a decent transistor, any hints?
Logged

berlin
Offline Offline
Sr. Member
****
Karma: 0
Posts: 293
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

atmega8 => 3 PWM
atmega168=> 6 PWM

all current arduinos come with a 168. concerning the _right_ transistors: you're probably fine with many available models, i'm currently exploring BC337 (npn) transistors to gate audio from arduino. they are quite common, cheap, and probably would serve you fine... maybe someone knows better, but i got the impression that transistors are the most mysterical components when it comes to finding the best for one's needs.

kuk
Logged

Bangkok, Thailand
Offline Offline
Newbie
*
Karma: 0
Posts: 47
Arduino POP!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Westbam,
I'd correct the driver circuit into common Emitter NPN, It's better result and more ease to calculate component value

transistor biasing need R on pin Base (B) and use R2 as current limit on each LED
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 24
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

 smiley-grin You people are genuise!!! Thnx worapoht

I asked around and they said the same thing as I read now:

- A BC377 should do the trick. (NPN?)
- Place the LEDs before the source off the transistor (still not clear why, but I believe you all!!)
- And add an Base resistor between the PWM pin and the Base pin (4.7 kOhm?)

I am afraid I have an old Amtel on my old arduino  :'(

I made my scheme with TinyCad (took me 1 hour to download, figure out, draw and post!!)

Thank you all!! smiley Now I need to think about LEDs... all shops in my country are EXPENSIVE!! (I am dutch smiley-wink smiley-wink )
« Last Edit: November 04, 2007, 09:39:53 pm by Westbam » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 24
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

New Drawing, Add PWM - Base resistor



These LEDs now have a commen ehhh.... CATHODE (-)
(is this correct before I order the wrong ones?)
« Last Edit: November 04, 2007, 09:37:48 pm by Westbam » Logged

Bangkok, Thailand
Offline Offline
Newbie
*
Karma: 0
Posts: 47
Arduino POP!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Westbam,
After read your question again, the circuit you need should to be like this one

BC547 is general purpose NPN and BC327 is medium current PNP for driver (the 337 is NPN)
for Rr Rb Rg value are depand on lightness of each element (around 150 to 1k)
and current to element should not over than maximum rating of LED ,
for rough calculating.. If max. 100mA, V=IR -> R=V/I -> R = 12/0.1
Then R should not less than 120 Ohm.
as I know, RGB LED lightness per current are not same on each color element..
may apply 100% PWM and try several R value for balance RGB to White color
« Last Edit: November 05, 2007, 10:29:04 pm by worapoht » Logged

Brisbane, Australia
Offline Offline
God Member
*****
Karma: 1
Posts: 593
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The RGB LEDs I have, painted white, show white with equal current on all 3 pins so they arent too dissimilar.

If you dont paint them white or do something similar then it looks pretty horrible because the lights are about 0.5mm apart from each other.
You can see the individual colours.
Logged

Netherlands
Offline Offline
Sr. Member
****
Karma: 0
Posts: 414
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am Dutch too, I have found reasonable prices at http://www.voti.nl.

Good luck!
Logged

Pages: [1] 2   Go Up
Jump to: