3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Demystifying 4 pin RGB LEDS (Radio Shack 276-0028)

Demystifying 4 pin RGB LEDS (Radio Shack 276-0028)
RGB LEDs are fairly useful in projects allowing for a wide range of color from a single unit.  However they can be a pain in the neck to work with and they too often come with little or no documentation.  I searched for some time to find a common resource on them and this Instructable is an attempt to pool the fruits of that search into one place.

But first, a word about diodes.  What is a diode?  It is the electronic equivalent of a one-way valve.  They have a flow direction, and if inserted backwards do not work.  They prevent the voltage from flowing through, except in the direction of their flow.  The first diodes were used as rectifiers in decoding radio signal modulation.  For more on the history of the Diode, your welcome to check them out on Wikipedia http://en.wikipedia.org/wiki/Diode

Whats that have to do with LEDs you ask?  Well LEDs are by nature diodes.  It is in their name -- Light Emitting Diode.  This means that if you cross connect the Anode (+) and the Cathode (-), nothing happens and your circuit fails.  Usually resulting in nothing more than an open circuit as voltage cannot flow.   For more on the history of the Light Emitting Diode, or LED, you can go here on Wikipedia http://en.wikipedia.org/wiki/Light_emitting_diode

Four pin RGD LEDs are a little different.  They share a common Anode, but three separate Cathodes, one for Red, one for Green, and one for Blue.  If your not careful you can pass current through conflicting parts and cause a spectacular failure complete with a snap, a pop, a whiff of ozone, and plastic shrapnel flying all over your workspace.

This is usually caused by the omission of a current limiting resistor to the circuit (yes, I'm guilt of this).  Incidentally, this sort of failure is not covered by Radio Shack's warranty.

The LED in this project was purchased at a local Radio Shack and has the following part number, 276-0028
 
Remove these adsRemove these ads by Signing Up
 

Step 1The Pinout

The Pinout
One of the most annoying part of these little gems is the lack of a pinout diagram that was useful.

While looking at the photo, you will notice that the four pins are three different lengths.  Also there is a flat side of the housing on the left side.  With the flat side to the left, as in the photo, the pins are:  RED Cathode (medium length pin), Common Anode (longest pin), , BLUE Cathode (shortest length pin on the inside), and GREEN Cathode (shortest length pin on the outside).  This is not how I would have designed the unit as I think it would be easier to keep up with it if were Red-Green-Blue, but that's logic for you.

A quick look at the datasheet screen-printed on the package indicates that the different Cathodes use different current levels.  2.0V to 2.6V max at 50ma for the Red, and 3.5V to 4.0V at 30ma for the Green and Blue.  Its important to note this when calculating what resistor(s) are necessary for your project.
« Previous StepDownload PDFView All StepsNext Step »
16 comments
Apr 13, 2012. 2:18 PMadammary says:
Hi,
Not all the pins must be connected to PWM pins right? I mean if I want to leave the red light on and vary just the blue and green light, i can just connect the pin corresponding to the red light to a non PWM-pin?
Mar 20, 2012. 7:40 PMCheesePatrol says:
Thanks! This came in very handy on a project I'm working on
Feb 25, 2012. 6:34 PMfacklere says:
My knowledge of electronics is extremely limited, so I could be completely wrong, but I believe the placement of a resistor after the LED works because it still limits the flow of current through the circuit. If the lead after the LED is disconnected, opening the circuit, the LED can not blow out because current is not flowing through the circuit. In the same way, if you limit the amount of current flowing after the LED, it will also limit the amount flowing through it. Again, could be totally wrong on this. Anyone know if it's right?
Feb 21, 2012. 4:58 AMmpilchfamily says:
You may want to reread and relabel everything. In your image you have the pins labeled wrong. The longest pin is your common Anode. Your last paragraph in step 1 then mixes up the Anode and Cathode again.

In your final hookup your using a single 220 ohm resistor on the Common Anode. While this works to keep the LED from burning out it doesn't balance your colors. As you mentioned the individual colors in the RGB have different forward voltages and current. I cover this in my 6 Button LED controller i posted a couple of weeks ago. 
http://www.instructables.com/id/6-button-RGB-controller/

So if you want each color to have the same brightness you will need a different resistor for each of the Cathodes.This way when all 3 colors are full on you have the LED shining white. Otherwise your have a greenish blue hew to the light. That is why your blending effect looked a little off. 
Feb 21, 2012. 9:16 AMmpilchfamily says:
I struggled with the same thing when i was working on my project a couple of years ago. Had a big discussion about it all on the Arduino Forums. At first i was using separate red, green and blue LEDs to make my sketch. I then went to Radio shack to get an RGB. I ran into all sorts of problems when i switch to the RGB. My sketch was originally controlling the LEDS through the Anode. So getting an RGB with common Anode forced me to reverse the logic of the code. So the complications of the LED change and my limited coding knowledge made things difficult. Here is the link to the thread.
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1263501476
Feb 22, 2012. 1:37 PMpcooper2 says:
You can also reverse the logic by using external inverting Darlington pair drivers in common-emitter configuration. That way, the Arduino code doesn't need to be changed, and the external drivers can be easily replaced in case of electrical damage, without risking the microprocessor chip.
Feb 22, 2012. 1:39 PMmatt.e.jenkins says:
I wish i had this a while ago. I used one in a project and it was tricky figuring it out. Thanks for this.
Feb 22, 2012. 11:11 AMdwbechtel says:
Actually, you supply power to the Common Anode and pull each Cathode to ground.
Feb 22, 2012. 8:17 AMmaxhirez says:
Thanks Dain! I got a load of these in an eBay lot and was starting to wonder if they'd ever have a use on my workbench other than sacrificial lambs...
Feb 21, 2012. 7:45 AMpcooper2 says:
The lack of proper documentation is a RadioShack hallmark; it has been so for decades. If the package includes the manufacturer's name and part number, one is well advised to go to the manufacturer's Web site and get a PDF copy of the specification sheet, which will include a package diagram with pinout, and often includes test circuits and even application hints. That's how electronics design engineers do it. It's much easier these days, as one doesn't need to get physical copies of the companies' data books.

Other good sources of PDF data sheets are industrial distributors, such as Digi-Key Corporation (www.digikey.com) in Thief River Falls, Minnesota and Mouser Electronics (www.mouser.com) in Mansfield, Texas. In the days of printed data books, the distributors would also supply all the documentation that engineers needed. Today they do it in the form of freely downloadable PDF files. As a matter of fact, as long as you're at the Digi-Key site, set up an account and place an order. RadioShack has a reputation of selling manufacturing seconds -- slightly out-of-spec parts that are considered "hobby grade". If you have a real, serious project, you might as well buy the real, in-spec parts from a reputable distributor. Digi-Key started out as a small outfit catering to the small buyer, and even though they've gotten big, they still fill small orders with no question. In my work as a design engineer in industry, I've often used them when I needed to quickly get parts for a prototype.

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
0
Followers
1
Author:Dain Unicorn