Boron I2C SDA/SCL

I have a question concerning the Boron SDA/SCL pins.

I currently am using the D0/D1 (SDA/SLC) pins but would like to add an additional I2C sensor.

Is there a way to use other pins for SDA/SLC communication so I would have 2 I2C sensors?

Thanks for your help.

@Athnetix, if you are trying to add another of the same sensor, does the sensor have address setting pins? Which sensor is it? Also, from the docs:

On the Argon/Boron/Xenon, D0 is the Serial Data Line (SDA) and D1 is the Serial Clock (SCL). Additionally, there is a second optional I2C interface on D2 and D3 on the Argon and Xenon only.

They are different, one is a RTC and the other is a FRAM.

Thanks for the quick reply.

@Athnetix, you can have multiple devices on a I2C bus as long as they have different I2C addresses. That’s what I2C is designed to do. The fact that your devices are different indicates that their addresses are not likely to be the same. The only time the is an issue with when you have two devices with the same address. Which RTC and FRAM are you using? Their documentation will say which addresses they use. Also, the libraries for each of these devices already have the addresses as part of their code.

2 Likes

That solved my issue…thanks

Hi peekay123,
i have a Boron connected to VL6180x sensor via D0 and D1 “SDA and SCL”, and i would like to add Adafruit MPRLS pressure sensor, so do i have to go the libraries of the MPRLS and change twoWire below to like 0x21 address?

/**************************************************************************/
/*! 
    @brief  setup and initialize communication with the hardware
    @param i2c_addr The I2C address for the sensor (default is 0x18)
    @param twoWire Optional pointer to the desired TwoWire I2C object. Defaults to &Wire
    @returns True on success, False if sensor not found
*/
/**************************************************************************/
boolean Adafruit_MPRLS::begin(uint8_t i2c_addr, TwoWire *twoWire) {
  _i2c_addr = i2c_addr;
  _i2c = twoWire;

thanks

The second parameter indicates which I2C interface to use (Wire vs. Wire1) - when omitted it defaults to Wire (as the comment states).

In order to use a device with a different address on the same interface ... let me think :thinking: ... I'd probably :thinking: ... use the i2c_addr parameter :wink:

BTW, I'm a stark (and at times nitpicky) advocate for clear and exact speech, hence ...

... strictly speaking, it's actually the other way round.
Your sensor is connected to the Boron. Without a controller the sensor would be of little use, but the Boron can happily do stuff without the sensor.
Having the hierarchy verbally reversed may also open the door for a flawed "mental image" of the setup which may end up confusing you more than it would help.

2 Likes

it is working without changing anything, excuse my knowledge as i am not a programmer,
anyway i got both sensors reading now. thank you

2 Likes