Hi,
In addition to the previous posts here are some design formulas that make
the resistor selections take about 1 minute or less...
We will use two simple formulas to get the two resistor values:
R1=3750/(380*iLED-1)
R2=(4/5*Vsignal-1)*R1
Note we must calculate R1 first, and that the formula for R1 is valid for
LED currents from 3ma up to 25ma.
First, we know what current we want in each LED, and we'll call this iLED.
Resistor R1 is then dependent SOLELY on this LED current:
R1=3750/(380*iLED-1)
Next, now we know what R1 is so we can easily calculate R2 knowing what
our max signal voltage (Vsignal) is:
R2=(4/5*Vsignal-1)*R1
Now we know both R1 and R2 so we are done, unless we want to check our
results:
Vref=1.25*(1+R2/R1), (should equal Vsignal)
I=12.5/R1, (approximate just for checking)
Design Example 1:
Lets say we want iLED (LED current) to equal 10ma, this means:
iLED=0.010
Lets say we also want our max input voltage to be 5v, this means:
Vsignal=5
Plugging iLED into the formula:
R1=3750/(380*0.010-1)
so
R1=1339.29 ohms
Next, plug that R1 and Vsignal into the other formula:
R2=(4/5*Vsignal-1)*R1
R2=(4/5*5.00-1)*1339.29
and we get:
R2=4018 ohms
We might check our answers next just to make sure we did everything right:
Vref=1.25*(1+R2/R1)
I=12.5/R1
and we get Vref=5v and I=9.33ma, and that is close so we are ok here.
Design Example 2:
We have LED current of 10ma again, but this time Vsignal=3v.
After doing the calculations, we get:
R1=1339.29 ohms
R2=1875 ohms
Note R1 is the same as last time because the LED current was the same.
R2 changed because the max input signal voltage changed.