cancel
Showing results for 
Search instead for 
Did you mean: 

Hello, I am using VL53L1X sensor. Everything is working well unless this problem : When no object is detected the sensor keeps sending random ranging values Do you have any explanation to this ? And how can I fix this problem in the firmware ?

CToun.1
Associate
 
1 ACCEPTED SOLUTION

Accepted Solutions
John E KVAM
ST Employee

After getting the range distance, or maybe even before it, get the RangeStatus. This is NOT the status that the function returns, but is a register in the sensor that tells you what the status of your number is.

Zero - is what you are hoping for. That's perfect. But there are a dozen other RangeStatus and you can either treat them as warnings and accept them. Or you can treat them as "no legitimate range" and proceed as if no valid target was within the area.

We've always struggled with what to return if the sensor did not get a good range. Generally the algorithm just gives up, sets the RangeStatus, and the distance is whatever it happened to be when the logic gave up.

So your really, really have to check the RangeStatus. It's arguably more important than the distance.

-john


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.

View solution in original post

7 REPLIES 7
John E KVAM
ST Employee

After getting the range distance, or maybe even before it, get the RangeStatus. This is NOT the status that the function returns, but is a register in the sensor that tells you what the status of your number is.

Zero - is what you are hoping for. That's perfect. But there are a dozen other RangeStatus and you can either treat them as warnings and accept them. Or you can treat them as "no legitimate range" and proceed as if no valid target was within the area.

We've always struggled with what to return if the sensor did not get a good range. Generally the algorithm just gives up, sets the RangeStatus, and the distance is whatever it happened to be when the logic gave up.

So your really, really have to check the RangeStatus. It's arguably more important than the distance.

-john


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.
CToun.1
Associate

Thank you for your response. Now I can bypass wrong values thanks to warnings reported in RangeStatus and I have reliable data.

Thank you !

I checked Range status initially it is returning 0, and after that it continuously it is sending 255 , I am using Spark fun VL53L1X sensor and i am working on 8 sensors ,it is working fine if obstacle is there between 4 meter range, if obstacle is not there it showing random values

I am checking signal status also for Big obstacle it showing Distance up to 2.1 meter(210Cm) and status is 0, and for small obstacle showing distance up to 1.2 meter(120 cm) and status is zero, it is not useful in outdoor environment , and it Hangs after some time continuously giving same result if obstacle present or not present, we are following delay as per directed by datasheet for start ranging and stop ranging

John E KVAM
ST Employee

HKulk.1 -

Probably better to open a new conversation than to add to the bottom of an existing one. You post is less likely to get lost.

The sensor can only detect an object if enough photons are returned. So a large reflective object can be seen at a longer distance than a small black one. (Color does not matter, but reflectivity matters when considering the max distance.

Try a bit of board spray painted with flat black paint. This is about 5% - a worst case. Then try cardboard. This is about 50%, a typical case, and lastly white printer paper. This is about 88% and a best case.

Choose a size of whatever you think is typical.

This is an indoor sensor. Sunlight contains a lot of 940nm light and it swamps the amazingly sensitive photon detetors.

I'm going to guess the hanging is related to electrial noise. I'd check the XShut pin. My guess is a glitch on that line or the power line caused the chip to fully or partially reboot. Try some larger caps.


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.
John E KVAM
ST Employee

I transferred this query to a new post:

https://community.st.com/s/question/0D53W00001g0GYqSAM/typical-issues-with-vl53l1x-range-and-status

That way it won't get lost again.


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.

Thanks