The other option would be to have a common positive voltage of 0v and have the negative voltages be negative so 3 3 or 5 v for a micro controller and 12 v for the leds but this then requires you to make sure the negative voltages aren t connected directly which would prevent say running a led light strip and an arduino off the same power.
Common cathode rgb led strip arduino.
You cannot distinguish between the common cathode and common anode type by just looking at the rgb led because both look same.
The one that we are going to use is the common cathode rgb led.
If we were using a common cathode we would connect it to ground gnd instead.
Setting up the circuit.
Common cathode rgb leds have 4 pins 1 shared cathode you generally connect this ground and 3 anode pins for red green and blue you generally connect each of these through a current limiting resistor to an arduino pin.
Common cathode devices tend to be more popular as the cathode is the negative side of the led and is usually connected to ground.
Using common anode ca rgb led with arduino.
We are using 3 resistor to limit the current drawn for the red green blue pins.
Plug the led in the breadboard.
How do you find out whether the led is a common cathode or anode.
Each of them are 330 ohms.
Edgelec 100pcs 5mm rgb tri color red green blue multicolor 4pin led diodes common cathode clear round lens 29mm long lead 300pcs resistors for dc 6 12v included light emitting diodes 4 7 out of 5 stars 435 8 99 8 99 0 09 count get it as soon as mon aug 17.
The basic rgb led is available in two configurations common anode and common cathode.
Connect each of the led color terminal red green blue with the digital pins in arduino with the 221 ohm resistors in series with each one of them.
Common cathode and anode the rgb led has four pins one for red one for green one for blue and then one which goes to ground or 5v depending on if you are using a common cathode or anode led.
The rgb led we are using is a common anode so it requires 5v to the common pin.
Connect common anode of led to 5v pin of arduino in common cathode we connected it to gnd pin.
A rgb common cathode led should have it s longest leg leg 2 connected to the ground pin on your arduino current source in both cases you ll connect the r g and b legs of the led to io pins on your arduino through some suitable resistor 200 330 ohm to not burn out the led.
From longest to shortest the pins are cathode green red blue.
So we will connect the common pin to the gnd of arduino and the other three leads of the led s to the pwm pins of arduino.