Resistor value for Opto-coupler input
You should pick the forward current \$I_F\$ to match with the required collector current \$I_C\$ as follows:

$$I_F = I_C / CTR_{minimum} $$

where CTR stands for the current transfer ratio.  

The real CTR may be bigger, yielding a higher (theoretic) value of \$I_C\$.
Using the minimum value guarantees it can deliver the requested \$I_C\$



The EL817 has a minimum CTR of 50% (under the conditions of \$I_F\$ = 5 mA ,\$V_{CE}\$ = 5V ). If you need a collector current \$I_C\$ of 5 mA, you need at least a forward current I_F of 5 mA / 50% = 10 mA.

Checking this in Figure 2 of the datasheet reveals at 10 mA, the CTR is even bigger, so you're save for sure.

Next, from Figure 1 you pick the forward voltage at \$I_F\$ = 10 mA, which is about 1.2V.
The resistor you need is (3.3V-1.2V)/10mA = 210 \$ \Omega\$.



If you hardly need any collector current, you could decide working the other way around.  

Let's say you pick \$I_F\$ = 1 mA. From Figure 2 you can see the CTR is 0.5 of the normalised CTR. The normalised CTR is 1 at 5 mA. The minimum CTR was 50% at 5 mA, so, at 1 mA the minimum CTR becomes 0.5 * 50% = 25%.

Using
$$I_C = I_F * CTR_{minimum} $$ 
you'll find with \$I_F\$ = 1 mA, you can draw \$I_C\$ = 0.25 mA for sure. If your circuit requires \$I_C\$ &lt; 0.25 mA, then \$I_F\$ = 1 mA will satisfy.

Again, from Figure 1 you pick the forward voltage at \$I_F\$ = 1 mA and calculate the required resistor.

Note that these calculations apply at 25&deg;C. At other temperatures, you should take Figure 3 also into account.