Sparkfun Qwiic Connect Auto register module/component


I am working on a project that is modular in Nature. The client wishes to add or hotswap modules (mostly potentiometers) at will. Is there a way for the Soarkfun Qwiic system to auto register a module when connected?



If you have to ask, then it is not possible.
If you are willing to take care of every situation, then it might be possible since two weeks.

It is possible to scan the I2C bus a few times per second to detect new devices on the bus or devices that are disconnected.

Every device that is connected to the I2C bus must have its own I2C address. When two modules have the same I2C address, that causes trouble which can not be detected in software. This could be the main problem, because there is nothing you can do about it in the sketch. Not even a reset can fix or detect that problem.

Suppose two potentiometers with the same I2C address are added to the I2C bus. Then both will probably work, but the result will be weird. It would be hard to tell what is going on, because it seems to work (but in a weird way).

Which digital potentiometers are they?

Are you going to use cables ? The I2C bus was not designed to go through a cable.

In the Arduino, you have to test every read and write to a device if that was succesful. That means you have to know the Wire library really well.

For the AVR family Arduino boards (Arduino Uno, Mega, Leonardo) the Wire library has timeout for a faulty I2C bus. This was introduced two weeks ago with Arduino IDE version 1.8.13. This should solve some problems with a stuck I2C bus. The Wire library for the AVR family boards also recognizes some I2C bus errors. That should be enough to keep the Arduino going.
I don’t know if the Wire libraries for other boards have all those things yet.

In the sketch, a very good administration is required. That is not easy to implement. I suggest to keep it as simple as possible. That means you have to make some restrictions for the usage.

The RS-485 bus is a lot easier for adding and removing modules. Then you need a good protocol with a checksum and so on, but that are normal problems that can be fixed.