Versatile remote IO design


Author Message
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 5994
Posted: 11:18am 08 Jul 2025      

Hi Phenix,

Last weeks spend again a lot of time debugging a test system using I2C for some sensors.
Lessons learned (again) : Don't use I2C crossing boards (flat cable) in an electrically dirty environment (near a 11kW 3phase motor drive).

I2C on a PCB with good ground plane is fine. But as soon as you leave the board the open drain (pullup impedance) makes it vulnerable. And there is simply no good way to filter this out (capacitors/common mode chokes). If you need I2C then use one of those serial-I2C convertors, make the cable run on serial (RS422) and convert to I2C near the I2C device.

And when you implement I2C in industrial system, it is almost certain I2C errors will occur. Make sure your software can handle I2C errors. SCL stuck low is a nasty one, most cases require a hard reset of the I2C device (slave). SDA stuck low can be repaired with 9 clock pulses on SCL.

Implement error handling from the start !!! Do not wait until you are hit by it in the field. Then it is too late to implement the reset of a device (*).

Volhout

Most I2C devices can be reset by removing Vdd, waiting, and re-applying Vdd. This only requires to switch individual device Vdd, no need for extra RESET line. You can also power low power I2C devices from the output of a logic gate (that acts to switch Vdd).

P.S. There are I2C bus buffers that can communicate I2C with low resistance pullups. That improves somewhat. It is not fail proof though.
Edited 2025-07-08 21:22 by Volhout