a light-emitting diode (LED)
A light-emitting diode is a diode that glows when current flows through it the forward way. It is the little indicator on every gadget, the pixel in a giant display, and increasingly the bulb in your ceiling. Like any diode it is a one-way device — current in the right direction, light out; wrong direction, nothing (and possibly damage).
The light comes from the junction itself: when forward current pushes electrons and holes together at the junction, each recombination releases its energy as a photon. The colour depends on the semiconductor's energy gap, not the current — which is also why an LED's forward voltage is higher than a silicon diode's and varies by colour: roughly 1.8 to 2.2 V for red, 3.0 to 3.4 V for blue and white. Below that voltage it stays dark; above it, brightness tracks the current.
The one rule you must never forget: an LED is current-driven, and its steep I-V curve means a tiny voltage change causes a huge current change. Connect it straight across a battery and it will draw runaway current and burn out. You always feed it through a current-limiting resistor (or a constant-current driver) that sets a safe current — a few mA for an indicator, more for lighting.
A red LED (Vf ~ 2 V) from a 5 V supply: the resistor must drop 5 - 2 = 3 V. For ~10 mA, R = 3 V / 0.01 A = 300 ohm. Use the nearest standard value, 330 ohm, giving ~9 mA.
An LED always needs a series resistor to set its current.
Never connect an LED directly across a voltage source. Its forward voltage is nearly fixed, so the source decides the current — and without a resistor that current is whatever destroys the LED. Also mind polarity: reverse voltage beyond a few volts can kill an LED outright.