I read following threads, but still there are some unclear parts for me. Multiple I2C devices with the same address I2C Pull-ups with Multiple Power Supplies Design for Multiple I2C slave devices
I have two slave I2C devices (sensors) to connect to one master MCU. They are not modules on breakout boards with preset PU resistors.
The first slave I2C device is on the same power rail as MCU is. I put the other slave I2C device on another power rail due to following reasons:
- I want to make a PCB for it, so that the second sensor could be attached through a terminal connector.
Not always the second I2C will be connected (in case I don't want to use it).
To lower power consumption. I want to put MCU on power down mode. So, periodically it can turn on sensors and read their values and turn them off again and go to power down.
I was thinking to do as following schematic. But I would like to know your recommendations, if there are issues with it, or if there are better ways to do it.
simulate this circuit – Schematic created using CircuitLab
If I use this schematic, do I have to add diodes to prevent current draw from second slave sensor when it is off?
More details:
- I2C device will not be hot plugged/ how swapped.
- I have a sensor that could be used as second I2C sensor. But it does not have sleep mode. That's why I'm thinking to turn it off.
- I2C sensors and MCU are working on 3.3V.
- The first sensor is BME280 (always connected).
- Second sensor could be this one.
What do you think about adding a buffer, like PCA9306, in this schematic2?
What do you think about using I2C mux e.g. PI4MSD5V9540B? In case of using mux, I can use two sensors with same address.