2

I am working on a project which requires a long I2C bus, which can be long as 200 m or more. I searched on the Internet and found a chip (NXP PCA9600). Is there any alternative to this chip, and if I am using this chip should I keep this at both the ends: controller - Arduino mega, target MCP23017)

I am new to the I2C protocol and its wiring.

Null
  • 7,448
  • 17
  • 36
  • 48
  • 2
    You're sure this isn't an XY problem? Who told you the project "requires" a 200 m I2C bus? That's really not what I2C is designed to do. – The Photon Dec 18 '17 at 06:11
  • the project as its master at a place called as the base station and the slave is placed at a remote place where I have all the sensor array and actuator.The distance between the slave and the master is 200m plus. – Sam Verghese Dec 18 '17 at 06:17
  • 1
    That still doesn't explain why you need to use I2C to communicate between them. There are lots of protocols designed to cover 200 m. I2C is not one of them. – The Photon Dec 18 '17 at 06:27
  • sir, I choose I2c because it just uses 2 wires and I can have as many io extenders at the receiver end. I was planning to use an ethernet cable for the same. basically, i need to switch on/off and to get data from one room to the base station. the project is based on home automation. so to communicate between rooms to the control station. – Sam Verghese Dec 18 '17 at 06:34
  • 1
    If you use the PCA9600 you'll need 5 wires (including ground), or 9 if you're using twisted pairs. Maybe look at RS-485 if you want to do this with only two wires. – The Photon Dec 18 '17 at 06:46
  • sir if i change to rs485 what all components do i need to communicate 8 room to the control station? – Sam Verghese Dec 18 '17 at 07:17
  • This might help: https://create.arduino.cc/projecthub/mitov/rs485-serial-communication-between-arduinos-with-visuino-3f35bf – Whiskeyjack Dec 18 '17 at 11:40
  • thank your, it did help.Iam changing the protocol to rs485 from i2c as you suggested. – Sam Verghese Dec 19 '17 at 15:47
  • sir one more doubt. is there any smaller controller that i can use other than arduino nano which is compatible with both rs485 and i2c if possible. i want around 16 io expandable. – Sam Verghese Dec 19 '17 at 15:51

1 Answers1

2

200 meters is pretty far to go for I2C, since it was originally intended for short-distance intra-board communication. However, using a bus buffer as you describe and running at lower clock speeds will make long cable runs possible.

This application note from NXP shows 50m performance for the PCA9600 you're looking at:

NXP app note

The PCA9615 is a related part that uses a differential I2C protocol, and is rated to 3 meter lengths at full speed (1MHz). I've used this part without issue operating at 400kHz over a 10 meter CAT6 cable.

Ethernet may be worth looking into, as it was designed for long distances--perhaps a Raspberry Pi on each end, acting as master and slave respectively?

Related question here regarding max length of an I2C bus, with notes regarding bus capacitance.

bkeegs
  • 41
  • 2
  • sir i read some were that with pca9600 can increase the capacitance too 4000pf and 300m max length. did i get a wrong information.? – Sam Verghese Dec 18 '17 at 07:16
  • I'm not seeing that anywhere in the datasheet or app note, so while it may be possible (as claimed by the link below) you'd probably need to test to know for sure :/. https://sandboxelectronics.com/?p=1145 – bkeegs Dec 18 '17 at 17:46
  • thank you sir, i thinking of changing the protocol to rs485 as " The Photon" sir said. the production cost of the board with i2c is much greater than that rs485 and i wont have rooms more than 35 for sure.. – Sam Verghese Dec 19 '17 at 15:47