# Does resistor choice for I2C with optical isolation depend on voltage or speed?

I am building two PCBs, one which will house an MCU, WiFi, GPS, and other sensitive stuff. The second one will interface with solar chargers, batteries, and 12VDC loads.

The two boards will connect by I2C running over a short cable (1m or less), and I plan to use optical isolation to protect the more sensitive board, and a P82B96 to buffer.

This application note from NXP is very helpful, but I'm not clear how to properly adapt for my purposes.

My I2C bus is biased at 3.3V, operating at 100 kHz. Thus I require some combination of these two example circuits:

### 5V bias at 100 kHz:

This diagram represents the speed I need, but since I'm changing from 5V to 3.3V, do I need to adjust the resistor values on the optoisolator? Also, is the choice of transistor affected by voltage?

### 3.3V bias at 400 kHz:

It seems the simplest solution would be to go with this example. Does the fact that I'll operate the bus at 100 instead of 400 kHz affect the choice of values for the resistors on the optoisolator?

The datasheet for the opotisolator shown (HCPL-060L) includes this figure:

Which seems to indicate that a higher output resistor ($R_L$) will result in longer propagation delay / lower frequency. Does that mean that a higher value would be a better choice for my application?

In short, which of these two examples is the best starting point, and what values do I need to consider changing?

The second diagram should work, the text says up to 400kHz and not for only 400kHz. Also the only thing that limits the speed is the opto-couplers, which on the datasheet says its maximum data rate is 15 Mbps, which is good for 100kHz.

Also the 390 ohm resistor is only used as pull up resistor, as this is connected to a transistor collector. As for the 180 ohm resistor, it is used to limit the current that's flowing into the diode. The change in resistors in both diagrams is only because an increase in voltage would increase the current, so resistors should be increased to stay at current limit.

Single driver I input = 15 mA average Vf forward input voltage diode drop ~1.5V Thus 3.3V driver input current limit R (3.3-1.5)V / 15mA = 120 Ohms . Actual current will be less due to 25~50 driver internal resistance. But minimum operating current is 5mA which would imply (3.3-1.5)V/5mA = 360 Ohms so their example is somewhat midway with 180 Ohms, which is fine.

Output pullup depends on speed with 330 R to 4k suggested. to output 3 or 5V

I suggest >=2.2K is adequate as shown with their 5V pullup example.

... although I2C pull-ups of higher values are common.

Either chip will do.

• What is the function of the output pullup resistor? Is it only to control the current, or does it also affect speed? – LShaver Feb 23 '17 at 16:51