What common cathode means
The LED package has six pins: three anodes and three cathodes. The board joins the three cathodes to GND, which is what COMMON CATHODE means, and it is why HIGH lights a colour. A sketch written for the other kind of RGB LED shows you the opposite colours.
Three LEDs in one package
The LED on the board is an Amicc A-SC667R6AGHB1W, a 5 mm square package with six pins. Inside are three separate LED chips, one red, one green and one blue, and each has its own anode and its own cathode. According to its datasheet, pins 1, 3 and 5 are the blue, green and red anodes, and pins 2, 4 and 6 are the three cathodes.
As a part, then, it is three independent LEDs. What makes it "common" is the board: the copper joins pins 2, 4 and 6 together and takes them to the GND pin on the header. The net list has all four in one net.
Which way round a colour lights
Current through an LED flows from anode to cathode. On this board the cathodes are at 0 V, so a colour lights when its anode side is pulled up: set the pin HIGH, and current flows from the pin, through the 1 kΩ resistor and the LED, to GND. Set it LOW and both ends are at 0 V, and nothing flows.
That is what the board means by ACTIVE HIGH. HIGH is on, LOW is off, and with PWM, 255 is full and 0 is off.
The other kind
Many RGB LEDs are sold the other way round: common anode, with the three anodes
joined to the supply. On one of those, a colour lights when its pin pulls LOW
and sinks the current, so 0 is full and 255 is off. Code written for such a
part usually sends 255 - value to every pin.
Run that code on the TK02 and every colour is inverted. Ask for red and the red pin goes LOW while green and blue go HIGH, so you see green and blue together. Nothing is broken; the sketch expects the other kind of part. The fix is to remove the subtraction.
What GND carries
Because the three cathodes share one pin, GND carries the current of every colour at once. From 5 V that is about 3 mA for red and about 2 mA each for green and blue, worked out in the next chapter: about 7 mA with all three on, and nothing any board will notice.
When it does not work
Look for 255 minus a value, or a comment saying common anode. That code was written for a part that lights when its pin goes LOW. On the TK02 it shows the opposite colour: ask for red and you get green and blue. Delete the 255 minus and send the colour itself.
No. The three cathodes are joined to GND in the board's copper, and the only way in is through the anodes, via the resistors. It is common cathode, and every sketch in this book is written for that.
They mark the two rows of the LED's pins. The row under GND is the three cathodes, all on the ground copper. The row by the plus sign is the three anodes, each with its own resistor below it. It is the same fact the edge prints as COMMON CATHODE.
Yes. Each colour has its own resistor, so each pin supplies only its own LED's current, a few milliamps. GND carries the sum, which is still only about 7 mA with all three on from 5 V.
Four wires and a sketch that shows red, green and blue in turn.
The first colour →Edit this page — content/books/rgb-led/what-common-cathode-means.mdx
Questions about this product
See what other owners have asked, and read their solutions.
RGB LED
Loading discussions…
Discuss this article
Ask about this page. The answer stays here, on the page it belongs to, for whoever hits the same wall next.