Arduino as an I2C master and slave

I just wanted to check the feasibility of an idea (please note this idea is not related to the other I2C thread I'm posting tonight). So in my situation a Raspberry Pi communicates via I2C with an arduino Uno (atmega328p based, 16MHz), but I wanted to check whether it is possible for this arduino to then be I2C master to another device on a "lower level". If, as far as the Pi is concerned, the Uno has an address of say 0x11, and the Pi also connects to several other devices with various other addresses (lets say 0x12, 0x13, 0x14, and 0x15), would it then be possible to have another device as I2C slave to the uno (assuming that this extra device is not addressed as 0x11, 0x12,0x13,0x14 or 0x15)? Would one be able to get the Pi to read from the Uno, and the uno to read from a sensor? Would there be problems if the Uno tried to act as master to sensor AT THE SAME MOMENT as the Pi tried to address either the uno or onw of the other devices it is master of? Or would such situations need to be prevented by having a few extra wires for timing negotiation to ensure that at any given time the Pi may address the uno (or other devices), or the uno may address the lower level sensor but they must not both operate at once?

The reason I'm wondering about this is because a lot of sensor devices come as I2C devices but a Pi can often struggle with I2C due to clock stretching bugs in the Pi's design. I know a Pi can be made to talk to an uno quite reliably, but sometimes it won't handle a sensor whereas an arduino will almost always connect ok to an I2C based sensor device. If it works with an arduino Uno one can very cheaply get an ATMEGA328P chip itself, or even some sort of ATTiny, to use as a device to stand between the Pi and sensor.


Both Pi and UNO can work as Master of its own. A Master can always check bus/slave availability (by executing the following codes) before starting data exchange in order to avoid bus conflict/contention.

byte busStatus = Wire.endTransmission();
if(busStatus == 0)
   Serial.println("Slave is found...!:);
   //wait or else

The Pi can always instruct the UNO to acquire data (as Master) from the I2C sensors and then send the data to the Pi (addressing Pi as a slave).