I2C pullup resistors

Attached is the actual PCB layout and proposed interconnects.

The ADCs and the I/O expander modules each have their own 10k pullup resistors. Would it be likely that I would have to also enable the 2560’s pullup resistors?

Is there any reason to think that the 2560 could not handle SPI & I2C & MODBUS libraries and a sketch? If not, would the SD card help?

I believe that I have all the pins correct (pin 53 set to output).

I plan to use an Arduino 2560.

Hi, @barryfields

Can you please post a copy of your circuit, a picture of a hand drawn circuit in jpg, png?
Hand drawn and photographed is perfectly acceptable.
Please include ALL hardware, power supplies, component names and pin labels.

5 feet for I2C may be a bit long for a format that was designed for PCB level comms.

Thanks.. Tom.... :smiley: :+1: :coffee: :australia:

If you want to push I2C that distance then it would be recommended to use a Rise time accelerator IC and slow the I2C bus down, though 100/400Khz would be possible here still.

The Adafruit LTC4311 would allow you to hit the 5 feet mark and is 5V rated.

Long wires adds capacitance and resistance so this affects the rise times, the LTC4311 here stops this by switching in a current source to quickly slew the bus lines to the pull up voltage.

Be careful, the I2C bus has a limit drive capability and not all units have the same. Design with the device that has the lowest drive capacity on the I2C. Slowing it down, maybe to 25KhZ will make it much more robust as would twisted cable.

This is from: Requirements For Devices – I2C Bus

Requirements For Devices

The I2C specification poses several requirements to I2C devices in order to ensure proper operation in different environments. The most important ones are:

  • Both, SDA and SCL, must be open drain or collector & must not be driven high by anything attached to the I2C bus.

  • In most I2C buses, the low and high input voltage level thresholds of SDA and SCL must depend on Vcc. E.g. an SDA voltage level of 1.1 V will be interpreted as low in an I2C bus with Vcc = 5 V and as high in an I2C bus with Vcc = 1.2 V.

  • The SCL and SDA signals must be sampled by Schmidt Trigger inputs, i.e. with a certain hysteresis.

  • Spikes in SCL and SDA signals must be filtered up to a certain amount (only for full speed I2C).

  • Setup and hold times; this includes a specified maximum SCL clock rate (100 kHz for normal speed, 400 kHz for full speed).

Most off-the-shelf standard I2C ICs fulfill these requirements while e.g. I2C software implementations in microcontrollers often do not. This does not necessarily need to be a problem as long as the environment does not require a feature that one of the devices on the I2C bus does not support, but has to be kept in mind when tracking down I2C bus-related problems.

All three I2C modules are 5v rated and are identified on the above attachment. The Arduino Pin#s are clearly shown in the same. I do not have schematics for those modules. The I2C bus is properly wired. What other schematics would you need to answer the Pullup question?

The length of the Busses are not in question as that issue was resolved in a previous post.

1 Like

A decent resolution photo of the module you're using will likely do(but you have them in front of you). For example, here,
https://www.aliexpress.com/item/1005009093528022.html
is an ADS1115. Looking closely, It's a pretty safe bet the pullups are 10k, because all the resistors are the same. A quick photo check on the web shows that some 8574's have 4.7 k pullups; some INA228 have 10k. I'd guesstimate from all that that your pullups are running around the 2.5k mark(10k//10k//4.7k), which is well within spec. But rather than further guessing, visual inspection of the items in front of you would likely reveal a lot. If you're not sure after peeking, post a pic.

I highly recommend that, in your first post of this thread, you include the following:

Technical background may be found in this previous thread:

Unless, of course, you like answering the same questions and challenges repeatedly.

Or, you could have just reawakened that thread by asking a moderator to reopen it, and posting your new question right there. That way, the context and history is clear - for those helpers who are into reading upthread, anyway.

Thank you. I actually checked my ADS1115 and the INA228 with an ohmmeter and they are 10k.

My 8574 ohmed out at 1k on both ADA and SDL to Vcc. My guess is I should replace with 10k which would put the total pullup in the 3k range??

In my first post I was not asking about buss lengths so did not feel the need to justify something I was not asking about. I posted the background in response.

My comment was in general, not in response to your defense. The issue is, far too often we watch threads go off into the weeds, exploring details that, it turns out, were dealt with in one, or more, previous threads; meanwhile, the poster gets more and more defensive.

Helpers generally read dozens, or hundreds, of threads per day, depending on their lives. It's unreasonable to expect anyone to recall the past postings of a name that doesn't appear regularly, so we end up asking for this, that, and the other because we don't have any way of getting back to the past history, unless we dig into your avatar and track down past threads - but why should we, when you can provide that link in post number 1?

Not making a war out of this, just pointing out that in this technical forum, information is priceless, so pointing us to where it already exists is just helping us help you.

3 Likes

I'd say yes. Makes me want to check those, I have several.

2 Likes

Hi, @barryfields

We don't need the module schematics, the blocks are okay.
How ever you need to show all connecting wires, the black board needs to be shown as its circuit.

Thanks.. Tom.... :smiley: :+1: :coffee: :australia:

1 Like

Remaining question is:

If I remove the 1k pull-ups on the PCF8574, are the pull-ups on the ADS1115 and INA228 sufficient?

That would put total pull-ups @ 5k. If I engage the Arduino pull-ups it would be approx 3k.

I

How long is your bus? You show it as 1" (one inch), but I suspect you mean 1'(foot). Really, the answer is found with an oscilloscope, but not everyone has one handy. My experience, in my basement, on boards I designed and built, is that a 4.7k pullup for each signal at the far end of the bus is adequate on a 1 meter run. Can't comment on your environment, nor your setup, nor your routing, nor half a dozen other 'things' that might be a hidden issue.

I'd try it with and without the internals; if it works without, then engage them anyway, and you know you have margin for 'bad days'. If if doesn't work without the internal pullup, or is seems marginal in any way, then you have a hint that you need a lower net resistance for pullup.

1 Like

The on board PCB buss length is indeed ONE INCH.

Sorry, but the complete bus appears to include the RJ12 at 5'. Unless you're telling me there's an invisible repeater in there, you have to consider the entire bus not just the PCB portion.

1 Like

I truly appreciate your input and patience. I am trying to really understand the concepts here.

Is it true that each component on the buss does not need it’s own individual pull-up resistors?

For this 5ft I2C buss, do I need a termination resistor?

Does the Arduino 2560 r3 have internal pull-up resistors available for pins 20 & 21?

There isn't any reason the hardware you have picked wont work ; they are all 5V rated and the Mega2560 is perfectly fine running I2C and SPI together along with one of the UARTs.

The reason the I2C length was mentioned in the first place was to avoid any frustration further down the line since you have a long bus some care needs to be taken to have a reliable link so it seemed a good idea to bring it up now vs later when things may not be working as expected.

When it comes to I2C the basic setup is that the ICs you interface to have open drain SDA and SCL pins ; they can only pull the bus lines low.

The resistors are what pull the the bus lines back up to VCC when the open drains turn off.

The wires between / all the connections add up and effectively becomes a small capacitor that you are charging and discharging ; for short runs on a single PCB larger pullups are fine like 10K but as you make the bus larger you need stronger pull ups.

The lower the pullup resistor value the stronger the pull up becomes ; Faster rise time when pulling up to VCC at the cost of power usage.

I would personally as I mentioned use a rise time accelerator if you want reliable I2C over that 5 feet of cable other wise you are going to probably need stronger pullups or slow the I2C bus right down.

I2C has no termination resistor ; its only the pullups that are present.

This will be a try and see for the most part as mentioned above if you don't use a rise time accelerator you will have to try smaller values for the pull ups till you find a reasonable. setup.

I personally always added a buffer/rise time accelerator with even the small boards I had done just to add some robustness to the I2C bus.

Just my two cents.

1 Like

Yes. The I2C bus should only have one set of pull-ups but will ofen work with several as long as none of the I2C specifications are violated.

For this 5ft I2C buss, do I need a termination resistor?

The I2c bus should only have one set of pull-ups, usually placed next to the I2C master.

Does the Arduino 2560 r3 have internal pull-up resistors available for pins 20 & 21?

Not for I2C.

2 Likes

Just curious if you had checked the pull-ups on your 8574s ?