# Using OptoCoupler with Input side resistor 10k or 2.2k

I Have a PC 817 Optocoupler.. datasheet

I am trying to learn how to use it...

Presently I dont have any 330 ohm resistors.. What i have is 10k and 2.2k resistors only..

can i use anyone of those resistors as limiting resistor to the anode side for the optocoupler or can i connect OUTPUT pin directly to the Anode of the Opto coupler.

or is it better to wait for some more time till i receive the resistors.

Can any one explain me why i have to use resistors with value between 200 - 700 ohm only as a optocoupler input? and if i connected the directly to the Digital Output Pin will it work?

The 200 to 700 ohm resistor limits the current into the LED inside the OptoCoupler
You must not exceed the maximum milliamp rating of 50ma continuously.

Forward Current (ma) is why …
( 5 Volts - 1.4 Volts LED ) / 5ma = 720 Ohms
( 5 Volts - 1.4 Volts LED ) / 10ma = 360 Ohms
( 5 Volts - 1.4 Volts LED ) / 15ma = 240 Ohms
( 5 Volts - 1.4 Volts LED ) / 20ma = 180 Ohms

You could wait for proper resistor
or temporarily you could put the the 10K and 2.2K in parallel = 1.8K

( 5 Volts - 1.4 Volts LED ) / 1.8K = 2ma

At 5 Volt, 1.8K & 2ma Input, at 100% CTR, that should pull the OptoCoupler Ouput LOW
when connected to Arduino Input Pin with 20K Internal Pull-Up Active.

Try it.
Too high of a LED Resistor won’t hurt anything.