I2C 10 bit addresses support for Wire library

I'm new to I2C.

My project involves connecting more than 127 devices and from what I'm reading, I can use I2C 10 bit addresses in order to bypass the limitations. Unfortunately, Arduino's Wire library only supports 7 bit addresses.

How can I get around this limitation?
Should I write my own implementation for I2C in order to support 10 bit addresses?

Thank you

I guess I'd start by reading the datasheet for the processor on whatever (unspecified) "Arduino" board you're using. Make sure it's I2C peripheral supports 10-bit addressing. Then, dive into the source code for that board's Wire implementation.

1 Like

Also, check that the devices support 10 bit addresses.

You could use more than 1 Arduino, with multiple devices on each.

This is a XY-problem. Could you read this : https://xyproblem.info/
Can you tell more about your project ?

The I2C bus is not that kind of bus.

More than 127 devices is very hard. There are wires, capacitance, crosstalk, pullup resistors, and so on.
With a number of I2C multiplexers it might be possible. Then a single (sub) I2C bus is active with a few I2C devices and the rest of the (sub) I2C buses are idle. I don't know how many devices can be connected to a I2C bus, perhaps 5 to 20, depending on the wires and the I2C devices.
However, it is not very practical, it will take time to read all the sensors.
Do you really have I2C devices that support 10-bit addresses ? I doubt that.