Question about RGB LED (In comparison to another - doesn't work)

I have a basic RGB flasher circuit I built using 3 220ohm resistors, RGB LED, and PWM pins 9, 10, 11 for RGB respectively, and of course ground. I put in a sketch for a random color fade, and it worked great with the LED that came with the Arduino, but it isn't a defused LED which makes for crappy looking results since you can see all 3 led colors individually! Which is great for learning, however I also bought a diffused RGB led so I decided to stick it in the circuit instead, and to my surprise nothing happened... I double checked all the connections but nothing, I then tried to connect each color individually to 5v+ directly, and nothing happened, I was rather confused, so I got my multimeter and checked each color individually, and the thing lit up, albeit not at full power.

Now my idea is that I need to go with a lower ohm resistor, but why? Even with a direct 5v+ connection and not a PWM signal it still didn't light, I have no idea what battery this multimeter uses (I am guessing a 9v, I would have to take it apart to tell), and I can't test it on itself to tell the voltage! But it was enough to light up the LED even through the 220ohm resistor. I am going to try lower ohm resistors on it and see what happens.

MatCat, Could be one is a common anode RGB led and the other is common cathode. Try reversing the battery test connections on the new led WITH a resistor in line with the common pin. Always use the proper value resistor in series with an led, it might work for a while but will shorten it's life and output drastically if you don't. The package or vendor should have info on the type of led you have. TomJ EDIT: Sandpaper or some paint thinners will dull a transparent led into frosted. Also, your part numbers, schematic and code would do a lot to help people help you. TJ

Which RGB LED did you buy? Can you post a link to it?

Was from radio shack, I have to figure out where I put the package...!

Wow looking at the specs I didn't realize it was such a power hog LED... It's part # 276-0028, specs are 30ma green/blue, 50ma max red, fw voltage typical is 3.5v for green/blue, and 2v typical red. (Odd how red uses less voltage but more amps?)

Odd how red uses less voltage but more amps? .. but the same power, though.. (P=I*U) :)

Is it that PWM just isn't putting out enough to satisfy this LED? I did a quick google and found a few schematics of people using this LED but putting PWM on the cathode instead of the 3 separate anodes, I guess I will just have to try it and see what happens...

So it turned out that on this LED the RGB lines are grounded and the common is the +, looking around I found out this is achieved with a single resistor from power to led, and PWM from 3 pins as ground to each color, and this works but this brings me to my next thought... 1 220ohm resistor vs 3 (1 for each color), how do I figure out exactly using ohms law this way how much current is being used for each color?

asking/telling you to check if it was a common anode type RGB or common cathode type RGB was mentioned in post #2

Im not sure what the rest of the problem or question is though.. :)

Well what I am curious to know now is, why I only need one 220ohm resistor in this configuration... According to the specs of the LED listed above, with a 220ohm resistor on the 5v line, and 3 analog pwm grounding the individual colors, how do I calculate the total current being used (by each color, and totally), if it was a single color LED, I can easily figure this out using ohms law, but how does it work with this setup and 3 colors?

Here are the specs for your RGB LED:

Forward Voltage Red = 2V (typical) 2.6V (max) Forward Voltage Green/Blue = 3.5V (typical) 4V (max)

Current Red = 50mA Current Green/Blue = 30mA

I will leave it to you to use Ohm's Law to figure out the rest.

I understand that equation, but not in this case... 1 pin is supplying 5v to the common power rail of the LED, 3 are using PWM to effectively ground it for a fade value, how do I figure out first how much current is being pulled when lets say 220ohm resistor as there is, and all 3 colors are set to pwm of 0 (which would be full open ground to the pwm pins), the input is 5v, according to ohms law for a single LED with in this setup it should be pulling 20ma, but in this case it's feeding 3 seperate LEDs, on one 220ohm resistor, I assume they are in parallel, which means they are all getting 20ma? Does this mean it's pulling 60ma total from 1 pin which would be too much? I don't understand this particular part of what's happening.

You should use a resistor for each color, between the cathode and the PWM pin that you are using. PWM is going to control the intensity of each color, which allows for mixing the colors.

I believe that you are over-thinking this.

When you want to figure out which resistor to use for each color, you use 5V as the supply voltage, and the forward voltage of the specific color to determine how much you need to drop from the 5V. The PWM value means nothing in this calculation. You are ALWAYS providing 5V to the circuit as far as Ohm's Law is concerned. And your LED's are ALWAYS drawing their rated current as far as Ohm's Law is concerned.

PWM does not change the provided voltage or current values, it just switches on and off very quickly to SIMULATE changing the values.

you would use a DIFFERENT resistor for each color (mainly because RED will have a different vF than greens & blues)..

Yuup, use an resistor for each color pin, you silly overthinking goose ;) MEOW