Go Down

### Topic: RGB led: can I put only 1 resistor at ground? (Read 14137 times)previous topic - next topic

#### gilperon

##### Nov 16, 2014, 11:40 pm
Hi,

I know that if I have an LED I can put the resistor like this:

digital output -> resistor -> led -> ground
AND
digitar output -> led -> resistor -> ground

Both ways above will provide the same amount of current. Ok, I understand that. So why do I need always 3 resistors when using an RGB led? Take a look at this image:

http://www.comofazerascoisas.com.br/posts/arquivos-posts/157/projeto-arduino-led-rgb-06.jpg

In that image (I got it from the post at http://www.comofazerascoisas.com.br/projeto-arduino-controlando-led-rgb-multicolorido.html) the guy uses 3 resistors of 330 ohms each. I understand the reason he used 330 ohms cause this will keep the current under 40mA. But my question is this: why this guy didnt use only one resistor of 330 ohm at the ground?

Why does he use 3 resistors of 330ohm if he could use only 1 resistor of 330ohm conncted to the ground (hi his example latter he will plug all the 3 leds at the same ground, so why not using 1 resistor instead of 3)?

#### oric_dan

#1
##### Nov 17, 2014, 12:10 amLast Edit: Nov 17, 2014, 01:31 am by oric_dan
Won't work, need 3 Rs.

1. with just one series-R, when you turn on 2 or more Leds, then the current will split
2 or 3 ways, and the brightnesses will be lots dimmer than with 3 series-Rs. In the
latter case, the 3 Leds are effectively totally independent of each other.

2. with only one R, the green and blue Leds will never light, because Vf(orwards) for
the red led is only 2.1V and it's a much higher 3.5V for the other two, and you have
all 3 wired effectively "in parallel".

You need to understand "circuit theory" to understand this last statement - so you should go somewheres else and learn about all the basics.

See also some of the posts on this other thread.
http://forum.arduino.cc/index.php?topic=279436.0

#### larryd

#2
##### Nov 17, 2014, 12:49 am
No technical PMs.
If you are asked a question, please respond with an answer.
If you need clarification, ask for help.

#### Pelleplutt

#3
##### Nov 18, 2014, 05:21 pm
It is possible to use only one resistor by multiplexing the LEDs.

Turn on red, turn off
Turn on green, turn off
Turn on blue, turn off
Repeat

If varying the on-times you get different colours and brightness.

Pelle

#### Grumpy_Mike

#4
##### Nov 18, 2014, 07:03 pm
Wow what a trade off. All that multiplexing to save two \$0.01 resistors.

#### larryd

#5
##### Nov 18, 2014, 07:37 pmLast Edit: Nov 18, 2014, 07:38 pm by LarryD
Quote
Wow what a trade off. All that multiplexing to save two \$0.01 resistors.
LOL
No technical PMs.
If you are asked a question, please respond with an answer.
If you need clarification, ask for help.

#### Pelleplutt

#6
##### Nov 18, 2014, 07:54 pm
Wow what a trade off. All that multiplexing to save two \$0.01 resistors.
The question was:
Can I only use one resistor?, yes

Take two \$0.01 resistors, add cost to place them on board, multiply with 100000000 pc = lots of money

If you only make one pc, if it's possible why not do it.

Pelle

#### Grumpy_Mike

#7
##### Nov 18, 2014, 10:21 pmLast Edit: Nov 18, 2014, 10:59 pm by Grumpy_Mike
Quote
if it's possible why not do it.
Cos it is stupid. Can you not see that?
As is this:-
Quote
Take two \$0.01 resistors, add cost to place them on board, multiply with 100000000 pc = lots of money
Have you ever designed a mass production consumer electronics product? I have and that argument is not valid.

Nobody makes 100 million of anything. Even if they did what makes you think resistors are as expensive as \$0.01 each at this sort of quantity? Have you seen the quotes to have something made with two less resistors? They are identical. To get the brightness the same you have to run the LEDs at a higher current. That will affect the reliability of the circuit and hence the return rate, any notional savings quickly turn into a large loss.

#### Pelleplutt

#8
##### Nov 18, 2014, 11:57 pm
I have the last 35 years designed and produced proffesional electronics, all time trying to reduce costs.
It's better with 50 rows of code instead of hardware.
Sometimes I do not have space for 2 resistors, perhaps we can make a solution in software instead.

Whats the problem with multiplexing LEDs, that's made for decades, look at most multidigit displays.
At this forum there are made cubes with multiplexed LEDs, did they burn?
Of course you must check the datasheet for peakcurrent and powerdisipation.

If you ask for a quote, the manufactor counts the number of components, I do it.

It is stupid to say it's stupid when it's possible.

Pelle

#### oric_dan

#9
##### Nov 19, 2014, 02:36 am
Quote
If you ask for a quote, the manufactor counts the number of components, I do it.
This is kind of going off the deep end here. OP is clearly at the stage of needing to learn the basics, rather than build 100,000,000 boards.

Addressing this back to OP = gilperon, the "learning curve" says learn the basics first, then learn the clever hacks after a while. It will take you 2-pennies to solder in 2 additional Rs, and 2-days to figure out how to multiplex a bunch of Leds.

One issue with the RGB Led is the individual Leds have both different Vf as mentioned, and also different brightnesses in the 3 Leds. Typical, Red = 2.1V and 3000 mcd, Green = 3.5V and 5000 mcd, and Blue = 3.5V and 1000 mcd. Normally, people don't care, but having 3 series-Rs allows you to use different R-values and set different currents in the 3 Leds, and therefore compensate for the different brightness characteristics, if you need to.

Quote
I understand the reason he used 330 ohms cause this will keep the current under 40mA.
Also, these things are VERY bright. 40mA is a lot of current for hi-brightness Leds. Even at 10mA, the RGB Leds are so bright they'll bleach your photoreceptors in a couple of seconds at 2-foot distance.

BTW, his 330 ohms at Vcc=5V will drive only (5-3.3V)/330 = 4.5mA into the GB devices, and a little more into the R device. In my currently inprogress project, where the RGB is used as an indicator, I'm cutting the currents back to about 2 mA, just because they are so bright. So, more like 680 ohms.

One other issue is that people will immediately start talking about using extra driver stages, like NPN inverters, etc, in order to offload the Led currents from the processor I/O pins. This was more necessary when driving older Leds that did take 20-40 mA to get adequate brightness, than when using the newer hi-brightness Leds. In my project, I'm driving upwards to 20 indicator Leds, and the current is only in the range of 40-50 mA total, which is no problem for an Arduino chip.

#### dlloyd

#10
##### Nov 19, 2014, 06:04 amLast Edit: Nov 19, 2014, 06:05 am by dlloyd
I would connect it like this for a 3 color status indicator and use PWM for intensity control.

To get both colour mixing and intensity control, I think multiplexing 3 PWM signals might not be too difficult. Each PWM signal (R,G,B) could have its own duty cycle range that matches color brightness. When multiplexing sequentially one LED at a time, the other 2 LEDs would be turned off.

#### oric_dan

#11
##### Nov 19, 2014, 07:21 am
I would connect it like this for a 3 color status indicator and use PWM for intensity control.

To get both colour mixing and intensity control, I think multiplexing 3 PWM signals might not be too difficult. Each PWM signal (R,G,B) could have its own duty cycle range that matches color brightness. When multiplexing sequentially one LED at a time, the other 2 LEDs would be turned off.
Why do you guys insist on trying to get a beginner (??) to do things the hard way when all he needs is 2 extra 1-penny resistors to do it the easy way. Go look up the concept of the Learning Curve. First you learn the basics, to get a firm foundation in what you're doing. Later on, you can do all the fancy dancy stuff you want.

#### Grumpy_Mike

#12
##### Nov 19, 2014, 12:59 pm
Quote
I have the last 35 years designed and produced proffesional electronics,
Glad you never worked for me then.

#### oric_dan

#13
##### Nov 19, 2014, 07:26 pm
Be cool, Mike. These guys are not addressing the actual problem that gilperon brought to the thread. Their past lives are irrelevant. 100,000,000 boards is not relevant.

#### Pelleplutt

#14
##### Nov 19, 2014, 08:41 pm
http://www.comofazerascoisas.com.br/posts/arquivos-posts/157/projeto-arduino-led-rgb-06.jpg

In that image (I got it from the post at http://www.comofazerascoisas.com.br/projeto-arduino-controlando-led-rgb-multicolorido.html) the guy uses 3 resistors of 330 ohms each. I understand the reason he used 330 ohms cause this will keep the current under 40mA. But my question is this: why this guy didnt use only one resistor of 330 ohm at the ground?

Why does he use 3 resistors of 330ohm if he could use only 1 resistor of 330ohm conncted to the ground (hi his example latter he will plug all the 3 leds at the same ground, so why not using 1 resistor instead of 3)?
I answered gilperon it is possible to use only one resistor if he/she multiplex the RGB LEDs.
Mike started talking how cheap resistors are (they are not free of charge and take place).
Mike told me how stupid I was, well... I'm only a farmers boy but worked with construction and manufactoring electronics for many years. Always optimizing costs for components, assembling and service.

100 million was perhaps a little bit to much but look att the computerindustri if the can eliminating one component.

Go Up