2021-10-18 06:10 AM
Most of the target status seem to return 5 but some do return 255.
The data is correct on all 64pixels when I have a near object (200mm) but it cannot detect further objects like the ceiling and instead it will return a seemingly random small distance that keeps constant and fluctuates a bit arboud its value.
I'm on the esp32 with other I2C devices on the bus.
Thanks in advance
Edit: It does not seem to be working for distances over 255mm
Lucoreds
Solved! Go to Solution.
2021-11-01 04:44 AM
The fix is easy. It just get Distance returns only one byte I've doubled it to 16bits and it is working nice now with the standart 4kiB of temporary buffer.
2021-10-20 08:04 AM
I'm going to guess that you have a coverglass and the system is not properly calibrated.
5 is 'good range', 255 is what you get when there is no target near enough to be seen.
If you are not getting a ceiling at a couple of meters, then something is preventing the photons from getting out or getting back in. (Which is why I'm guessing a bad coverglass.)
A seemingly random small distance is a 'ghost image' that you see when sensor detects the coverglass as a legit target.
Proper crosstalk calibration is a must in this case.
Point the sensor so that nothing is in the field of view for a good meter plus.
Then call the calibration function.
It will register all the photons returned as crosstalk, and will subtract this amount from every range.
No more ghost images.
But if you are not seeing a ceiling at 2M, you might want to check your glass quality. It should do better.
https://community.st.com/s/article/Time-of-Flight-Cover-glass
is a good place to start.
2021-10-21 03:47 AM
Thanks John for you answer.
I have the Satel vl53l5cx breakoutboard without any protective glass.
I just think that it is odd that it can only output distances under 255mm (2^8-1) perfectly fine but nothing that is further away. 255 is the highest value it seems to be outputting.
Seems to be a software fault to me.
Thanks anyway and thanks for the tip, I will check the crosstalk.
And Thanks for the satus clarification it does not seem to be listed in the datasheet anywhere.
Lucordes
2021-10-26 02:19 AM
I really cannot get it to work properly and I'm at a loss. It would be nice if somecould link me their arduino code, and if the library of the vl53l5cx was modified, point out the modifications. Thank you very much in addance.
LCord
2021-11-01 04:44 AM
The fix is easy. It just get Distance returns only one byte I've doubled it to 16bits and it is working nice now with the standart 4kiB of temporary buffer.
2023-01-06 03:38 PM
Hi,
Can you explain the fix properly @LCord.1 . I didn't quite get where to change the distance byte size. Is it inside the SparkFun_VL53L5CX_Library or just need to add few lines in Arduino code.
A screenshot or code snippet that showcases the change, is much appreciated.
Regards and Stay Safe