In my project I have connected multiple sensor breakout boards to a Arduino-proMIni running at 3.3V and 8Mhz as follows on a fabricated pcb but preserving the original board layouts (so that I can connect them via traces instead of loose wires)
The hardware architecture is as follows:
To save power I am using the digital GPIO Pins to power all the breakout boards that are running on I2C with Vin = 3.3V.
The breakout boards for different sensors have pullup resistances for SDA/SCL lines (pulled up with Vin) and configured as follows:
pullup resistance and .1mm trace lengths
When I power on the board, as long as the external eeprom is ON (but no reads or writes are happening), there is no serial output for the i2c line.
When I turn off the eeprom, the i2c line only works if all others sensors are on. Turning any one or more of the sensors off, gives no serial output for the i2c line.
After researching online I realized that we need to give a dedicated Vdd line to the pullup resistances of the SDA/SCL lines instead of the Vin lines, as turning Vin off will also pull-down the i2c lines.
So I removed the pull-up resistances on all the breakout boards and added 5k pullups to the SDA/SCL pins on the MCU with the Vdd.
Even after doing this the i2c lines only work after the external eeprom is turned off.
As For the other sensors -
The RTC now works only when all other sensors are off. Switching the RTC on is most likely adding a lot of noise in the i2c output because the values changes on the serial monitor change asa it is turned on and come back to normal when turned off.
The capacitive sensor works only when the accelerometer is on.
The current odometer and the accelerometer work without any problems.
Turning the accelerometer still gives no serial output
Can someone please help me figure out why all of this is happening? Can this problem be solved by merely choosing the right pull-up resistances or is it a higher order problem? Is it possible that because I am using a 30cm wire for the Accelerometer, the entire bus capacitance is increasing, adding too much noise in the system when multiple slaves run simultaneously. And hence will it help if I shift the accelerometer on the SPI protocol and decouple it from I2C?
All sensors are running at <100Khz except the eeprom which might be running at 400Khz, because the its data sheet specifies it as the min clock rate when the input voltage is greater than 1.7V.