I2C cable length


I have an application wherein I may need to position a pressure sensor (AMS5812 via ControlEverything) a fair distance from a Photon/Electron. I did a weee (emphasize “eee”) bit of research into I2C cable lengths and ended up trying a 70’ piece of Cat 5e cable and it worked just fine with the default speed (100KHz). I didn’t have enough spare cable to experiment with longer lengths and simply wanted to pass my experience along as it changed my perspective on how I2C devices can be employed in solutions.

1 Like

Shielding and routing of said cable will also have a massive effect on what you can get away with. Running it next to some mains voltage cables for instance would be bad.

1 Like

I’ve been considering exactly what you tested.

Could you share how you used the twisted pairs?
I assume 5V and Ground on (1) twisted pair?

Thanks in advance,

Hey @ctmorrison

Long time no talk. Thanks for sharing that. We have not done just a whole lot of long cable testing. We generally say we don’t recommend it but it’s possible to get some pretty long cable lengths if you turn your clock speed down. Just like with RS 232 if you set the baud rate really low. The longer the cable the more the square waves deteriorate until they are ugly curves and no good for solid communication.

Honestly the maximum cable length seems to be different from IC to IC. Some ICs we have here won’t work with a 2’ cable even with the clock speed set way down to 20kHz. You have to shorten the cable down to something like 6" to get it to work.

I2C was designed as a communication protocol between chips on a PCB. It was never really intended to be used over long cables. That said we are working on some booster products which essentially raise the voltage of the communication lines for long cable applications. Boosters available here:

I will try to get some better info on what type of cable lengths are possible with the booster.

1 Like

Hi @Rftop, I wish I could say I did something very structured and logical as far as testing, but that’s not the case. I merely had seen a comment (somewhere???) about using Cat 5e cable to extend an I2C connection and cut a ~70’ piece of cable and using only the solid color wires, connected the four required cables: 5V, Gnd, SDA and SCL with no particular plan in mind other than matching colors where I could. The cable has been stretched somewhat and also jumbled into a pile and there was no apparent impact based upon a 1 second loop reading values and printing to the console.

My post was not intended to recommend to folks they should expect this to work, as I was very surprised it did. I merely wanted to pass along an anecdote that may prove helpful for someone else.

@IOTrav, we actually “spoke” this week via my work w/r/t a board that needed an I2C connector repaired! I have multiple personas! :wink: I’ll check out your extenders. I was not aware they even existed.

1 Like

Yeah. I put two and two together with your personas I was just being facetious :joy:

NXP has a couple of application notes on long I2C cables. There is some valuable information there. Especially, play close attention to which wires should be twisted together, or not.

Very large I2C-bus systems and long buses:

Features and applications of the P82B715 I2C-bus extender:

I just wanted to say thanks again for this post.

I finally tried this today. I have an I2C pressure transducer and a 5V analog pressure transducer running on a Cat5 cable.
The I2C layout was:
5V & SDA on 1 pair
Ground & SLC on 1 pair

I used one spare pair for 5V and Ground to a 5V Analog Transducer.
The last pair was the signal for the Analog, which I used both conductors - since my signal Voltage is pretty low at 1.4 - 1.6V for this transducer ( I use a higher pressure range to stay below 3.3V for Electron Analog pin )

Thanks again Guys !

@Rftop, do you have any particular words of wisdom that were key to getting this to work? I have not actually tried it, but have been reading up.

Once the weather is a bit warmer, I have several runs of wire of 40 to 60 feet each which I want to run I2C on. Any tips and tricks would be appreciated.

@cyclin_al, I am far from being qualified to be giving advice on this subject - but I’m happy to share my experience.
The only reason I finally tried it was because Tom (@ctmorrison) posted his experience.

As Travis has mentioned here and per the posts on the CE Forum, a lot depends on the IC you are communicating with.

I am actually using the same AMS5812 that Tom discussed in this thread’s original post.

I cut a I2C cable in half, and wired each end to a length of Cat5 cable as Follows:

  • I2C : Cat5:
  • Orange : Orange
  • Red : OrangeStripe
  • Brown : Brown
  • Yellow : BrownStripe

That was my best interpretation of the docs you linked to.

I’ve had my eye on the Bus Extender @IOTrav linked ever since CE released it, but I usually don’t have power access in the “remote” location. However, I’m not sure that both ends need to be powered. If so, it may be possible to send 12V on an empty pair to the receiver…Hopefully Travis can explain.

1 Like

@Rftop, thanks for the mention that is depends on the IC. I guess experimentation is in order.

My intention is to do something very similar, including routing power over the Cat5 also. I think it should be possible. Again, more experimentation to be done…