1 min read

Arduino and RBG LEDs

Arduino and RBG LEDs

Ever since I bought my sidekick basic kit for Arduino I have been struggling with trying to get the RGB 4 pole LED to work......to no avail UNTIL TODAY!

Unbeknownst to me There are two different types of RGB LEDs and I had been trying to wire mine using the wrong schematic.

Type: Common Anode (+) - This type of RBG LED requires a connection to positive voltage (3v - 5v) using the longest leg along with a resistor.

Type: Common Cathode (-) - this type of RBG LED requires a connection to negative and each of the other 3 legs to positive using a resistor.
RGB LED Cathode/Anode Graphic

It's interesting to me to get a common anode LED to work requires you setting the color pin that you want to LOW, or off. While each of the other pins remain at High or On. Doing this grounds that specific pin and completing the circuit. It's opposite of what I was thinking.

Below is a photo of my Arduino wired up, my build list & a very simple sketch to show some of the different colors generated by the LED.
wired nano led

Connections

  • Arduino D11(PWM) - GREEN --> Pin 1
  • +5v(27) to + Rail -->330Ω Resistor --> Pin 2
  • Arduino D10 (PWM) - BLUE --> Pin 3
  • Arduino D09 (PWM) - RED --> Pin 4

Build List

  • Bread Board
  • 5 Jumper Wires
  • Arduino (I used a nano v3)
  • Full color 5mm LED from RadioShack (276-0028)

    from the flat side of the LED body
  • pin 1 Red (-)
  • pin 2 Positive Voltage
  • Pin 3 Blue (-)
  • pin 4 Green (-)

Arduino Sketch