LED Basics
2022-09-14 | By bekathwia
License: Attribution-NonCommercial-ShareAlike Addressable LEDs Batteries LED Strips LEDs / Discrete / Modules Arduino
Light Emitting Diodes aka LEDs are electronic components that give off light when electrical current flows through them.
There are a lot of variations--you'll see surface mount, through-hole, and a wide variety of colors, sizes, and configurations.
You can make a simple LED circuit with a coin cell battery. Through-hole LEDs have one wire lead longer than the other. That's the positive lead, called the anode, and the shorter lead is negative, called the cathode. It only lights up when connected properly.
Inside the LED, you can see what these leads are connected to. The anode’s terminal is called the post, which attaches to a thin metal wire connecting across to a small piece of semi-conductive material that’s fixed on the cathode’s terminal, called the anvil. The semiconductor material emits light when current passes through it. The color depends on the specific material, which explains why some LEDs are more expensive than others. Any plastic lensing on the outside can help shape and color the light.
So, in addition to the length of the legs, you can guess the polarity of an LED by looking inside the lens at the anvil, which is bigger than the post. The anvil is usually the cathode, but as you can see, not all LEDs observe the same polarity conventions. I think this one is from a batch that was manufactured backward. The only way to be totally certain of its polarity is to test it.
A resistor helps limit the current going through an LED, so it doesn’t burn itself out. What value resistor you need will depend on what kind of LEDs you are using and what power source you have, subject to Ohm’s Law. But there’s some wiggle room and for commonly used types, you get used to remembering what’ll work, for example, a typical 3-volt LED can use a resistor anywhere between 100 and 1000 ohms. You can calculate your resistor needs using the Digi-Key LED Series Resistor Calculator.
Then there are RGB LEDs. Additive color, or light-based color, has three primary colors: red, green, and blue. Simultaneously controlling the brightness of one LED of each of these colors can create almost any color of light. Color-changing LEDs like those in your phone screen work the same way, but the LEDs are all together in a very small package called an RGB LED.
You can get strips of RGB LEDs that all change color together, called ‘analog LED strip’. It’s commonly used in architectural settings and usually requires a 12-volt power supply. You can buy pre-wired controllers for this stuff or use three transistors to control it from your microcontroller.
It’s important to make sure you start with the right kind of LEDs for your project. You’ll typically see 3-5 volt LEDs and 12-volt LEDs. The lower voltage LEDs are better suited for battery-powered projects, where anything 12 volt is easier to power with a wall supply. When shopping for LEDs, make sure to pay attention to the voltage, because they’re not interchangeable.
Next up is addressable pixels. These are RGB LEDs with a small microchip inside that receives and relays commands.
You're going to need a microcontroller to control pixels because they don't do anything without being given specific commands.
Coding for pixels will include numeric values to describe each LED’s brightness. You provide a number from 0-255 to represent the brightness of each LED, and commands to tell which pixels to light up and when.
If that’s all way too much, though, you can also find special LEDs with integrated chips that do things on their own, called “self-flashing,” “color-changing,” or even “candle flicker”.
Have questions or comments? Continue the conversation on TechForum, DigiKey's online community and technical resource.
Visit TechForum