# How to calculate line capacitance for I2C (100kHz) communication

I want to communicate between ATmega328P chips over I2C. I have found this bus extender which allows a max capacitance of 3000pF.

I found this data-wire, which has a mutual line capacitance of 25pf/ft @ 1kHz.

But I2C communication runs at 100kHz (by default). (How) can I calculate the line capacitance of this type of wire at 100kHz? Or in other words what is the maximum length I can span with this type of wire between two extenders?

• how far do you want to go ? Feb 28, 2018 at 7:45
• If you are looking for a mathematical answer, i would suggest this article, although its mainly about Pull-up resistors, there are formulas with which you could calculate Bus capacitance when Pullup resitance and frequency is given. Feb 28, 2018 at 7:54
• I think I need max 20m between units, but total length of can be up to 50m (first to last device in the chain) Feb 28, 2018 at 12:44

Here are a couple of extracts from the P82B715 data sheet: -

Also note that line capacitance is a physical property of the wire and not related to operating frequency until you get into UHF or above: -

• Thank you Andy. I have tried to calculate the pF/feet for a 30AWG silicone rubber cable. The parameters are: (epsilon=3.5, core diameter=0.25mm, total diameter including insulator = 1.3mm). I get a capacitance of around 9pF/ft. Is that correction and do I need to multiple it by 2 to account for both I2C lines? Jan 16, 2022 at 9:47
• Try comparing it with the specification for the cable. It should have a data sheet if it's from a reputable supplier. Jan 16, 2022 at 10:23
• it is not a reputable supplier but I'll think of getting one, thanks :) Jan 16, 2022 at 10:35

I have recently discovered that a full i2c master compensates for the capacitance. It comes at cost of bitrate, which slows down if the rising edges are too long. But other than that it works very nice to me.

https://www.i2c-bus.org/clock-stretching/ look for bandwidth paragraphs

Edit:

I2C anyway isn't meant to work for long distance. It's inter IC, hinting it's for a PCB level communication. For 20m it makes sense to use RS485 or RS422, or other differential lines. And proper filtering is required.

• I don't see how clock stretching would help in this case. Clock stretching is meant to give the slave some means to slow down the master if it can't keep up with processing the incoming data for example.
– Rev
Feb 28, 2018 at 13:04
• Clock stretching holds the internal counter until SCL rises to 1, with no timeout. That means, if the line capacitance is high, it will wait until clock is high as long as it takes. At cost of bandwidth. I have just tested it, works perfectly. O only can't know, is it implemented same way in your master.
– user76844
Feb 28, 2018 at 13:07
• To all people who don't see- check the facts. I don't care for your downvotes, but you prevent others from knowing more than yourself.
– user76844
Feb 28, 2018 at 13:44

The pF/ft due to dielectric constant and gap will not change for I2C.

The 1kHz is just the verified test f.

3000 pF / 25 pF/ft = 120 ft. How far do you need to go?

It might drop a bit at 1GHz. but will never be used for that.

100 kHz has about 3 us max rise time with 0.4Vpp min swing at Vcm

Cable Capacitance limit is due to 3mA High Speed current limit.

3mA?=Ic=CdV/dt= 3000 * e^-12 * ?V/3e-6
Solve for V if interested which must be > 0.4V.