Diodes + LEDs
Polarity, Forward Voltage, Current Limiting, and Clamp Paths
You plug a red LED into the breadboard. One leg is longer, one side of the plastic body is flattened, and the part seems harmless enough that it invites a mistake: connect it straight across a supply and see what happens.
For a few milliseconds it may look like success. Then the color changes, the light fades, or the chip inside opens forever. The LED was not asking for voltage. It was asking for a controlled current path.
A diode is a directional part. It lets current move easily one way and resists it the other way. That one idea shows up in more places than a beginner expects: indicator LEDs, reverse-polarity protection, rectifiers, signal clamps, ESD protectors and the flyback diode across a relay coil.
By the end, you can
- Read diode and LED polarity from the package and symbol
- Explain forward bias, reverse bias and forward voltage in physical terms
- Size an LED current-limiting resistor with $R = (V_{supply} - V_F) / I$
- Predict why LED current changes sharply with small voltage or temperature changes
- Recognize rectifier, clamp, Zener and flyback diode jobs
- Choose when a diode belongs across an inductive load
The one-way part
A plain silicon diode has two terminals: anode and cathode. Conventional current flows from anode to cathode when the diode is forward biased. Reverse the voltage and the diode blocks, at least until its reverse rating is exceeded.
That behavior is not a mechanical check valve. Inside the semiconductor, a PN junction creates a depletion region: a small zone short of mobile charge carriers. Forward bias shrinks that region and lets carriers cross. Reverse bias widens it and blocks ordinary current. Once you understand that the junction is a threshold-like barrier, the practical rules start to make sense.
The symbol points in the direction of easy conventional current. The vertical bar is the cathode. On many through-hole diodes the cathode is also marked by a painted band. On many through-hole LEDs the cathode is the shorter leg and the package often has a flat edge on that side. Surface-mount parts use dots, chamfers, bars or package-specific marks, so the datasheet wins when the package is unfamiliar.
Forward voltage is a price, not a supply setting
A forward-biased diode does not behave like a resistor. If you increase the voltage across it slightly, the current can change a lot. For a small silicon signal diode, a useful mental landmark is about 0.6 V to 0.8 V at ordinary currents. For LEDs the forward voltage depends strongly on color and chemistry: red is often around 1.8 V to 2.2 V, blue and white often around 2.8 V to 3.4 V.
Those numbers are not commands. They are operating points on a curve.
Read a datasheet forward voltage table carefully. It usually says something like:
V_F = 2.0 V typical at I_F = 20 mA. The current condition is part of the statement.
At a different current, the forward voltage is different. At a different temperature,
it is different again.
LEDs need current limiting
An LED turns carrier recombination into photons. The color comes from the semiconductor bandgap, so color and forward voltage are connected. That physics is why a red LED and a blue LED do not drop the same voltage at the same current.
The simple indicator circuit is a supply, a resistor and the LED in series. Choose a target current first. For a status LED in modern electronics, 2 mA to 8 mA is often enough indoors. The old 20 mA rule came from dimmer LEDs and wastes battery on many new parts.
The resistor value is:
For a 3.3 V rail, a red LED with a 2.1 V forward voltage and a 6 mA target:
Pick a nearby standard value such as 220 ohms. The actual current is then:
Try these moves:
- Keep the supply at 3.3 V and move the LED forward voltage from red-like to blue-like.
- Ask for 20 mA, then notice how much smaller the resistor becomes.
- Raise the supply to 12 V. The same LED now needs a resistor that burns much more power.
A 3.3 V rail drives a red LED with about 2.0 V forward voltage. You want roughly 10 mA. Which resistor is closest?
-
Correct. (3.3 - 2.0) / 0.010 = 130 ohms.
-
That would allow about 100 mA, far too much for a normal indicator LED.
-
That gives about 1 mA, which may glow faintly but misses the stated target.
-
The LED's forward drop does not control current safely by itself.
Diodes route energy
LED indicators are the friendly first use. The deeper use is routing energy where you want it to go. A bridge rectifier steers AC so the load sees one polarity. A Zener diode or TVS diode clamps a node when it rises above a chosen voltage. A flyback diode gives an inductor a safe path when a switch opens.
Rectifiers are about polarity. Clamps are about voltage limits. Flyback diodes are about current continuity.
An inductor stores energy in a magnetic field. A relay coil, solenoid and motor winding are inductors. When current is flowing through an inductor, it cannot stop instantly. If you open the switch, the inductor will raise the voltage as high as needed to keep the current moving. That can punch through a transistor, reset a microcontroller or arc a switch contact.
Diode families
Different diode jobs use different constructions:
- Small-signal diodes switch and clamp modest currents.
- Rectifier diodes carry more current and survive higher reverse voltage.
- Schottky diodes have lower forward voltage and fast switching, but higher leakage.
- LEDs emit light and need current control.
- Zener and TVS diodes are designed for controlled reverse breakdown.
- Photodiodes turn light into current and usually operate reverse-biased.
Why does a relay coil driver often place a diode across the coil?
-
Correct. The diode routes the inductive current after the switch opens and clamps the voltage spike.
-
The coil still draws current while energized. The diode is normally reverse-biased then.
-
The switch transistor or MOSFET carries the coil current, not the GPIO pin.
-
That describes rectification, not a flyback clamp across a coil.
Why LED brightness is better controlled by current than voltage
Light output is roughly tied to forward current over the useful range. Voltage is a poor control knob because the diode curve is steep and temperature-sensitive. A small voltage error can create a large current error. That is why simple indicators use a resistor, serious LED lighting uses a current regulator, and PWM dimming usually changes the time-averaged current rather than trying to dial the LED voltage directly.
A 5 V board needs a red status LED. The LED forward voltage is about 2.0 V at your chosen brightness, and you want 5 mA. Choose a resistor and estimate its power.
Show worked solution
. A nearby 620 ohm resistor gives about mA. Resistor power is W, so a common 0.125 W or 0.25 W resistor is comfortable.
You switch a small 12 V solenoid with a MOSFET. It works once, then the MOSFET dies when the firmware turns the solenoid off. What did the schematic probably miss?
Show worked solution
The solenoid is an inductor. When the MOSFET opens, the coil current needs a path. Add a flyback clamp across the solenoid, oriented so it is reverse-biased while the solenoid is powered and forward-biased when the switch opens. For fast release, consider a higher voltage clamp instead of only a plain diode.
Key takeaways
- A diode is directional: anode-to-cathode current is easy only when the junction is forward biased.
- Forward voltage is an operating point on a curve, not a safe voltage source setting.
- LED brightness is controlled by current. A resistor or current driver sets that current.
- Rectifiers steer polarity; Zeners and TVS diodes clamp voltage; flyback diodes route inductive current.
- A protection diode can change timing, especially relay and solenoid release time.
Diodes teach the first serious electronics habit: do not only ask what the part does when the circuit is calm. Ask where the energy goes during the transient. The LED's extra energy becomes heat in a resistor. The relay coil's stored energy needs a clamp. The next lesson gives that current path a controllable switch.