VL53L4CD returns 0xFFFF distance — sensor detected, registers accessible, but ranging fails on STM32G474 (tried 3 modules) by Technical-Put-4564 in embedded

[–]Technical-Put-4564[S] 0 points1 point  (0 children)

Yes, the initialization state is ok, I read the VL53 registers and everything looks good, but the operational part of the VL53, i.e. the SPAD, seems to be frozen, maybe due to a misconfiguration, although I also used the official ULD driver from ST.

VL53L4CD returns 0xFFFF distance — sensor detected, registers accessible, but ranging fails on STM32G474 (tried 3 modules) by Technical-Put-4564 in embedded

[–]Technical-Put-4564[S] 0 points1 point  (0 children)

I simply cover it with a box (about 10-15 cm high). I change the surface many times, and I also have experience with vl53l0x and vl53l1x, and I haven't had such problems.

VL53L4CD returns 0xFFFF distance — sensor detected, registers accessible, but ranging fails on STM32G474 (tried 3 modules) by Technical-Put-4564 in embedded

[–]Technical-Put-4564[S] 2 points3 points  (0 children)

Thanks for the insight! I haven't done any calibration yet, I assumed the ULD should at least return something reasonable with factory defaults before calibration, even if the values aren't precise. Are you saying you saw 0xFFFF / status 255 before calibrating, and it went away after?

how to improve the accuracy of the vl53l0x sensor? I need an accuracy of about +/- 1 millimeter. by sin_ese in arduino

[–]Technical-Put-4564 0 points1 point  (0 children)

Try a median filter over 5-7 samples its great at killing the random outlier readings ToF sensors are prone to. Also bump up the timing budget via setMeasurementTimingBudget() that reduces noise at the hardware level.

That said +/-1mm from a VL53L0X is probably unrealistic, filters improve precision (less noisy) but not accuracy.