3x VL53L0X shows no readings For an application I need 3 VL53L0X TOF sensors. The code can be used to successfully boot the three sensors. However, only the third sensor provides a measured value. If the sensors are used individually, boot and measurement is OK.
Do sensor 1 and sensor 2 have to be activated by function
1. From the code you shared, the issue is most likely related to the XSHUT control sequence during sensor initialization.
You assign a new I2C address to each VL53L0X one by one, but when you enable the next sensor, you pull the previous one back to LOW again.
For example:
when you initialize sensor 2, you set sensor 1 XSHUT to LOW
when you initialize sensor 3, you set sensor 1 and sensor 2 XSHUT to LOW
This means the previously initialized sensors are reset again. As a result, only the last sensor remains active correctly, which matches your observation that only sensor 3 provides readings.
2. Log data shows:
12:53:53.984 -> Status of XSHUT 1 1 1 Sensor_OK 1 1 1 12:53:53.984 -> sVL53L0X: PerformSingleRangingMeasurement 12:53:54.079 -> Range Status: 0 : Range Valid 12:53:54.079 -> RANGE IGNORE THRESHOLD: 116.20 12:53:54.079 -> Measured distance: 0 12:53:54.079 -> sVL53L0X: PerformSingleRangingMeasurement 12:53:54.126 -> Range Status: 0 : Range Valid 12:53:54.126 -> RANGE IGNORE THRESHOLD: 97.00 12:53:54.126 -> Measured distance: 0 12:53:54.126 -> sVL53L0X: PerformSingleRangingMeasurement 12:53:54.173 -> Range Status: 0 : Range Valid 12:53:54.173 -> RANGE IGNORE THRESHOLD: 23.91 12:53:54.173 -> Measured distance: 111
the reason is enabling limit check with a certain threshold. you can disable it or reset a new threshold for your application.
Best Regards,
Bin FAN
In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
1. From the code you shared, the issue is most likely related to the XSHUT control sequence during sensor initialization.
You assign a new I2C address to each VL53L0X one by one, but when you enable the next sensor, you pull the previous one back to LOW again.
For example:
when you initialize sensor 2, you set sensor 1 XSHUT to LOW
when you initialize sensor 3, you set sensor 1 and sensor 2 XSHUT to LOW
This means the previously initialized sensors are reset again. As a result, only the last sensor remains active correctly, which matches your observation that only sensor 3 provides readings.
2. Log data shows:
12:53:53.984 -> Status of XSHUT 1 1 1 Sensor_OK 1 1 1 12:53:53.984 -> sVL53L0X: PerformSingleRangingMeasurement 12:53:54.079 -> Range Status: 0 : Range Valid 12:53:54.079 -> RANGE IGNORE THRESHOLD: 116.20 12:53:54.079 -> Measured distance: 0 12:53:54.079 -> sVL53L0X: PerformSingleRangingMeasurement 12:53:54.126 -> Range Status: 0 : Range Valid 12:53:54.126 -> RANGE IGNORE THRESHOLD: 97.00 12:53:54.126 -> Measured distance: 0 12:53:54.126 -> sVL53L0X: PerformSingleRangingMeasurement 12:53:54.173 -> Range Status: 0 : Range Valid 12:53:54.173 -> RANGE IGNORE THRESHOLD: 23.91 12:53:54.173 -> Measured distance: 111
the reason is enabling limit check with a certain threshold. you can disable it or reset a new threshold for your application.
Best Regards,
Bin FAN
In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.