Arduino Forum

Using Arduino => General Electronics => Topic started by: Wundy on May 18, 2019, 08:18 pm

Title: Need Help with RGB Diodes
Post by: Wundy on May 18, 2019, 08:18 pm
Hello,

i cant figure out what im doing wrong. im running the arduino RGB tutorial sketch on my arduino uno. it works fine with my RGB diode from "the most complete starter kit".

T-1 3/4 (5mm) FULL COLOR LED LAMP - Part Number: L-154A4SURKQBDZGC

I bought some more RGB diodes from gearbest webstore and they dont work with the same sketch / hardware setup.

Forward Voltage (V) : 1.9 - 2.1V 3.0 - 3.4V
Maximum reverse voltage: VR 5 (v)
Forward For dc current: 20mA

They nearly have the same specs but dont light up. i tested them in another projects and they are working fine so im sure they are not broken.

What am i doing wrong?
Title: Re: Need Help with RGB Diodes
Post by: larryd on May 18, 2019, 08:22 pm
It may be that one LED is common cathode and the other is common anode.

You can prove things out by using a simple resistor and 5v power supply.



Title: Re: Need Help with RGB Diodes
Post by: PaulRB on May 18, 2019, 08:25 pm
Quote
What am i doing wrong?
You are not posting links to the original led and the new LEDs. See the forum guide to find out how to post links correctly, so they can be clicked. Part numbers are unique to each supplier, and don't help us finding the exact component when we don't know who the supplier is. Descriptions like "the most complete starter kit" have even less meaning.
Title: Re: Need Help with RGB Diodes
Post by: Wundy on May 18, 2019, 08:29 pm
Thanks for the fast replies!

larryd you are right... the onces not working have common anode. stupid mistake by me. thank you so mutch! is there a way to use PWM with common anode?
Title: Re: Need Help with RGB Diodes
Post by: larryd on May 18, 2019, 08:40 pm
For common anode wire them as top LED(s).
The common goes to +5, use 3 resistors.

For common cathode wire them as bottom LED(s).
The common goes to GND, use 3 resistors.

(https://forum.arduino.cc/index.php?action=dlattach;topic=616619.0;attach=308793)
Title: Re: Need Help with RGB Diodes
Post by: Wundy on May 18, 2019, 10:16 pm
thanks alot! i still have to change the sketch accordingly right? if high value was 255 and low 0 for common cathode i need to change to 0 for high and 255 for low?
Title: Re: Need Help with RGB Diodes
Post by: PaulRB on May 18, 2019, 10:31 pm
Correct