The formula is simple with the Ref. 19mA will operate any opto-coupler I have. In choosing appropriate values for R1, the value for the current limiting resistor is set to produce the correct forward current (I F) through the infrared LED in the optocoupler. It is directly connected to a controller input. In the optocoupler, or photon coupled pair, the coupling is achieved by light being generated on one side of a transparent insulating gap and being detected on the other side of the gap without an electrical connection. Optocouplers contain both a light-emitting diode (LED) and a photo detector. The current transfer ratio (CTR) is the current gain from the LED to the photo detector, and typically has a very wide. I've watched numerous yt videos on how to calculate the correct resistor value. some simply suggest using ohms law [ (12v-1. 05] while other suggest that this isn't enough and you should always choose a larger resistance value from what you have calculated.
[PDF Version]