0

Calculate I2C pull-up resistor size
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Calculate I2C pull-up resistor size

by scott216 on Fri Nov 01, 2013 10:40 am

I have a project that uses the 128x32 I2C OLED display, 7-segment I2C LED, DS3231 RTC and and I2C accelerometer breakout board. The accelerometer breakout operates at 3.3 volts and has 10k I2C pullup resistors going to +3.3v. This is all running off an Arduino Pro-mini (5v version). The 3.3 volts comes from the voltage regulator on the OLED backpack.

Everything worked fine when the RTC, OLED and accelerometer were hooked up. Then I wired in the 7-segment display and the OLED stopped working. I suspected it had something to do with the I2C bus and the pullup resistors, so I added two 4.7k pullups to 3.3 volts. This is in addition to the 10k pullups to 3.3v on the accelerometer, so effectively these are in parallel (~7.4k). When I did this, everything worked. So my question is, how do I know what size pullups to use? Is there a rule of thumb based on number of devices on I2C bus?

scott216
 
Posts: 159
Joined: Sun Apr 12, 2009 11:08 am
Location: New Jersey

Re: Calculate I2C pull-up resistor size

by waltr on Fri Nov 01, 2013 11:07 am

What you did is the real world way of determining the pull-up value.
There are very complex circuit simulation tools but in the end you try values.
The rule of thumb is about 2k to 10k for I2C pull-ups and the longer the I2C line (and/or more slave devices) the smaller the resistor value needed. I start with 4.7k pull-ups then adjust as needed.

FYI: a 10k in parallel with a 4.7k is not 7.4k its 3.2k.
Look up the parallel resistor equation and check your calculations.
waltr
 
Posts: 271
Joined: Wed Jun 12, 2013 5:01 pm

Re: Calculate I2C pull-up resistor size

by scott216 on Fri Nov 01, 2013 11:10 am

waltr wrote:What you did is the real world way of determining the pull-up value.
FYI: a 10k in parallel with a 4.7k is not 7.4k its 3.2k.
Look up the parallel resistor equation and check your calculations.


I'm not running at 100% yet today :( Thanks for the correction.

scott216
 
Posts: 159
Joined: Sun Apr 12, 2009 11:08 am
Location: New Jersey

Re: Calculate I2C pull-up resistor size

by frank26080115 on Fri Nov 01, 2013 12:05 pm

I usually find that 400KHz I2C busses will malfunction using 10K resistors at 3.3V, it's safer to start with 4.7K, and move down to 2.7K if you experience any errors.

frank26080115
 
Posts: 120
Joined: Fri Jun 15, 2007 1:04 am

Please be positive and constructive with your questions and comments.