# Messing with rgb leds and have a question

I have some LEDs that I'm wanting to use in a project. I would like to know what's the best resistor I would need to get the most light out of the 3 different colors using a 12v source. I've measured the forward voltage drops of the LEDs as:

• Red: 2.17 V
• Green:3.11 V
• Blue:3.07 V
• Datasheet where? Commented Jul 2, 2014 at 5:16
• Idk where to get one. It didn't come with one and the place I got them didn't have any info. Just 4pin rgb LEDs 5mm. Sorry I don't have much to go on Commented Jul 2, 2014 at 5:23
• Then whip out your multimeter and get the forward voltages, so that we have at least something to go on. If your diode test mode won't work then use a 1kohm resistor in series with your 12V power supply and measure the voltage across. Commented Jul 2, 2014 at 5:25
• Diode testing: R is reading about 1.400 (I think doesn't show the . On the screen), G is reading the normal 1 with 2 spaces afterwards and so is the B Commented Jul 2, 2014 at 5:35
• The "1 with 2 spaces" means that they're too high for diode test mode. This is expected. Commented Jul 2, 2014 at 5:36

"Most light" usually means 20mA. Here is the generic equation for an LED:

$R = {(V_S-V_f)\over I_f}$

Red:

${(12\text{V}-2.17\text{V})\over 20\text{mA}} = 491.5\Omega$

Green:

${(12\text{V}-3.11\text{V})\over 20\text{mA}} = 444.5\Omega$

Blue:

${(12\text{V}-3.07\text{V})\over 20\text{mA}} = 446.5\Omega$

So we're talking 510ohm for red and 470ohm for green and blue, assuming your supply is 12V. Otherwise substitute the correct value in the equations and recalculate.

• Now how can I find the resistents to black out the LEDs? Commented Jul 3, 2014 at 6:23
• Is there a particular reason why you can't just disconnect them? Commented Jul 3, 2014 at 13:25
• I want to know the range in which they light up so I can adjust the colors using a pot Commented Jul 3, 2014 at 19:25
• They would likely become not visible at about 0.1mA, but verify that. Commented Jul 3, 2014 at 20:32

In order to safely get the most light out of an LED the best solution is to use a constant current source, this will ensure the LED stays at the right brightness even as its characteristics change as it heats up, changes in your supply voltage or the color of the LED.

A current source can be made from an extremely common and cheap lm317 (buy a bunch on ebay, they are handy) and a resistor. simply utilize this circuit but with an LED instead of a battery. You will need one of these for each LED.

The resistor value can be changed to choose the current which will end up being 1.2/R. so the 24 ohm resistor in that circuit gives 1.25/24 ~= 0.050amps or 50ma. using an easier to find 47 ohm resistor will give a healthy 26ma which is a good place to start for a bright LED. You can then decrease the resistor value which increases the current until you reach your desired brightness.

When using this scheme you can ignore the voltage rating of the LED and of the supply, they are irrelevant. You don't even need a regulated supply. You just need to worry about the current rating of the LED which can be found in the datasheet. Once you find that, calculate '1.25/datasheet current' and that gives the minimum resistor value you can use and will give maximum brightness, don't use resistor values smaller than that or you risk damaging the LED. (note: some LED datasheets may assume you are heatsinking your LED, so reduce the current if it is getting too hot until you can put it on a heat sink)

• From the second comment, the OP does not have a data sheet and doesn't know where to find one, so references to using datasheet values is not exactly helping. Commented Jul 2, 2014 at 12:59
• The datasheet was only to find the safe maxiumum declared by the manufacturer. The circuit still works, you just gotta watch if it is getting too warm on your own. which is a good idea anyway as random LED datasheets can be wildly off. Commented Jul 3, 2014 at 3:41

One should also take into account where you are going to connect those LEDs to (i.e. Arduino, ESP8266, RPi, bare µC, ...) As often the limiting factor becomes the current your "device/chip" can source (current comes out the chip) or sink (current goes into the chip) instead of the max current your LED can take. The limitation is both pin and device wide. I mean: often pins can source, let's say, 15mA but only for a chip-total of 60mA. So you can only use 4 pins at that 15mA current. If you have more i/o in use you need to take that into consideration to prevent your chip from overheating. Therefore consider buying high-efficiency leds as they give more light at lower current (few mA). Also look for common anode Leds or segm-displays as µC have often more sinking then sourcing capabilities. Only "disadvantage" is that you get to use inverted logic as a 0 at a pin gives an illuminated LED.