Two I2C devices

Hi, looking for a bit of help on a project im working on.

I have and arduino uno with a sensor shield. This has an I2C connector, whice connects to two devices. The first is a 20x4 LCD display.

The second connector is going off down a 1.5meter cable to connect to a breakout box with an MCP23017 IO expander. |500x500

The cable is 8 core and will carry power from the breakout box to the arduino.

My issue is that everytime I connect the second I2C (which is the breakout box), the LCD backlight comes on and then the arduino seems to freeze up. Then nothing.

If I disconnect the I2C it all works again.

Any ideas?

Thanks for your help

Something like this:

The I2C bus is not for in a cable. The I2C bus is for on a circuit board, with a maximum length of about 50 cm. Is that cable with twisted-pair wires ? The worst thing for a I2C bus is when SDA and SCL are on the same twisted pair.

Weirdly, both work independently (the cable must be short enough to make it work), but when I connect both I2C devices it appears that the arduino freezes.

Everything uses the I2C-bus as a 5V I2C-bus ? Perhaps a device has pullup resistors that influences the I2C-bus.

What you have is normal. When you have a bad I2C-bus (for example with a cable, or the wrong cable) then these things can be expected.

If you use a single wire for SDA and a single wire for SCL and don't have those wires near something else, and you have a good GND connection, then ... it will work up to 2 meters, or even more. With just any cable, then 50cm can be already be a problem.

Do you know what your total pullup resistor for SDA and SCL is ? That is all the pullup resistors of the Master and Slaves combined. When that is too weak, the I2C-bus is high impedance which is not so good for a I2C-bus in a cable. When the total pullup is too much, the current is too high and some chips don't even meet the specifications of 3mA.

The maximum pull-down current for I2C is 3mA. As a rule of thumb I prefer 1mA, and 2mA for longer wires. Therefor 5V and 2mA is a total combined pullup resistor of 2500 ohm.


If you look carefully at the back of your I2C LCD, what marking does the black IC say? MCP23008, maybe MCP23017?