Maker.io main logo

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. 

variety of leds

There are a lot of variations--you'll see surface mount, through-hole, and a wide variety of colors, sizes, and configurations. 

positive and negative

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.

inconsistent anvil

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.

resistor

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.

three LEDs

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.

rgb small package

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”.

制造商零件编号 BL-BJE5V4V-AT
LED ORANGE-RED DIFFUSED T/H
American Bright Optoelectronics Corporation
¥2.44
Details
制造商零件编号 BL-BKC1V4V-AT
LED YELLOW DIFFUSED T/H
American Bright Optoelectronics Corporation
¥2.36
Details
制造商零件编号 BL-BGE1V4V-AT
LED GREEN DIFFUSED T/H
American Bright Optoelectronics Corporation
¥0.39
Details
制造商零件编号 QBL8RGB60D0-2897
LED RGB DIFFUSED T-1 3/4 T/H
QT Brightek (QTB)
¥10.28
Details
制造商零件编号 2541
ADDRESS LED STRIP SERIAL RGB 1M
Adafruit Industries LLC
¥125.95
Details
制造商零件编号 3527
LED RGB DIFFUSED 5MM T/H
Kitronik Ltd.
¥5.81
Details
制造商零件编号 CF14JT220R
RES 220 OHM 5% 1/4W AXIAL
Stackpole Electronics Inc
¥0.81
Details
Add all DigiKey Parts to Cart
TechForum

Have questions or comments? Continue the conversation on TechForum, DigiKey's online community and technical resource.

Visit TechForum