cancel
Showing results for 
Search instead for 
Did you mean: 

I'm getting faulty data from my vl53l5cx.

LCord.1
Associate III

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

1 ACCEPTED SOLUTION

Accepted Solutions
LCord.1
Associate III

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.

View solution in original post

5 REPLIES 5
John E KVAM
ST Employee

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.


If this or any post solves your issue, please mark them as 'Accept as Solution' It really helps. And if you notice anything wrong do not hesitate to 'Report Inappropriate Content'. Someone will review it.
LCord.1
Associate III

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

LCord.1
Associate III

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

LCord.1
Associate III

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.

JKach.2
Associate

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