5
\$\begingroup\$

I know twisted pairs are important for differential signals, which I2C is not. I also know I2C is not intended to be used over long wires. However, I made a design where I need to use a cable to connect two devices over I2C. The expected length is 0.2m to 0.5m. I am shopping for wires now and there is a nice 4-wire cable that fits the specs and a very similar cable with wires twisted in 2 pairs. I wonder, does I2C communication benefit from a twisted pair? Or might it hurt it perhaps? Or should I just choose the cable of the better color?

\$\endgroup\$
5
  • 1
    \$\begingroup\$ "I need to use a cable to connect two devices over I2C". I would suggest not to do it. Can't you use some other bus like CAN or old fashioned RS232 ? \$\endgroup\$ – Mathieu G. Mar 8 '20 at 13:48
  • 5
    \$\begingroup\$ For 0.5m and low speed I2C you are probably OK. If you have 4 cores, in pairs, make them SCL/GND, and SDA/VCC, where VCC is well decoupled at both ends, forming an AC GND. \$\endgroup\$ – user_1818839 Mar 8 '20 at 13:56
  • 2
    \$\begingroup\$ @MathieuG. HDMI and DVI interfaces have I2C running through the cable and it works for 10+ meters so it will work over 0.5 meters if done properly. Like exactly the way BrianDrummond suggested. \$\endgroup\$ – Justme Mar 8 '20 at 16:42
  • \$\begingroup\$ @Justme interesting ! I will look at it. You say it works but would you recommend to do it ? \$\endgroup\$ – Mathieu G. Mar 8 '20 at 18:31
  • \$\begingroup\$ @MathieuG. It would depend a lot of factors not revealed here. But just connecting two boxes directly with I2C and power for max 50cm it seems easiest solution, than to use separate microcontroller on both boxes for protocol conversion and use tranceivers for RS232, RS485, or CAN, between them. Not many MCUs even have CAN peripheral, but nothing prevents using a CAN PHY for simple UART though - it's just overkill. \$\endgroup\$ – Justme Mar 8 '20 at 20:51
0
\$\begingroup\$

If you follow a proper EMI concept, then nothing speaks against connecting two devices over I2C.

Yes, you should use a twisted pair cable, as this is the weapon of choice against inductive coupling. If you use a shielded cable, you can suppress capacitive coupling, too (You must connect both ends of the shield, but beware of ground loops).

You can do even better if you isolate the I2C transceiver at one end.

\$\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.