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 ads by
Signing UpStep 1: The Pinout
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.







































Visit Our Store »
Go Pro Today »




Resistance of any diode from anode (+) to cathode (-) is essentially zero.
An example: 5 V across a 220 ohm resistor.
current = voltage / resistance -> I = 5 V / 220 ohms = 22.7 mA
So it doesn't matter where the resistor is in the circuit path; the total circuit resistance would be the same so the amount of current running through the LED is the same.
Now with no resistor in the path and just a voltage source connected to the LED.
current = voltage / resistance -> I = 5 V / 0 ohms = infinite amps
of course there's no infinite current, but your voltage source (battery etc.) will put out it's max current... so as he said... no resistor.. LED goes "pop"
Sam
Think of it as a Snake game, where the head is the first electron. The electron leaves the anode of the power source and flows through the LED not yet illuminating it because the circuit is incomplete. The "head" continues into the resistor which drops the current/voltage to a safe level for the entire [series] circuit; then continues to the anode of the power source, completing the circuit and illuminating the LED.
Disclaimer: I'm subscribing to the actual movements of electrons (from negative to positive), not conventional
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?
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.
I originally thought it was a common Cathode model, and started writing that way. When I discovered I was wrong, the instructable was almost finished and I thought I had fixed the inconsistencies. I've linked to you and your project in the 4th step because your right, designing a circuit with resistors to bring the voltage in line would help blend things better, but as you can see I tried to keep things at the simplest level and still demonstrate the LEDs abilities.
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1263501476
Thank you
Knowledge shared is knowledge squared, knowledge hoarded is knowledge doom to be forgotten.
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.
I agree it's not the best resource, but many hobbists seem to start there. My 'day job' has me going there for my projects because as an Over-The-Road Trucker, waiting three plus weeks to get home for an order isn't always ideal.
Thank you for the links, I'll be sure to check them out.