Electronics
Concepts: Voltage, current, resistance.
Ohm’s Law
$ V = I \cdot R $
where:
- V is the voltage (in volts),
- I is the current (in amperes),
- R is the resistance (in ohms).
$$ R = \frac{V_{\text{source}} - V_f}{I_f} = \frac{5 \, \text{V} - 2.0 \, \text{V}}{0.020 \, \text{A}} = \frac{3.0 \, \text{V}}{0.020 \, \text{A}} = 150 \, \Omega $$
For a 5 Volt Supply, just choose a resistor greater than 150 Ohms. the larger the R, the dimmer the LED will be.