I was trying to test some rgb leds and it keeps flickering when i use red + blue or green + blue, but not when a single color is on.
Before anyone asks, i measured everything and(when using red + blue when its flicking the most) the red pin is at 1.4V, the blue pin is at 1.6V, the resistor is 220Ω and the current flowing to ground is 5mA.
I also tried changing to another led, but it didnt change much, it flickered a little bit less but still flickered alot.
Please help.
Hello,
First of all I would change the circuit you have so that you have a 220 Ohm resistor for each anode, and no resistor on the common cathode.
With the single resistor you are fine when using one colour, but when you use 2 or more the resistor will be too large for the combined required current and each LED will get less power than when you only use 1 colour.
If that doesn't fix it can you post your sketch so we can see what is happening?
I have just been playing around with these and posted a library yesterday to control RGB LEDs that you could try out to see if you get the same flickering:
https://forum.arduino.cc/index.php?topic=615904.0
Hope it helps,
Kris.
It also causes the flickering Voltage drop across a led is fixed. And if you put leds in parallel the lowest voltage wins. Which is the red causing the blue and green to be off when you power the red.
thanks guys, it really did work when i put 1 resistor for each pin, there is no flickering now.