I'm trying to figure out what the best way to turn on / off the data signal for I2C communication is. For my application, I have multiple Arduinos running the same exact code communicating in I2C. Because they have the exact same code running on them - including identical starting I2C addresses; more like broadcast addresses - they require a part of code that figures out a unique address to give each slave. The initialization of each slave, therefore, requires only one "no address" Arduino to be connected to the I2C line at one given time, so that it can truly be given a unique address. The issue is I want this to be done automatically without having to manually wait for each slave to be initialized before connecting the next one.
I have the entire code figured out, and the requirements as I've stated above are fairly set in stone - especially the fact that I can't pre-program them with unique addresses. This is simply because the addresses given will be sequential based on how close in the daisy chain they are to the master. The order now could be different than the next one, as they can be plugged in in any order. So simply put I'm not looking for another work around. The only part I need to figure out is the best way to switch on/off the connection between devices.
Ideally, I'd like power to still go to the next device even if I2C isn't happening, so that's why I'm looking to switch the data line. I was dumb enough to initially think a logic gate on the data line would suffice, but the connection needs to be two-way, so to my knowledge that wouldn't work out. Is a relay my best option? I really don't know much about gate / switch ICs / relays, so any insight or a direction to look in would be greatly appreciated.
Thanks in advance!