enter image description here

I would like to know what is the purpose of the resistor "Rin". I though it was for having better immunity against differential mode noise. Nevertheless, I saw circuit with a very high resitor, ie 10KOhm, so by applying a voltage source noise at the input, almost all the curent goes through the LED and so there is no immunity, as the output photo transitor will conduct, which we don't want to happen in case of noise. How to select Rin ?

Here is an example :

enter image description here

Thank you :)

  • 5
    \$\begingroup\$ It's probably for additional noise immunity when the driving source is 'off' (assuming it's a current loop.) Do you have details on the driving side, and how it connects? \$\endgroup\$ Commented Apr 9, 2020 at 15:57
  • 1
    \$\begingroup\$ Where did you locate that circuit snippet? \$\endgroup\$
    – Andy aka
    Commented Apr 9, 2020 at 17:24
  • 1
    \$\begingroup\$ Look at the discussion in this post: electronics.stackexchange.com/questions/473607/… \$\endgroup\$
    – SteveSh
    Commented Apr 9, 2020 at 17:31
  • \$\begingroup\$ Thank you for your comments. I edited the post \$\endgroup\$
    – Jess
    Commented Apr 9, 2020 at 18:35

2 Answers 2


If you use a Logic Level driver and compute the series current limit Rs, then

you do NOT need a parallel shunt R.

For long cables near magnetics , you can add an RF cap.

But if you have an open collector then you can see the shunt R lowers the input impedance to stray noise. But there is no need to do that. Just drive it from Logic with a series R and assume the logic is 50 ohms for 5V uC logic.


simulate this circuit – Schematic created using CircuitLab

I assume you know how to estimate driver impedance Vol/Iol=Zol 50 Ω typ +/-50%

Due to Early leakage effects in any transistor, a base shunt R is preferred, instead of your diode shunt resistor.

You must examine the source impedance and current then CTR of the whole device with common-mode RFI interference.

A diode R-shunt of 10K won't do much at all for attenuating leakage when the diode impedance at the same level is around 100 uA when the drive current is > 20x this level.

It will however reduce the turn off time to allow slightly higher data rates.
To compute R for this scenario, you need to know the Bandwidth required, and RC breakpoint required to boost the turn-off decay time RC~0.6/bit-rate then opto-diode average input capacitance must be estimated to decide on R. It might be << 1k.

Your Model may vary

You must know the spectral impedance and energy of interference and it is inductive-current or capacitive-voltage coupled. This means you might need a shunt cap instead of a shunt R. The impedance ratio is important. In my case C coupling to shunt determines the attenuation ratio. The resistive coupling to a trace or cable has negligible conductance.

  • \$\begingroup\$ Agree about the need for the base to emitter resistor on the output transistor. That was in the schematic snippet I provided. \$\endgroup\$
    – SteveSh
    Commented Apr 9, 2020 at 20:46
  • \$\begingroup\$ And where we use the shunt resistor, it's usually when opto speed is not a concern, such as turning on a power supply. \$\endgroup\$
    – SteveSh
    Commented Apr 9, 2020 at 20:47
  • \$\begingroup\$ @SteveSh The diode Rsh would only be useful for an open collector driver where the source impedance is high when off. There's usually no need for a MOSFET. \$\endgroup\$ Commented Apr 9, 2020 at 20:49
  • \$\begingroup\$ Agree about not needing the MOSFET. We don't use one. In our application, it's possible the source driving the opto might not be powered. \$\endgroup\$
    – SteveSh
    Commented Apr 9, 2020 at 20:56
  • \$\begingroup\$ I m going to find some documentations because unfortunately I do not understand all what you said. Just to be more precise, the optocoupler is not use for transmitting data. \$\endgroup\$
    – Jess
    Commented Apr 10, 2020 at 6:54

The purpose can be seen in the question: Resistor parallel to optocoupler LED in Zener-stabilized circuit

As to the value, it's really not that critical. If it's too low, it can divert enough current from the opto so that it does not turn on (hard). If it's too high, then it defeats the purpose for it being there - the noise or charge buildup you're trying to guard against.

The schematic snippet in that question is from a real-life design. The value of that resistor is 4.99 kohms.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.