Two sen-18993 distance sensors on the same qwiic bus

I would like to use two SEN-18993 distance sensors with one Redboard using the qwiic bus. I am new to I2C.

What do I need to do in the Arduino code to identify each sensor?

Thanks,

Ted

You’ll need to edit the code to assign a non-default i2c address for one of the sensors…use this line:

.set_i2c_address(new_address)

This function sets the sensor I2C address used in case multiple devices application, default address 0x29 (0x52 >> 1).

Input: Value

I2C address to change device to.

from our hookup guide https://learn.sparkfun.com/tutorials/qw … -guide/all

I would advise hooking up one sensor, getting an alternate address to function properly, and then add in the 2nd sensor with the default address (add/edit lines of code too!)…just remember to cut the “i2c” traces for one of the sensors (only one set of pull up resistors per i2c bus should be used, see section of the guide under ‘hardware overview’) and you should be good to go!

Thanks, I will give that a try.

BTW, will the new address be retained by the sensor module? Or, will I have to plug them in one at a time every time I reset the Redboard?

I used “.setI2CAddress” to change the sensor’s address to 0x53 in my Arduino code but when I upload a different program the address is back to the default value, 0x52.

Once the address of a sensor is changed, how do I get readings from the two different sensors?

Do I create two separate instances of the SFEVL53L1X class?

How do I know which instance is assigned to the two different sensors?

Thanks,

Ted.

Do we know when Sparkfun will have an I2C MUX available, such as the BOB-16784?

You’d set up two separately named i2c variables - check online for examples (‘using 2 i2c on one bus’ or similar)

No estimate of restock right now, but when the IC becomes available to us we’ll make more - sign up to be notified of when that is here https://www.sparkfun.com/products/16784