# Opto-coupler circuit - selection of resitor [duplicate]

I have a circuit like below.

I wanted to know how these resistance values were calculated. I wanted to use 12V/24V in place of 9V.

Let me know selection of opto-coupler and resistance value.

• Do also check possible duplicate: Resistor value for Opto-coupler input Commented Jun 20, 2019 at 6:18
• @CL. What's the additional value of repeating my comment? Commented Jun 20, 2019 at 6:27
• @CL Ah, thanks for clarification Commented Jun 20, 2019 at 6:33

1. Calculate the value of resistor R1 (for LED) --> U = I x R --> R = U / I We know the following things:
• Uin = 12 V
• Uled (opto) = 1,2 V (take a look into your datasheet)
• ILed (opto) = 4 mA (take a look into your datasheet)

So, the total voltage = 12 - 1,2 = 11,8. R = U / I --> R = (11,8 / 4x10^-3) = 2950 Ω = 3 kΩ

1. Calculate the value of resistor R2 --> U = I x R --> R = U / I we know the following things:
• 0.3 V – Saturation voltage of photo transistor (voltage across photo transistor when current flows through it)
• Ic= Collector current (Current flowing through photo transistor when light falls on it) see datasheet. Let take 1 mA in this case.

So, the total voltage = 5 - 0,3 = 4,7 V . R = (4,7 / 1 x 10^-3) = 4700 Ω = 4,7 kΩ