output pin 13--->330ohm(5v/15mA=333ohm)--->opto anode......opto cathode--->arduino gnd....
You're not getting as much current as you think. You have to account for the forward voltage drop of the opto LED (~1.3V). So you're getting (5V-1.3V)/330 = 11mA, probably a bit less as the Arduino will not put out exactly 5V at 11mA.
9volt + --->470ohm--->opto collector......opto emitter--->red led anode--->red led cathode--->9volt -....
It's the right idea but optocoupler transistors are not really meant for "high" currents. There *should* be enough current to light an LED, but I'd suggest another transistor output stage to make the optocoupler transistor work as little as possible (i.e., carry very small current).
I think you may be limited by the CTR (current transfer ratio) of the 4N25. It's a minimum of 20%, 50% typical. In the worst case (20%) you can only carry 20% of the LED current on the output side. Assuming you're truly getting 11mA flowing through the LED (remember...it's probably less) you're going to only get 20% * 11mA = 2mA allowed to flow on the output side.
--
The
Gadget Shield: accelerometer, RGB LED, IR transmit/receive, speaker, microphone, light sensor, potentiometer, pushbuttons