# Will optocoupler work if I use 4.7 k resistance to limit the current to the input of optocoupler from logic supply 3V

I am giving 3.3 V input to the optocoupler from my MCU and using 4.7 kΩ resistance in series to the input of the optocoupler will it work?

• R1 = 4.7 kΩ
• R2 = 4.7 kΩ
• Optocoupler: PC817
• Vcc = 5 V
• CTR: MIN. 50% at If = 5 mA
• Vce = 5 V

• What optocoupler? Depends on the CTR, among other things. Also, what voltage is VCC? Dec 25, 2020 at 20:27
• @Unimportant optocoupler: PC817, Vcc =5V, CTR: MIN. 50% at If=5mA, Vce=5v Dec 25, 2020 at 20:40

Driving the optocoupler's LED with 3.3V and 4.7K for R1 will result in a very low current trough the LED. If we take the PC817 datasheet one can see in "Fig.6 Forward Current vs. Forward Voltage" that for very low currents, around 1mA, the LED's Vf is roughly 1V.

So: $$If = \frac{3.3V - 1V}{4.7K} \approx 0,5mA$$

Looking at figure "Fig.7 Current Transfer Ratio vs.Forward Current" we can see that forward currents below 1mA are marked with a dashed line, presumably to indicate such currents are too low for the device to work reliably.

From the same graph we can see the best current transfer ratio is around 10mA. Looking back at figure 5 we see that for a forward current of 10mA the forward voltage is roughly 1.25V. So we calculate R1: $$R1 = \frac{3.3V - 1.25V}{10mA} = 205 \Omega$$

Nearest E12 value is 220 ohm. Of course, do make sure the microcontroller can actually safely source 10mA.

With VCC = 5V and R2 = 4K7 the optocoupler needs to sink $$\frac{5V}{4K7} = \approx 1mA$$ in order to pull Vout down to ground.

Given the forward current of around 10mA and the typical current transfer ratio at that level this should reliably work with ample margin.

• Thanks it’s working!! Dec 25, 2020 at 22:32