I2C: Buffers, Pull-Up Resistors and Transmission over UTP Queries

Hello, I am designing a system for 2 Arduinos (Uno and Mega) to communicate via I2C over a distance of approximately 20m. I plan on using Cat6 cable for this.

I did some research and found out that I2C has a relatively short range and so buffers are required to extend the range. I plan on using the P82B715PN I2C bus extender. I found the datasheet, which is shown below.

The basic wiring of the buffer is simple ie SDA or SCL to either Sx or Sy and Lx and Ly are the resulting buffered lines. I am a bit confused however about the pull up resistors required. In Section 8 there are a few example diagrams showing the different possible layouts and some of the technical information is over my head at my current level. So could someone simplify it please? On page 7, figure 6, there is a diagram of a buffered I2C circuit showing locations of the pull up resistors and it is referred to as an arrangement that produces the 'best system performance' in previous text. on a regular short distance I2C circuit there would be pull up resistors on the SDA and SCL lines but on this diagram they are only on the buffered and regular SDA lines, why?

Also, there is a method for calculating the required values of the pull-up resistors but I do not understand what the values mean. There are ranges given as guidelines and assumptions to make such as the load and trace capacitance of each device, but what is the trace capacitance? Would the buffer count as a device? There is a range given for cable capacitance but I dont know whether to assume a high or low value would be preferable. For the final value of the pull-ups, would a higher or lower value be preferable for signal quality? And would all the pull ups have to be equal?

For the transmission through the Cat6 cable, I also did research and found out that the buffered SDA and SCL lines could be transmitted over 2 separate pairs each paired with either VCC or ground, but the VCC and ground need to be decoupled using a capacitor (one of the sources I found: http://cladlab.com/electronics/circuit-design/communication-protocols/i2c-protocol#using-twisted-pair-cabling-and-a-buffer-ic). I then tried researching decoupling capacitors but again I didnt fully understand it. From what I could deduce it is basically a capacitor put in between ground and VCC, is this correct? Would pairing both the buffered SDA and SCL with ground be more beneficial?

These are all the queries I could think of. Sorry if I seem like I'm just trying to get answers the easy way, I prefer to understand a problem as best as I can before I attempt solving it.

So if you could help me I would be very grateful.

Unless this is in a noisy (electrically) environment I don't think you'd need CAT6.
I my lighting systems I use pre-configured CAT5 cables with a PCA9600 I2C bus buffer and this works fine for up to 1MHz. I believe the max on the Arduino's is 400KHz so that would work fine on 20m.

The pull-up resistor configuration in Fig. 9 should work fine. Place the 470 Ohm resistors at each end of the bus. Or use a single 270Ohm pull-up resistor as shown in Fig 12.
The 4.7K on the Arduino side is a save value. The I2C pins for normal (100KHz) and fast mode (400KHz) pins only provide 3mA to discharge the cable(system) capacitance. Thus the limit to 400pF max system capacitance. Assuming a voltage of 5V and a pulp resistor of 1.8K result in a current of 28mA. 4.7K result in a current of 10mA according to Ohm law, so there is room to play.

Here is an excellent Article to the effect of varying pull-up resistors:

Everything Arduino <->I2C you'll find explained here:

In general I am not exactly sure why you chose the P82B715PN. You don't use other bus buffers in your system so thats one advantage that this buffer chip has that you cannot take advantage of in your system and it also does not isolate the bus capacitance which could help. I am thinking that a PCA9600 would be a better choice.
I could provide a schematic and a PCB layout that is breadboard ready.

The small board in the image below between the Ethernet Jack in the front and the Teensy 3 micro controller in the back hosts the PCA9600 I2C buffer chip, the Schottky diode and the necessary pull-up resistors. You'd need two of those little boards. One for each Arduino.

Ok, thank you very much for replying that was very informative. I dont know how I missed that diagram in the datasheet, its exactly what I'm looking for.

You suggested using a PCA9600 buffer instead of the P82B715PN I was initially going to use why? What are the benefits? Will it majorly improve anything compared to the initial device I was planning on using?

So I now have a template for the general buffer circuit but I have a few more questions. Do you have any comments about the decoupling capacitors? What are they? What do they do and would I require them for the distances I am transmitting data over? I did some research and found out they are mostly used for higher frequency circuits close to the mega hertz. I will use the i2c bus at the default 100MHz, so would decoupling capacitors make a difference or should I not bother?

Also. The diagram in the datasheet that you referred to me describes a circuit that transmits signals in a UTP cable where the buffered SDA line is paired with VCC and the buffered SCL line is paired with ground but I thought for UTP balanced signals were optimum but if unbalanced signals were to be sent then pairing a data and a ground would be best to reduce interference, but is it? I only started learning this a week ago so forgive me if I sound silly. This pairing, however, could be useful to me as a certain component of the project I am doing involves transmitting 12V at approx 0.8 Amperes over the same 20m distance and I had considered using power over ethernet but I was once again confused by the information I found on it. Is there an optimum way of doing this eg pairing ground and VCC or having them in separate pairs or are they similar in performance? Would I be able to transmit the power I require over 3 pairs of UTP cable (2 pairs which are unused and 1 pair from the buffered SDA and SCL lines), would this work or am I overlooking something?

I suggested the PCA9600 because it is much more flexible and much faster and because I have a functioning board design tested to work on 20ft of CAT5 cable and 8 devices on the I2C bus at 1MHz showing still very crisp signals on a scope.

However, the chip you have selected should work fine for your application and promises to be even simpler in application. For example it does not require the fast switching schottky diodes in my circuitry. The image I referenced is described as the quick design reference in the data sheet for the P82B715. I don't exactly know what your application is but I doubt you'll need the ESD protection diodes shown in the picture so all you are left with for a schematic are two chips and a few pull-up resistors.

I would not worry too much about the pairing. Just follow the schematic shown in Fig 9 in the data sheet and you should be fine. That schematic does not show any decoupling caps either :wink:

Now go and build the thing and see if it works! Don't expect for it to work the first time. That of course does not mean that it won't but it is relatively normal that things have to be tweaked. Should you do run into problems, an oscilloscope is a very helpful tool to verify signal levels and signal Integrity. A logic analyzer is a very helpful tool to debug I2C protocol ( software) issues. For I2C bus purposes neither of these need to be particularly expensive. A good used analog scope for $50 from eBay is well worth the investment and plenty enough to verify I2C signal problems.