Diodes and LEDS

Forward Bias: Current (hole flow) flows through the diode.

LEDs: Calculating resistor value:

Example circuit:

Calculation:

R = (Vsupply - Vled) / Iled, R = (5V - 2V) / 0.02A, and R = 150 ohms. 

                   Diode protecting a motor from flyback

                               Diode protecting a relay