Connecting a 5050 RGB LED

I got this single 5050 RGB LED module that I want to connect to BBB:
http://www.ebay.com/itm/1PC-New-RGB-3-Color-Full-Color-LED-SMD-Module-For-Arduino-AVR-PIC-/181259217039?pt=AU_Car_Parts_Accessories&hash=item2a33e4288f&vxp=mtr

It says operating voltage: 5v. So if I connect it to BBB’s pwm pins, it won’t work (and nothing bad will happen)?
Do I need resistors for this module in general?

I would really need to see a datasheet to answer your question. I doubt very much that 6mA is enough to turn the LEDs on, especially if it likes to see 5V in its natural environment.

Gerald

Thanks, Gerald. Well, here it says for this module:

Red Vf: 1.8 to 2.1V
Green Vf: 3.0 to 3.2V
Blue Vf: 3.0 to 3.2V
https://sites.google.com/site/summerfuelrobots/arduino-sensor-tutorials/3-color-rgb-led-module

So in theory I could connect it to BBB’s pwm pins (3.3v?) after all but with 3 x 1k ohm resistors? It won’t be bright, but it will be safe (for BBB) and it will work?

Well, it won’t be bright for sure. Maybe not even on. But as long as the 3.3V is taken from the expansion header it should be OK. As to 1K, that would be safe.

Gerald

no, it will not work connected directly to the BBB as Gerald stated. He said it will only provide 6mA of current and you have 3 LEDs which, if you read the specifications, will require more than that for each LED to light. Voltage is not current but it is related along with resistance via Ohm’s Law.

http://en.wikipedia.org/wiki/Ohm’s_law

you will need to understand this at the very least if you plan on connecting things to the BBB beyond things others have build specifically for connecting to it.

You definitely want to use Ohms Law V=IR

So your input voltage is 5V, and your voltage drop is 1.8-2.1, therefore you have a net voltage of 3.2 - 2.9 - given that your supply is exactly 5.0V.
What’s typical to drive this type of LED is 20ma current source. LEDs are really current devices not voltage devices.

So R = V/I R=3.2/.02 = 160 or R=2.9/.02 = 145. If your are driving directly to ground.
I’d assume you’d want to switch these with a transistor or FET. So you’ll need to subtract their voltage drop too. A FET would almost be negligible.
But that can be calculated too, use its on resistance times the current you want (again V=IR) example a 2N7002 will have a on resistance of 4 Ohms @ Vgs of 4.5 and 200mA
You should really look at the curves for On-Res vs Drain current - there you get an estimation of 1.3 Ohms at 0.02mA with a Vgs of 4.5-5V.
So V=IR V=0.02*1.3 = 0.026V - that would change the resistance values to 158.7 and 143.7 Ohms.

For the 3.0-3.2 you would then have 3.026 and 3.226 => 1.974 and 1.774 drop with 0.020 A yields R of 98.7 and 88.7

Ideally, you don’t want to drive the LED at it’s max all the time - it will shorten its life.
I would shoot for 15-18mA as the max.
Using the lowest Voltage drop stated (the higher drop will be safe and you’ll have less drop and therefore current through the resistor)

So for the Red - (5-1.826)/0.020 = 158.70

(5-1.826)/0.018 = 176.33
(5-1.826)/0.015 = 211.60 Split the diff = 194 - std resistance values in that area are 196 and 200 Ohms. Lowest I’d go is 162 Ohm 1%
For the G & B - (5-3.026)/0.020 = 98.70
(5-3.026)/0.018 = 109.66

(5-3.026)/0.015 = 131.60 Spit the diff = 121 - std resistance values in that area are 120 and 121 Ohms.Lowest I’d go is a 100 Ohm 1%

Adjust the resistors based on the actual voltage of your supply - substitute it for the 5 in the equations above.

Now I just realized something. If you want to PWM each of the colors it will be a bit more difficult as this board is Common Cathode - which means the
minus or negative side (cathode side) of each of the LEDs are tied together - therefore you need to PWM the source side vs the ground side
This just means that you’ll need to use a PNP or a P-FET instead of a N-FET like the 2n7002.

Driving this is a little more complicated - can still use a N-FET if you have a higher voltage source that you can switch.
If not use a P-FET and then drive the PWM signal to a open collector or open drain logic gate that’s 5V tolerant.

Another option is to use a high current gate or driver IC that will translate your 3.3V signal to a 5V signal or even 3.3 would work if your actual drops don’t
exceed 3.2V - then you could drive them directly and use smaller resistors since your source voltage would be 3.3 vs 5.

As you can see there are many ways to skin this cat.

If you need more help, let me know.
GL,
Matt