Here's a simple LED circuit with a battery and resistor:
They come in multiple colors, from red to blue to green to white. Some LEDs are even IR or UV, so if you want something visible to the human eye make sure you're getting the color you want.
LEDs come in multiple colors, from red to blue to green to white. Some LEDs are even IR or UV, so if you want something visible to the human eye make sure you're getting the color you want.
Many LEDs are measured in nanometers (nm), which is the wavelength of the light. You can look up the nm of the LED to see what color it is.
LEDs are unlike many components because they have such low resistance1.
To prevent our power from damaging the LED we need a resistor to limit the current through the LED. The value of the resistor depends on the LED and the power supply. For a 5V power supply and a typical LED, a 220Ω resistor is a good choice. You can calculate it yourself using the formula below, or just use an online calculator.
How to calculate the resistor value
You can use the following formula to calculate the resistor value:
R = (V - Vf) / I
Where: R = resistance in ohms V = voltage of the power supply (usually 1.5, 3, or 5V) Vf = forward voltage of the LED (usually 2V) I = current through the LED (usually 20mA)
LEDs can be quite bright, and sometimes you'll want to diffuse the light. You can do this with a shinethrough LED, which points towards the board. The board's middle layer is semi-transparent, so the light shines through.
Read more here & get part recommendations
Footnotes
-
some LEDs like the neopixel smart-LEDs have a built-in resistor, but unless you specifically see that assume you need your own. ↩