Multiple I2C Interfaces

Hi Guys,

i've already found this topic: Running 2 i2c instances simaltaneusly - Interfacing - Arduino Forum
but it does not apply to my situation.

So here is my setup:

I have an arduino "sensor" board which receives data from 3 sensors over i2c. So for now, my I2C master is the arduino board and the slaves are the 3 sensors. I have many of those sensor boards, lets say 15. So
Now i want to send those information to another ardunio which collects all those informations.

Now the problem:
As i see it, i cannot configure the sensor board as a master for receiving the sensor information and at the same time as a slave for sending them to the "Master" collector board. Am i wrong? Can i do that? If yes how?
Skipping the sensor board arduino and directly sending all information to the "Master" collector board is not an option since the sensors need each ~100ms of read/write time, so 15x3 would be 45 x 100ms. Which is just not applicable.

At the moment my solution is to use SPI which sucks (as you can imagine) because i need 15 select pins...

Any idea or input is welcome.

Have a nice day all

Best

1. You have Arduino UNO-1 as I2C Master to collect data from three I2C slave sensors. Correct? If so, give a link to your sensors.

2. You have another Arduino UNO-2 as I2C Slave to which you wish to send data from the Master UNO-1 of Step-1. Correct?

Have you written any codes? If so, post them.

Thanks for your reply.

  1. I am speaking of any atmega device for which arduino has a bootloader. Right now i have the ATmega 328p as sensor microcontroller and an ATmega2560 as the "Master" collector". I did not choose specific sensors yet. The important information from my setup here is that a large amount of data will be send over the I2C bus what makes the sensor arduino irreplacable.

  2. No. I have another arduino device x which should act as master collecting data from sensor arduino y which now should be a slave ( instead of a master while reading the sensors)

No code written yet since on this decision i will choose specific hardware components

Are you thinking like this?
i2cMega.png

i2cMega.png

Sorry for my bad drawing skills, what i would like to do is the following:

+1k for the nice and readable diagram.

The circuit could be operated using I2C codes.

1. Let the Master of Arduino-0 acquire data freely at regular intervals form its I2C sensors and save them in an array.
2. Arduino Master will ask Arduino-0's Slave to read data from its own Master and then forward the data to Arduino Master.
3. Strategy of Step-2 could be applied for Arduino-1, Arduino-2, ..... on round robin basis.