Calculation of LED resistor
Value
We must put a resistor in
series to obstruct the current to avoid burn out.
According to Ohms Law V=IR
or R=V/I, In our case
V=VSupply
- VLED
Therefore the resistor value, R is
given by:
R = (VSupply - VLED)
/ I
VSupply = supply voltage
VLED = LED voltage
I = current of LED