Notifications
Clear all

I2C-bus: multipe shields parallel decreasing pull-up resistance  

  RSS

ROGUE
(@rogue)
Active Member
Joined: 3 months ago
Posts: 12
2020-06-08 9:18 pm  

I'd like to place multiple shields on the I2C-bus. Each shield has pullup resistors of 10K. According to Ohm's law the resistance will decrease - the current will increase, 2 shields 5K ... 10 shields 1K, a.s.o.. I think it's a good idea to desolder the resistors of the shields exept of one shield, to keep the cuuent low. Is that reasonable? Is there a way to identify the soldered resistors safely?


Quote
Ruplicator
(@ruplicator)
Estimable Member
Joined: 4 months ago
Posts: 106
2020-06-08 10:04 pm  
Posted by: @rogue

Each shield has pullup resistors of 10K.

All of the shields I've encountered don't have any pullup resisters on the I2C bus and you have to add them yourself. If you think that your's do and you have an ohm meter you can measure between the bus leads and the VCC pin and if it is more than 10K then you know there is no pullup.


ReplyQuote
ROGUE
(@rogue)
Active Member
Joined: 3 months ago
Posts: 12
2020-06-09 2:32 pm  

Hey Ruplicator,

thanks for fast reply 😀 , you're right! That's the first thing I tought about. Are there any build-on pullups? Yes, there are (otherwise I would not have made this post). Sorry, that's not my query.

I measure from the bus-DATA pin(s) to all ends of the resistors, When I measured zero Ohms this identfies ('end1' of) the resistor, on the other 'end2' there is 10K, measureing from 'end2' to Vcc it is zero Ohms, ...that identifies the pullup, I think. But is this method save in every case? I'm shure, all of my I2C-LCD-adapter shields and all of my PCA9685-servo shields do have pullups. Is desolder them a reasnable idea?


ReplyQuote
DroneBot Workshop
(@dronebot-workshop)
Workshop Guru Admin
Joined: 1 year ago
Posts: 547
2020-06-09 3:09 pm  

Measure from the SCL and SDA pins to VCC (5-volts) as stated by @ruplicator. That should tell you if the resistors you see are indeed connected. Many shields have solder pads or jumpers to connect these, they don't usually come connected from the factory.

Ideally, you should have about 4.7 to 10k for pullups, but for shorter lines the resistance can be higher. Also, remember that if you are using the Arduino Wire library for I2C that it activates the Arduino's built-in pullups, so you can sometimes get away with no pullups. However the internal pullups are only about 33k, so on longer runs they won't be sufficient.

😎

Bill

"Never trust a computer you can’t throw out a window." — Steve Wozniak


ReplyQuote
ROGUE
(@rogue)
Active Member
Joined: 3 months ago
Posts: 12
2020-06-09 3:41 pm  

Hi Bill,

thanks for very fast reply, think I've 'bad luck' with my China shields. The pullups are fix soldered and no jumpers or pads are there. Seems to be a rare problem. Just, to do it allright the overall resistance should not get lower than 4.7K. I am not shure what happens when the impedance goes lower. 


ReplyQuote
Ruplicator
(@ruplicator)
Estimable Member
Joined: 4 months ago
Posts: 106
2020-06-09 4:00 pm  

Distance is usually more of a problem on an I2C bus than low resistance levels. Even in your worst case of 10 pull-up resistors at 10K each, that is still only 5 mA (for a 5 volt bus) for the driver transistors to manage. They have the ability to handle much more current than that. However, you add a few meters of distance from the shield to the processor and you start to see additional problems.


ReplyQuote
ROGUE
(@rogue)
Active Member
Joined: 3 months ago
Posts: 12
2020-06-09 4:27 pm  

Hey Ruplicator,

thanks a lot for reply, thanks for taking time. I think the problem starts at 40 shields with fixed resistors. That makes me more relaxed about this topic. I just wanted to take precaution not to blowup the µC. Of cause the specs for I2C limits the distance to one meter (aprox. 39 inches). Did you ever hear about a project with a longer distance working? As you got it right, this may get another problem of my project.


ReplyQuote
Ruplicator
(@ruplicator)
Estimable Member
Joined: 4 months ago
Posts: 106
2020-06-09 5:01 pm  

I have heard of other projects with significantly longer I2C buses but I can't put my finger on where right now. There are a few things you can do to minimize the effects of long lines. The easiest is to use lower resistances and place them at each ends of the bus, use larger wire sizes for the buss wires, use separate ground lines to twist with the data and clock lines. 

The last item is the most complicated and I wouldn't bother with it unless the others aren't enough. A twisted pair has a long distance impedance around 300 ohms but in this setup it won't work perfectly because one line of the pair is grounded. If you can remember the old TV lines where 2 line were separated by about a 1/4 inch, that was a 300 ohm transmission line.


ReplyQuote
ROGUE
(@rogue)
Active Member
Joined: 3 months ago
Posts: 12
2020-06-10 11:50 pm  

Thanks very much for your valuable hints! I think it's a good idea to wire the ground twice. I'm in the planing phase of the project. Waiting for deliveries from china. I am thinking about two more things at the I2C section of the project: placing the µC in the 'middle' of the I2C-bus. And taking a shielded 4-wire cable like used by 'vintage HiFi'. And well, as you said, maybe an Cat-5 shielded twisted pair cable. My knowlage of HF-transmission via cables is a bit limited, you wrote: "...it won't work perfectly because one line of the pair is grounded.", does it make sense connecting SDA and SCL on one pair and the two ground(s) on another? BTW:The resistors at the end of the bus-line reminds me to old SCSI termination.


ReplyQuote
Ruplicator
(@ruplicator)
Estimable Member
Joined: 4 months ago
Posts: 106
2020-06-11 12:51 am  
Posted by: @rogue

does it make sense connecting SDA and SCL on one pair and the two ground(s) on another?

The reason it won't work optimum is that a twisted pair works best when it is a balanced pair.  In other words, the two transmission lines should be able to work in apposing polarities. When a positive pulse travels down one wire of the pair the other wire should have a negative pulse. This allows the inductance and capacitance of the transmission line to cancel out. Using a ground line curtails some of this benefit.

However, it is much better than having SDA and the CLK line twisted together. Since the signals in each of those lines will interfere with each other if they are run together over a long distance.

If you are going to use a shielded cable run only the SDA and ground wire in one cable with the shield connected to ground only at one end of the connection and run the CLK and ground in another shielded cable with its shield grounded at one end. 

You haven't indicate how long you plan to run your I2C lines. The steps outlined above maybe overkill unless you have a very noisy environment and plan to run multiples of the specification distance.


ReplyQuote
ROGUE
(@rogue)
Active Member
Joined: 3 months ago
Posts: 12
2020-06-17 4:06 am  

Hi, again. It's a good explaination, that makes sense. I will keep the bus as short as possible. Of cause, the discussion about long I2C lines is theroretical and may be a overkill. It helps to avoid problems in the planing phase and it's nice to know. I planed seperated modularized units, but now it's reasonable to put all of them in one case. Thanks for reply and good hints (very much, again)


ReplyQuote