I2C Arduino

Hi, Is is possible to make one arduino a slave to another but also master of its own I2C devices such as RTC, temp sensor etc? I am working on a project which in theory has one main controller arduino which looks after comms and two slave arduinos which look after different monitoring tasks and report back to the main controller on demand. The slaves have their own I2C devices feeding them data such as temp, motion, location etc.

Although theoretically it's is possible to set a system up like this, my advise is not to do so. Use another interface (like USART or SPI) for the inter-Arduino communication and reserve the I2C for the slave devices. While one (slave) Arduino is communicating with it's devices it gets a bus master. During that time you have multiple masters on the bus and the Wire library doesn't support that. You would have to do all the low level programming yourself and have to take special care to avoid race conditions.

Ok thanks, point taken. I will use soft serial and Usart for inter Arduino comms.