The VL53L0X sensors are giving very unstable and inaccurate readings, even when the distance to the object is fixed.
Troubleshooting I've Done:
Current Hypothesis:
Questions:
Any help or direction would be appreciated!
Thanks in advance.
- For example, when I place a solid object exactly 10 cm from the sensor, the readings fluctuate heavily, sometimes giving 50 mm, other times 100 mm, even though the object is not moving at all.
- This inconsistency is happening across almost all sensors, especially on the right side.
Troubleshooting I've Done:
- Tried using offsets
I read each sensor at 10 cm and saved that value as an offset in EEPROM. Then I subtracted it from each reading to get a "corrected" value. Still, the readings vary wildly, so the offset has little to no effect. - Tried a custom calibration method
I manually recorded real distances and the corresponding raw sensor values, then used a formula like:
corrected = (raw - offset) * (real_distance / raw_value)
But due to the randomness of readings, the formula fails to stabilize the result. - Tried adjusting the timing budget and inter-measurement period
I increased the timing budget and tried various values, but didn't notice any significant improvement. - Tested with fewer sensors
I isolated 1 or 2 sensors and powered them directly, but the fluctuation still exists.
Current Hypothesis:
- It might be power-related, especially if all sensors are active at the same time.
- Could also be interference or cross-talk due to the sensors being close together and facing similar directions.
- Or maybe it's related to the use of shift registers affecting sensor power-up or I2C stability.
Questions:
- Has anyone experienced this kind of instability with VL53L0X sensors?
- Is there a way to filter out noisy data (median filtering, moving average, etc.) that's known to work well with these sensors?
- Is there any hardware-level solution to reduce cross-talk or interference?
- Would using VL53L1X or another sensor improve stability?
Any help or direction would be appreciated!
Thanks in advance.