I2C over 20m, 20 slaves.

My project requires me to have multiple Arduino slaves who will have to communicate with a server based on certain inputs they receive. A master Arduino connected to the server checks all of the slaves at regular intervals (every 3-5secs) to see if they have something to send and takes their requests, gets a response from the server and sends it back to the slaves. I think I2C would be great for this as no extra wires would be required for every slave. The slaves will be placed at 1m intervals with the farthest slave not beyond 20m.
I found the P82B715 ICs which enable such long distance I2C communication and can be connected like this(As per NXP Datasheet):

All the parameters to be considered are somewhat confusing so I just wanted to ask, am I going on the right track?
There is also a P82B96 IC which is a buffer and not an extender by its name, but it splits the SDA SCL lines into seperate ones for Tx and Rx and permits higher capacitance (4000pF) on the Tx Rx side, so would that be better? Also please let me know if I forgot to mention/consider something.

Why do you want to use I2C for long distance transfers? Did you consider RS-485 which is designed for long distance communication. It much more immune against electrical noise (common mode signals) as it uses differential signals but uses an asynchronous serial signal instead of the synchronous of I2C. If you have an Arduino on every node anyway you should give RS-485 a try.

Just for thought, does it have to be "hardwired" or could it be based on example RF24L01 or similar instead ? You have to feed VCC and GND for slaves though..

TommiP

pylon:
Why do you want to use I2C for long distance transfers? Did you consider RS-485 which is designed for long distance communication. It much more immune against electrical noise (common mode signals) as it uses differential signals but uses an asynchronous serial signal instead of the synchronous of I2C. If you have an Arduino on every node anyway you should give RS-485 a try.

Yeah but I would have to cut those shielded twisted pair cables at very short intervals to access it for the nodes and I'm just more confident with I2C :stuck_out_tongue: . That's not much of a reason to NOT use RS485 actually, so I'll look more into it, but other than that...the configuration I attached for I2C should work fine right?

TommiP:
Just for thought, does it have to be "hardwired" or could it be based on example RF24L01 or similar instead ? You have to feed VCC and GND for slaves though...

Oh, I thought I about WiFi and Radio but I feel it will make a mess as there can be up to 40-50 of these slaves, and hardwired is just more reliable.

Oh, I thought I about WiFi and Radio but I feel it will make a mess as there can be up to 40-50 of these slaves, and hardwired is just more reliable.

I think that with all bus types you have to communicate one node at the time, also with wireless ones. I2C doesn't make a difference and if you try to communicate between two or more nodes at the same time, there would be a mess..

TommiP

TommiP:
I think that with all bus types you have to communicate one node at the time, also with wireless ones. I2C doesn't make a difference and if you try to communicate between two or more nodes at the same time, there would be a mess..

I mean all the signals flying here and there in the air! Security is an important factor in my project.

Srijal97:
I mean all the signals flying here and there in the air! Security is an important factor in my project.

Then is better to hardwire if lack of security is really an issue.. Just for personal curiosity, which one is your concern, functional or information security ? In other word, are you worried that some of your slaves does not respond or is it the feeling that someone might steal the data ?

Yeah but I would have to cut those shielded twisted pair cables at very short intervals to access it for the nodes

The same applies for your setup, doesn't it? If you can access the wires without cutting the cable you can do the same with RS-485.

the configuration I attached for I2C should work fine right?

I would expect it, although, personally, I never used more than two I2C range extender connected to one bus. The datasheet of the P82B96 explicitly says that your setup should be possible. One change is necessary in my opinion: Remove the second pull up resistors on the interconnect bus (long wires). Just pull up once.

pylon:
The same applies for your setup, doesn't it? If you can access the wires without cutting the cable you can do the same with RS-485.

Yes, but RS485 is like more wires with a shield layer in between. Just a silly reason i know, don't bother about it...I just don't think it beats I2C in my case.

pylon:
I would expect it, although, personally, I never used more than two I2C range extender connected to one bus. The datasheet of the P82B96 explicitly says that your setup should be possible. One change is necessary in my opinion: Remove the second pull up resistors on the interconnect bus (long wires). Just pull up once.

Okay, so would P82B96 be better instead of P82B715? Why is the former a buffer whereas the latter is an extender? The only difference I see is that the P82B96 splits the incoming and outgoing lines and allows level shifting (Which I don't require)

Yes, but RS485 is like more wires with a shield layer in between.

I don't understand that. It's less wires (you only need two of them), you even don't need a common ground.

I just don't think it beats I2C in my case.

My opinion is different. You would get an increased reliability. RS-485 is made exactly for setups like yours.

Okay, so would P82B96 be better instead of P82B715?

The P82B96 separates the inter-device bus (long cable) from the device bus (between chip and MCU) while the 82B715 just allows for more capacitance on the whole bus. I don't think that the 82B715 is a good choice if you connect more than 3 to 4 devices to your bus. But it has the advantage that you may have more than one extender chip on the master's I2C bus (as far as I already read the datasheet).

pylon:
I don't understand that. It's less wires (you only need two of them), you even don't need a common ground.

My opinion is different. You would get an increased reliability. RS-485 is made exactly for setups like yours

Only two? Is it not like 4(2 twisted pairs)?

Okay, you seem to be pretty confident and cleary know more in this matter so I'll read more on the RS-485 and try it out. Will let you know what I decide finally! Thanks a lot!

Meanwhile, I would greatly appreciate anybody posting their thoughts/tips/ideas.