0
\$\begingroup\$

I have a CAT6 cable that was used for old temperature sensors that works with 5V I2C at 25/30 meters from the main MCU with cable pairs that brings VCC-GND-SCL-SDA.

Here is the schematic:

enter image description here

I've tried using an ESP32 with I2C bus speed of 100kHz with another PCA9306 at the Gateway end of the cable but it works for maximum 5 meters (and with many errors...)

The speed isn't a problem, i can slow down the speed without any problem.

The cable has a capacitance of 56pf/m, so 30 meters are 1680pf in total, higher than the maximum I2C limit of 400pf.

I know that i2c should not be used outside pcb, etc, etc..i can't change/add nothing more than the main gateway that collects those sensors data.

Now i'm looking for a solution for that: maybe i can use a repeater and level translator like the TCA9517DR and lower the pullup resistor on A-Side in order to fight the cable capacitance?

In any case, i wish have some useful advices about which parts i can use and how i can solve this issue.

\$\endgroup\$
  • 1
    \$\begingroup\$ I2C can be perfectly well used outside PCB. Many interfaces such as DVI and HDMI carry I2C pins for control and configuration, and you can have very long DVI and HDMI cables. It just means the I2C bus needs to be designed very carefully, e.g. define pull-up resistances, speeds, capacitances, and to work with what you have may not reach 100 kHz clock speed. I2C buffers and repeaters do exist that might help. \$\endgroup\$ – Justme Aug 1 at 14:27
  • \$\begingroup\$ Yes, sure: in my case slowing speed isn't a problem...i have all defined: Lenght, capacitance, pull-up resistance and speed...what else i have to define? my question seems very clear! \$\endgroup\$ – VirtApp Aug 1 at 16:09
  • \$\begingroup\$ There's nothing extra to define. Theoretically, with 1k pull-up resistors at both ends, it should work at frequencies lower than 100k. \$\endgroup\$ – Rohat Kılıç Aug 1 at 16:19
  • \$\begingroup\$ You mean that can work simply using the TCA9517DR on the gateway side? Actually the only side that i can modify is the gateway side, so the two 1k pull-up resistor that are you refering are on A and B side of the TCA9517DR, right? \$\endgroup\$ – VirtApp Aug 1 at 16:26
  • 1
    \$\begingroup\$ The sensor can sink maximum 4mA, I2C standard sink requirement is 3mA. Having 1k pull-ups on both ends would violate this requirement. @VirtApp, do you use the blocking or non-blocking I2C read commands? Can the ESP32 handle clock stretching if you do use blocking I2C read commands? \$\endgroup\$ – Justme Aug 1 at 19:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.