cancel
Showing results for 
Search instead for 
Did you mean: 

VL53L5CX - Several sensors in parallel

PBoer.1
Associate II

I worked with a single VL53L5CX under Linux without problems. Now I wan't to have at least two sensors running in parallel connected to the same I2C bus. So I followed the documentation and first set LPn for the sensor which should keep its address (let's call it sensor 1) to low. Then I set the I2C address of the remaining sensor (sensor 2) with  vl53l5cx_set_i2c_address(). After I set LPn for sensor 1 back to high I can communicate with it. But I can't communicate with sensor 2. I added a firmware upload (init) directly after the change of the address and also added a vl53l5cx_set_resolution() and a vl53l5cx_get_resolution() but always get a zero resolution and an error value. But looking to the I2C bus with external tools shows that the I2C address was changed.

So first question is: is the function  vl53l5cx_set_i2c_address() part of the firmware. Or the other way, can the function be used without first uploading the firmware? Otherwise the steps would be, set LPn low, init firmware, change address and set LPn high again.

The I2C communication uses messages which contain the I2C address. So the ioctl used in the examples to bind the I2C address is not needed. Is this correct?

And finally, what are the correct steps and api calls to get the communication to both sensors running?

1 REPLY 1
PBoer.1
Associate II

Found it by myself. The sensor is really sensitive to changing the address. When I first set power enable to low and back again to high in order to have a powercycle everything works fine.