2
\$\begingroup\$

I need to send some I2C data through RJ45 cable between Arduinos. One ATMEGA2560 as master and 1-4 328P's as slaves. I've seen some different configurations and I think for my application the solution hinted in this answer using P82B715 will be enough for what I need, as 5 m cable for each connection will be enough.

However I was reading about differential signal pairs which could be implemented for this application using P82B96 and some differential line drivers/receivers, like Pololu guys have done on their "I2C Long-Distance Differential Extender". This could theoretically be the best way of getting really long I2C lines, as I understand.

Now comes the question. If I wanted to send those differential signals would it be better to use separate IC's for each port or can they be just connected all together like this? I2C differential signals

As I've read I'd need to have shielded cables for carrying GND this way and there are some pull-ups missing, but you can get the idea.

My reasoning is that by being all connected the noise introduced by the cables would still be able to be canceled-out using the differential method but I'm no EE so I can't be sure about this.

\$\endgroup\$
5
  • \$\begingroup\$ Give a little more information about the "5m" distance. Meters I assume? Is each slave on a separate 5m long cable. Or, are they all strung along the same 5m cable? Do the master and slaves share the same power supply? The same ground or DC common? What is the minimum speed/frequency you need to run the I2C link at? (I.e. the frequency of SCLK.) \$\endgroup\$
    – FiddyOhm
    Jul 26, 2016 at 16:33
  • 1
    \$\begingroup\$ The answer is in the datasheet of the differential line driver. \$\endgroup\$ Jul 26, 2016 at 16:34
  • 2
    \$\begingroup\$ How do you cope with the bidirectionality of IIC? \$\endgroup\$
    – Andy aka
    Jul 26, 2016 at 17:17
  • \$\begingroup\$ I think, you messed everything. \$\endgroup\$ Jul 26, 2016 at 17:54
  • \$\begingroup\$ Each slave will be connected to the master with a 5 meter RJ45 cable. Each unit will have its own power supply but I think I'd need to share grounds. This would be done using a shielded cable as there are no more free pins to use. Arduino normally uses 100kHz speed although I could certainly use a much lower frequency. \$\endgroup\$
    – eNDeR
    Jul 27, 2016 at 1:37

1 Answer 1

0
\$\begingroup\$

I would say that at 5 meters you stand a good chance of using a straight I2C hook-up and getting reliable performance IF:

A. You are very careful with your grounding between master and slaves. (E.g. Make sure there are no ground loops and that your shielding doesn't contact any non-system metal in their routing. (See E below)

B. You minimize the pull-up resistor on SDA - 1K or less.

C. You minimize the clock frequency to as low as you can make it without impeding the data flow that you actually need between the master and the five slaves. I2C is a synchronous protocol, so there is no low frequency limit for the clock. The limiting factor will likely be the I2C controller or firmware in the Arduino processors.

D. Buffer the SCLK line to each slave with something like a 74HCT125.

E. Use low capacitance cable. E.g. Unshielded Cat-5, using the extra wires as your ground connections.

You can prove this out on the bench before you deploy it into your final system.

Performance will depend to a large degree on the electrical noise environment in which your system needs to operate.

It's a bit of a gamble, but it may save you the cost and complications of using the differential drivers and receivers. I have run I2C this way over approximately 5 feet of twisted pairs in a past project. One pair for SCLK, the other for SDA with the other wire in the twisted pair connected to DC Common. In that case the master and slaves shared the same power supply. The clock frequency was around 10 or 20 KHz.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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