Hi everyone, I'm new here. I'm working on a project where I will simulate a pressure sensor and feed scripted data to multiple I2C masters.The sensor I'm simulating is a pressure sensor with a fixed address of 0x76. It's the slave on the bus, and the transmitters in the original circuit act as I2C masters, so the transmitters would continually fetch data from the I2C bus.I've managed to use my ESP32 to function as a slave on the bus and it was working. However, I'm wondering how I could use a single MCU, like an ESP32 or an Arduino device, to feed data to multiple transmitters. I think every transmitter should be on an individual I2C bus; otherwise, the address 0x76 would be conflicted. I'm considering using an I2C mux like the PCA9685, but I'm not sure if the MUX can help to implement multiple slaves to feed data to the transmitters. Please give me some advice if possible.
I moved your topic to an appropriate forum category @iopuyt.
In the future, please take some time to pick the forum category that best suits the subject of your topic. There is an "About the _____ category" topic at the top of each category that explains its purpose.
This is an important part of responsible forum usage, as explained in the "How to get the best out of this forum" guide. The guide contains a lot of other useful information. Please read it.
Thanks in advance for your cooperation.
There can only be one master on an I2C bus. You don't see an orchestra with 2 conductors.
Thank you i got it
I suggest you have a look at the M74HC4052 datasheet. You could hook up your ESP32 to 4 different masters and let the ESP32 or one of the masters command what master to be connected at what time to the slave.
Probably easier to let your ESP32 decide which master it wants to talk to.
I realised that so I was thinking if I2C mux like PCA9548 could help me simulate multiple 0x76 slaves in multiple individual I2C buses, in the handbook it looks like I can only be the masters in the channels which I2C mux extended.
The address of the masters(data reader) let's say it's unknown, the masters are keep looking for the data in 0x76.
That looks like more complicated. The deselected master will call a not answering slave. Error handling, time out handling, maybe more, needs to be concidered. Who would control the mux?
Let the sensor be the mastef sending its data to 2 slaves.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.