Print Page | Close Window

in understanding rgb led’s

Printed From: the12volt.com
Forum Name: Lights, Neon, LEDs, HIDs
Forum Discription: Under Car Lighting, Strobe Lights, Fog Lights, Headlights, HIDs, DRL, Tail Lights, Brake Lights, Dashboard Lights, WigWag, etc.
URL: https://www.the12volt.com/installbay/forum_posts.asp?tid=124529
Printed Date: May 13, 2025 at 7:54 PM


Topic: in understanding rgb led’s

Posted By: dormage
Subject: in understanding rgb led’s
Date Posted: November 18, 2010 at 3:02 PM

Hello,
I've been working on a small project of controlling a few RGB LED's with a controler.
Programming went smooth and it was pritty fun.
I ordered some Leds from ebay 5mm difused 5V RGB LED's 4pins.
I hoocked everything up and tryed making them color my wall.
I'm passing RGB values to my controller witch then outputs the acording voltage to each of the pins(excuse my terminology i'm a newb).
From what i read this is done with PWM witch my controller (arduino) alrady has.
Problem:
When i light each individual color to full and others to 0 it works great. Red = red and blue is blue and so on.
As soon as i tryed mixing colors they don't actualy mix!
I just see a circle of blue color and a circle of red color on my wall.
I've been looking at some project's people have made and videos of them, and everybody seems to have made the led's produce yellow or even orange. I don't know if i'm doing something wrong or not but i'm 100% sure it's not the program.

The electronic part i'm defenetly doing wrong cause at the moment i'm not using any resistors. But i fail to see how the resistors could change the fact that the colors don't mix at all, its the same as having 3 LED's each of it's own color.

Maybe i've baugth the wrong LED's?

Can anyone explain and fill the void in my brain on this one?

Thanks!



Replies:

Posted By: oldspark
Date Posted: November 18, 2010 at 4:58 PM
You don't need resistors provided the max time-current rating of each LED component is not exceeded.
EG - a 20mA LED may tolerate 150mA for a max 10% duty cycle or max 10mSecs.
Exceed those ratings and it may blow.
But normally a resistor is used for each LED segment (or series string) to set a max current.


You should be able to test one color only and confirm its PWM as it varies brightness from 0% to 100%.
Do the same for all colors.   

If they do, then those routines running independent should change the colors.

Good programming should provide for such testing.


Running the same PWM on all will just change brightness, though some color shift may occur if their current-brightness responses are different.


Remember too that the LEDs must converge - ie, shine or overlap on the same wall area, else be perceived by our eye as a single source (as done with printers or LCD & TV screens).




Posted By: dormage
Date Posted: November 18, 2010 at 5:10 PM
Thank you that explains lots of it.
I've alrady written a program that takes each pwm from 0 too 255 and back to see if each of the RGB's are working properly and it appears everything is in order.
Maybe i should cover the LED's with some diffused plastic to get rid of the feeling that i only have 3 leds each of its own color.
I turned the lights off and moved away from my computer and i guess from far away the wall seemed "kinda" purple altugh i must admit i was expecting more.

I think i wount need resistors, but in case i decide to use them, would it make sence to put 3 resistors on 1 LED, 1 for each pwm pin?

Thanks for everything!




Posted By: oldspark
Date Posted: November 18, 2010 at 5:36 PM
You are all correct.

Yes - diffuse to "mix" the colors. Thin paper, scratched perspex, or my dirty glasses. (All white. That's not an "alright?" pun, I mean all white-ish diffuses. Colors only re-transmit their own color (obviously, yet often overlooked).



Resistors? I suspect the uPC being on 5V, less the chip or PWM switch's voltage drop is enough to drop the voltage down to (say) the 3.3V 20mA LED's maximum (say) 4.2V or max current etc.
If it hasn't blown so far, maybe it never will?

Normally yes - a resistor in each leg because if it were a common/single LED for all 3, the the resistors current varies from (eg) 20mA for one LED to 60mA for all 3, hence a 1:3 voltage variation.
But maybe that doesn't matter. It may even enhance the effect by dimming when all 3 are up full?

Reconsidering, I'd either leave as is, else maybe add the single resistor if I was worried about blowing the RGB...


Now, when it comes to using my Audrino... (LOL - I bought 2 Dueys several months ago...)

Best wishes.




Posted By: dormage
Date Posted: November 19, 2010 at 2:19 AM
Yeh, Its an arduino powered by the USB port witch is 5V, I've been testing my program for a day now and the LED's are allright so i guess they woun't blow up :P
Thanks for answering my questions, realy helps a lot :)
Your working with arduino too?




Posted By: oldspark
Date Posted: November 19, 2010 at 4:56 AM
Let us/me know when it works. (Or doesn't - ie, eventually continue else close this thread..)


dormage wrote:

Your working with arduino too?

Er, um, well... I bought 2 Duemilanoves (ATmega328)... er, aha! back in May (2010).

Not sure why - maybe sequential ignition without the need for an extra sensor in the dizzy - but I recall deciding between PIC(AXE) solutions and uPCs.

I chose uPC (the ArDueys) because they were half the price of established PIC systems and did not seem to have the same limitations.
I've done nothing except download a different flash rate program for its onboard LED to confirm they were ok (eBay), and familiarise a little with the ATmega instruction set (I prefer and intend assembler programming).

Maybe one day or century I'll start my ignition or EFI or dash projects...




Posted By: KPierson
Date Posted: November 19, 2010 at 5:39 PM
Have you played around with difference distances? Do you have a link to the data sheet for the LED?

-------------
Kevin Pierson




Posted By: dormage
Date Posted: November 19, 2010 at 8:30 PM
The link to the datasheet died i hope it gets restored asap.
This is the link:
https://www.electronikdreamz.com/data/LED_5mm/U/5mm_RGB_U.pdf

I'm new to the world of LED's so i didn't try anything.
Only thing that bothers me is that the colors don't mix.
It's just like having 3 different LEDs.

Is it posible to make a "shell" out of some reflective material to focus all the beems in 1 spot, maybe then then the colors would mix?

At this point i'm going to try the ping pong ball idea as soon as i get my hands on them :)

Thanks for all advices :)

P.S if the datasheet link still dosen't work maybe i could give you some info.. if by chance i know any :)
What i remeber is that each of the pins (r,g,b) can handle 20mA.
And it also said they are watter clear and ultra bright :)
I might sound stupid but im a newb at this.




Posted By: KPierson
Date Posted: November 19, 2010 at 9:41 PM
How far are the LEDs from the wall? What I would look for in the data sheet is an optimal focal length or something like that. If you have three LEDs in one case I would assume there would be an optimal distance for all the color to mix.

-------------
Kevin Pierson




Posted By: oldspark
Date Posted: November 19, 2010 at 11:10 PM
Is it like electronikdreamz.com/data/LED_5mm/D/5mm_RGB_D.pdf?

They are 30mA LEDs with peaks of 100mA or 150mA (10% duty-cycle, max 0.1mSec) and Fwd Voltage drops (Vf) at 20mA of 1.8V & 3V nominal, or 2.5V & 3.6V max.

But its lens color is "Diffused", hence the colors should be mixed.




Posted By: dormage
Date Posted: November 20, 2010 at 4:26 AM
Well i guess i your rite, they should be "diffused"
but the colors stilll don't mix. They are like...1,5 - 1.0 meters away from the wall.
Is it worth trying to diffuse the alrady diffused leds?




Posted By: KPierson
Date Posted: November 20, 2010 at 7:01 AM
what happens if you move them 5 cm from the wall? Does the distance from the wall have an effect on the mixing of the colors?

-------------
Kevin Pierson




Posted By: dormage
Date Posted: November 20, 2010 at 3:49 PM
Well nothing realy, 3 circles on the wall become smaller :D
But if i bring them close to the wall and hide them with a peace of plastic, turn off all lights maybe, but just maybe some of it appears to be yellow, or oragne or whatever "mixed" color I'm trying to get.
Its a bit better when i move far away from the LED's.
Maybe everything is ok and I'ts just me and the fact i expected more.
I'll try to post a video or photos of the thing at work, that way It'll be easyer for you to see if I'ts just me or the LED's suck :)

Thanks !





Print Page | Close Window