I am trying to interface bme280 & tsl2561 together with Pi Zero. I have connected bme280 to Pi Zero on Pin 3-I2C.1 SDA & Pin 5-I2C.1 SCL and was able to read the data over i2c. Also want to add tsl2561 to read LUX. Can I use Pin 27-I2C.0 SDA & Pin 28-I2C.0 SCL for tsl2561

Is it possible ?

  • What is a bmc280? If the devices use different I2C addresses that should be possible. – Dirk Dec 16 '18 at 0:16
  • updated my question – roy Jan 18 '19 at 2:36

More than one device can be used on a Pi I2C bus provided that:

  1. They can be configured to have different I2C addresses.
  2. They can operate with a 3V3 bus.
  3. They do not have their own I2C pull-ups to more than 3V3 (ideally they should have no pull-ups at all).
  4. They use 8-bit I2C addresses (the normal case, you rarely see 10-bit address devices).

If your devices do not meet any of 1-3 you could connect them via a bus multiplexer e.g. a PCA9547.

If your devices do not meet 1 you could create a software I2C bus on any pair of spare GPIO and transfer the clashing device to that bus. See /boot/overlays/README for details. You would need to add your own pull-up resistors to 3V3 on the GPIO you use. For reference the Pi uses 1k8 resistors on the hardware I2C bus on SDA and SCL. You might get away with enabling the internal 50k pull-ups on the GPIO for testing purposes.

|improve this answer|||||

Not the answer you're looking for? Browse other questions tagged or ask your own question.