VL53L0X Noisy Problem In Air Garp

Hey guys,
Last month I bought Pololu VL53L0X time of flight sensor that I want to use it between 0-2 meter. The sensor is working good between 0-2 meter with pololu arduino codes but when it over range which means after 2 meter distance it gives a lot of noisy. Take an example when I hold sensor air gap (there is no object in front of sensor ) sensor output giving random distance information (in air gap like 1120 or 220 the results are no related each other or something they are random) so I couldnt stop noisy after 2 meter distance thus I have problem with sensor for using on my project. I checked sensor software register and I didnt see any register to stop this mistake or I missed somethings. Is there anything possible to fix this problem? Im waiting your answers related this subject. Please help me.
Best Regards,

Hello.

Can you tell me more about the behavior and your setup? This sensor has a 25 degree field of vision. When you remove objects from the front of the sensor, are you clearing this entire 25 degree cone? There is a visualization of this cone in Figure 23 of the datasheet.

Section 6.2 in ST’s User Manual for the sensor mentions some limit settings that sound like they might be helpful for ignoring measurements from very slight reflections.

-Nathan

Firstly thanks for answered my question nathanb. Im using vl53l0x sensor with pololu arduino software here is the link https://github.com/pololu/vl53l0x-arduino. Im using this on LONG RANGE mode which its works good between 0 to 2 meter distance its gives correct values on this range but when I hold sensor against to air gap (there is no object in front of sensor) Im getting a lot of 8190 values thats are true but Im taking wrongs values between 8190 numbers.Here is the example;
(Im holding sensor against to air gap)
8190 --------- correct value
8190 --------- correct value
8191 --------- correct value
200 --------- wrong value
8190 --------- correct value
8191 --------- correct value
8190 --------- correct value
8190 --------- correct value
1120 --------- wrong value
8190 --------- correct value
330 --------- wrong value
228 --------- wrong value
8191 --------- correct value
8190 --------- correct value

I need to ignoring or delete wrong values thats my problem. I couldnt see any register in arduino pololu code to stop this.or am I missing somethings. By the way I have to use it 0-2 meter distance otherwise this sensor wont solve my problem.I need help for this thanks.

The sensor doesn’t just see in a straight line, it sees objects in a cone in front of it that can be as wide as 25 degrees. Are you making sure that there is nothing in this cone when you expect the sensor to report nothing detected? Could you post pictures here that show your test setup including the detection area in front of the sensor?

Which of our example sketches from the GitHub library are you using? Did you change any of the default values yet?

-Nathan

Im using single sketches from GitHub library.I tried several mode (long range/high accuary/high speed) on this code.In addition I changed a lot of different value sensor.setSignalRateLimit(0.25) function to ignore slight reflections.I have still same problem.By the way Im staying at third floor and Im holding sensor out from window thats means there is no object in 25 degree cone.

here is my main sketch code.I m using it on Long Range Mode;

/* This example shows how to get single-shot range
 measurements from the VL53L0X. The sensor can optionally be
 configured with different ranging profiles, as described in
 the VL53L0X API user manual, to get better performance for
 a certain application. This code is based on the four
 "SingleRanging" examples in the VL53L0X API.
 The range readings are in units of mm. */

#include <Wire.h>
#include <VL53L0X.h>

VL53L0X sensor;


// Uncomment this line to use long range mode. This
// increases the sensitivity of the sensor and extends its
// potential range, but increases the likelihood of getting
// an inaccurate reading because of reflections from objects
// other than the intended target. It works best in dark
// conditions.

#define LONG_RANGE


// Uncomment ONE of these two lines to get
// - higher speed at the cost of lower accuracy OR
// - higher accuracy at the cost of lower speed

//#define HIGH_SPEED
//#define HIGH_ACCURACY

void setup()
{
  Serial.begin(9600);
  Wire.begin();

  sensor.init();
  sensor.setTimeout(500);

#if defined LONG_RANGE
  // lower the return signal rate limit (default is 0.25 MCPS)
  sensor.setSignalRateLimit(0.25);
  // increase laser pulse periods (defaults are 14 and 10 PCLKs)
  sensor.setVcselPulsePeriod(VL53L0X::VcselPeriodPreRange, 18);
  sensor.setVcselPulsePeriod(VL53L0X::VcselPeriodFinalRange, 14);
#endif

#if defined HIGH_SPEED
  // reduce timing budget to 20 ms (default is about 33 ms)
  sensor.setMeasurementTimingBudget(20000);
#elif defined HIGH_ACCURACY
  // increase timing budget to 200 ms
  sensor.setMeasurementTimingBudget(200000);
#endif
}

void loop()
{
  Serial.print(sensor.readRangeSingleMillimeters());
  if (sensor.timeoutOccurred()) { Serial.print(" TIMEOUT"); }

  Serial.println();
}

here is the sample results.

8191
8191
571
8190
8190
8190
8191
8190
130
8191
8190
8191
8191
8190
8190
921
8191
8191
8191
8190
8191
8191
8191
8191
8191
8190
8191
8191

Have you removed the yellow protective tape from the front of the sensor component? Have you tried both the LONG_RANGE and HIGH_ACCURACY settings at the same time? I tried one of these sensors out in my office and had better results with both of those enabled. Do you get different results in different lighting?

If those settings do not help, you might be at the limitations of the sensor and additional software filters might be your best option.

-Nathan

I did everything what you said. Its better than before but still have same problem. Im trying to filter noisy but its not succesfull or Im failing something there. Any suggestion for filter or something to stop this?

in addition can you suggest me a sensor which can be used 0 to 2 meter or more for measure distance that I need to use it for industrial ?

Experimenting with the sensor in my office, the unstable readings I get (where it alternates between a measurement and the 8190/8191 error) seem to be caused by intermittent detections of objects that seem like they would have a poor signal return in the periphery of the sensor’s field of vision. Without seeing more of your test setup, I cannot say for sure why yours is detecting objects that are not there.

We carry some sonar range finders that would work in that range, however those generally have a wider field of detection than the VL53L0X. You might look into a sensor with a narrower detection field. We do not have any experience with it, but the LIDAR-Lite V3 might be worth looking into.

-Nathan

I suggest using a median filter. It should get rid of the noisy values. With the data you are showing, a window of size 3 should be OK although size 5 would be better if you ever get two consecutive noisy values.

I tried the median filter 4 since i was experiencing the same noise issue but it did not eliminate the noise 100%. I wish i had seen this post earlier so that i would have tried size 5 first. I’ll do that soon but i’m currently comfortable enough.

1 Like

Is there some progress? I have a similar problem.
I have imported Arduino source and libraries into Atmel Studio 7.
Including Pololu library vl53l0x and QTR-xRC.
When I use only vl53l0x.readRangeContinuousMillimeters() results seems ok and stable.
While I use QTR-RC.read(sensor_values) in same main loop, results of vl53l0x are buggy. While is no obstacle before sesors, random numbers are returned.
Thank you.

Could you post some simple code that illustrates the problem and some sample results here?

-Nathan

It was about size of holes for vl53l0x sensor. Before I made design, I checked instructions for vl53l0x housing and I made tests in how big angle vl53 meassure, sure it was under 25 degrees.
MEAWHILE I MADE HOLES BIGGER AND IT SEEMS WORKS.
Thank you.
JAN

2 Likes

Hello, Jan.

I am glad to hear you got it working. Thanks for letting us know how you solved the issue.

-Nathan

This topic came back today and I noticed there had been multiple clicks on the link I posted earlier about median filter.

For those who would like to use a median filter with this sensor or with other signals, I suggest using the daPhoosa/MedianFilter library. I use it with other sensors and find it very simple to use yet flexible and efficient. The GitHub repository README also provides clear instructions on how to use it.

hi Nathan, how field of view can affect the measurement of the VL53LOX sensor?

Hello, Asif.

Your question is not very specific so I am not sure if this is the answer you are looking for, but in general, if there are surfaces at different distances from the sensor in its field of vision that return light, it will not be obvious what surface the sensor is measuring the distance to.

-Nathan

Hello Nathan,

I am using GY-53 sensors and they have 12 pins. I am using them via PWM pins. The problem is when I am using them I face 5mms errors. But the thing is not that. The thing is when I am trying to measure the distances from different surfaces and colors it is not showing the same distance and I mean like 15mms differences. Is there any way to avoid that? Is there any difference to use the sensors from PWM pins or SCL SDA pins?

Hello.

We do not make the GY-53 sensor, so we cannot offer much assistance with that.

In general, the repeatability of measurements form the VL53L0X is affected by various aspects of each application, including characteristics of the target surface. The VL53L0X datasheet (which is available on our carrier’s product page under the “Resources” tab) gives some idea of what you can expect from it in the “Performance” sections, and depending on your application, you might be able to improve results by adjusting the ranging operating modes discussed in the “Functional description”. However, I am not sure how your GY-53 board processes the readings from the VL53L0X, and I am not sure if it makes the adjustable settings on the VL53L0X accessible. You might try contacting your board’s manufacturer for information about that.

- Patrick

Thanks @PatrickM. It is not working according to datasheet but you are right I will be asking the manufacturer. There is another question though. What if I use three VL53L0X sensors for X-Y-Z axes will they have interference? Does one sensor cause noise on the other one? You can think that these questions are for your product if it is ok then I will buy the sensors from you. And again in the documentation they have measurements for grey and white surfaces but not any info for surfaces that have more or less reflect -not colour- properties. I really appreciated that you answered my first question even though it is not your product.

Thanks