VL53L1X spurious readings when nothing is in range
I have an application where I run the VL53L1X in lite ranging mode and short distance mode with a timing budget of 10 ms (100 Hz) as described in AN5263.
I recently noticed that on at least one unit (and probably more) the VL53L1X reports a spurious distance reading of 0 mm with no errors even though the sensor is pointing into an empty space and there are no objects within the 1.3 meter range of short distance mode. This spurious reading happens about 10 times per minute, and the rest of the readings are regular expected errors.
I am not using the API (STSW-007) directly, but have implemented code that does the equivalent thing.
Here are some VL53L1X register values from these spurious readings:
- The lower 5 bits of the VL53L1X result__range_status register (0x89) is always 9. That corresponds to VL53L1_DEVICEERROR_RANGECOMPLETE and that is the value that the API maps to 0.
- The result__stream_count register (0x8B) is between approximately 130 and 250.
- The result__final_crosstalk_corrected_range_mm_sd0 register (0x96:0x97) is always 0.
- The result__dss_actual_effective_spads_sd0 register (0x8C:0x8D) is always 53992, which means 210.9 spads.
- The result__peak_signal_count_rate_crosstalk_corrected_mcps_sd0 register (0x98:0x99) is between 200 and 450.
- The result__ambient_count_rate_mcps_sd0 register register is between 1000 and 1300.
Is it expected behavior for the VL53L1X to report a range_status of 9 and non-zero stream_count alongside an erroneous range? Is there some additional error checking that I must do before trusting the range besides checking those two registers? For example, maybe I need to filter out readings with low ranges and high SPAD counts.
If I change the timing budget to 20 ms, the problem seems to go away.
In case it helps, the identification_revision_id (0x111) register is 16 and ranging_core__revision_id (0x681:0x682) is 0.
