rgb led flickers

hi

I've connected my Rgb led to Pwm 3, 5, 6.
I set the values of 3, 5, 6 to 100 and the led started to flicker.
I used only a resistor to the "common collector" of the led.

When i changed it, and put 3 resistors (one for each color pin), and removed the resistor on the "collector".

It stopped flickering !

Why ?

Different colour LEDs have a different working voltage (Vf).
The RED one being the lowest.
When the red LED turns on, the others go dim or turn off.
Therefore each LED needs their own current limiting resistor.
Leo..

The connections on an LED are not called a collector, that is the name of one of the connections on a transistor. An LED has a cathode the negitave connection and the Anode the positive connection.
With an RGB LED you need three resistors not one.

The LED flickered because the different PWM pins use different frequencies, and using a single resistor means that these interact with each other in powering the LED.

You have learned a lesson - using a common resistor will always cause interaction of the signals you use to drive a LED array; you need to use separate resistors or proper constant-current drivers.

Hi Paul__B, Can you elaborate more on the answer ?

Why when I have only a resistor on the Cathode the signals interact. Can you elaborate on what interaction happen ? Is there a current flow from the red to the green or something similar ?

And why when I have a resistor on every anode the signals don't interact ? resistors are passive, they just reduces the current, I don't understand how they prevents the flickering

Thanks, Dima

With one resistor all the current flows through it. So the voltage drop across it depends on the sum of all three currents. So if one LED current changes the voltage seen by the other two LEDs drops because the voltage across that resistor increases.

This does not happen with separate resistors.

Thanks Grumpy_Mike