Electronic – Purpose for Shunt Resistor on Opto Isolator Input

beaglebone blackdiodesledopto-isolator

I was looking at a BeagleBone Black Cape and became curious on an input circuit to the BeagleBone GPIO (used for a NPN proximity sensor). Upon further reverse designing, I notice a // 220Ω shunt resistor (R1) with the LED. I have a basic understanding on diodes/LEDs (current limiting series Rs for LEDs) but I cannot understand the purpose for R1. So I cal'd the currents thru R1, R2 and the LED but after looking at the datasheet (PS2802) at the "forward current vs. forward voltage I am not sure if my cal'd currents are correct.

In short, the series current limiting R2 (1.2kΩ) I understand it's main purpose and how to calculate it's value but the shunt R1 (220Ω) purpose is confusing me.

My original question was just going to ask. What is the purpose for R1?

But now, my secondary question is (in general). Are my current values correct?

I hope I can become enlightened;-)

schematic

simulate this circuit – Schematic created using CircuitLab

Best Answer

The currents that you show appear to agree with a quick circuit simulation I did with LTSpice. Do note that the 1.2K and 200 ohm resistors are not acting like a normal voltage divider. Instead the input diode in the opto-coupler is tending to clamp the voltage drop across the 200 ohm resistor to about 1.1V. The current from the upper resistor gets split into one current going through the 220 resistor and the other going through the opto coupler input diode. The current split ratio will depend upon the forward voltage drop of the input diode in the opto coupler.

If you remove the opto coupler from the circuit then the two resistor voltage divider will not be clamped and the divider node will be at over 3.7V at a current of about 16.9mA in the divider.

The inclusion of the C1 capacitor in the circuit acts like a low pass filter to the input signal. The time constant is primarily due to the 1.2K resistor. The 220 ohm resistor helps to discharge the filter capacitor when the input signal goes low or open.