I2C Pullup Resistors

if you connect two arduinos with i2c you will find x different versions of which resistors to use, ranging from 470 to 4.7k

It looks like the 1.5k for 5V boards is the right solution, but what about 3.3V boards?

this is why i was looking for a forumla to calculate this and i found something behind this link on page 17: http://ics.nxp.com/support/documents/interface/pdf/an10216.pdf

R = (Vddmin - 0.4V) / max current load of Output Transistor

Nice... working on a 3.3V board i take the Vddmin = 3.3. Arduino datasheet says 3.35V to 12V...so i guess I am ok with 3.3..or am I not? what about the max current load? Found everything from 5mA to 20mA on forums...found 40mA for I/O pin in Arduino datasheet....what to do?

Following the datasheets i get R = (3.35 - 0.4)/40 = 0.07375k Ohm

Can someone please tell me the correct way to fill this formula with live? I know the amount of nodes and cable length etc. has influence on the choice as well, but this is something i am not asking for.....

Following the datasheets i get R = (3.35 - 0.4)/40 = 0.07375k Ohm

LOL, that /40 term in ohms law would represent 40 AMPS of current, not 40ma (.040). Anyway the maximum current capacity of an arduino output pin is not the value one would use anyway, rather it represents a theoretical maximum and would waste a lot of energy and most likely most I2C devices would not be able to supply such current when they are driving the line. The optimum I2C pull-up resistance is not a simple formula as it should factor in things like line length, line capacitance, number of devices being attached to the I2C bus, bus speed, etc.

Here is a pretty nice posting on the issue:

http://www.dsscircuits.com/articles/effects-of-varying-i2c-pull-up-resistors.html

Lefty

Another source for I2C information is - Gammon Forum : Electronics : Microprocessors : I2C - Two-Wire Peripheral Interface - for Arduino -

Thank you for the replies.

@ retrolefty: To get the math straight for you: dividing by mA will give me kOhm, divding by A will give me Ohm. So there is no difference my friend as long as i keep my SI units correct.

@ retrolefty: I am aware of the effect of different resistors, i am looking for a good start point to reduce trial and error time. My question for you: which current load is approriate for this initial calcualtion? Or as you seem to be into that very much, which resistor would you choose for the 3.3V boards to start testing?

@ robtillaart: Thanks for that. Very nice and easy explanation showing the influence of resistors on the signal... :-)

@ retrolefty: I am aware of the effect of different resistors, i am looking for a good start point to reduce trial and error time. My question for you: which current load is approriate for this initial calcualtion? Or as you seem to be into that very much, which resistor would you choose for the 3.3V boards to start testing?

The only I2C device I've used up to now is a DS1307 RTC. The board I build has jumper pins so that I can enable the two 4.7K resistors or disconnect them from the bus by removing the jumper clifs. I used 4.7K only because it was the most frequently size suggested at the time, I didn't do a lot of research on it. When I actual completed that project I found that the RTC would work without my external resistors! It seems the arduino library for I2C enables the internal pull-up resistors for those two signal, which I think is a nominal 40K - 50K. So it appears in at least some causes to not be too critical. So unless you modify the library be sure to include the arduino's internal pull-up resistors value that will be in parallel to any external resistors used for calculation purposes.

Lefty

Thanks Lefty.

For 5V system than 4K7 is the preferred value, for 3V3 systems then drop this to 3K3, normally you won't go wrong with these values. However some very low power devices like used in the Wii controller require much lower current and I have seek 33K recommended but I have not tried this.