cancel
Showing results for 
Search instead for 
Did you mean: 

I am using a VL53L0x for a distance measurement. During the measurements there is an error of 10cm for long range measurements. how could i overcome this?

ARani.1
Associate II
 
16 REPLIES 16
John E KVAM
ST Employee

>>>I have tried enclosing it in a small transparent plastic container...

Push the sensor flush with the 'glass' of the container. We use the sensor behind the glass in nearly a billion cellphones, so we know that works. (Sorry for Bragging.)

You will get accurate numbers for close distances. Some of the photons will reflect off the coverglass, but they will be dwarfed by the ones from the target. At the longer distances the 'crosstalk' becomes more of an issue. We have a way to calibrate this out. Read the section of the datasheet on Crosstalk Calibration. It will fix you right up.

And you might consider the VL53L3CX or the VL53L1X. The software on the L3 is larger, but the extra range might be worth it. The L1X is more expensive, but it has a lens to further increase the range. In a large tank that might help. Also if you are looking for the surface of the water, I've had better luck with the VL53L1X.


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.
ARani.1
Associate II

I am trying out with glass container of 2mm thickness result are not consistent can u please suggest me what can be done?

ARani.1
Associate II

can u please suggest me how do i calibrate for an accurate long range.i have tried out with ur previous suggestions but the error is more than 3% of actual distance.

here is my code:

#include <Wire.h>

#include <VL53L0X.h>

VL53L0X sensor;

void setup()

{

 Serial.begin(9600);

 Wire.begin();

 sensor.setTimeout(1000);

 if (!sensor.init())

 {

  Serial.println("Failed to detect and initialize sensor!");

  while (1) {}

 }

 sensor.setSignalRateLimit(0.2);

 sensor.setVcselPulsePeriod(VL53L0X::VcselPeriodPreRange, 18);

 sensor.setVcselPulsePeriod(VL53L0X::VcselPeriodFinalRange, 14);

}

void loop()

{

 Serial.print(sensor.readRangeSingleMillimeters());

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

 Serial.println();

}

John E KVAM
ST Employee

I generally don't suggest this, but water is not easy to see.

Could you switch to the VL53L1X please? I know it's maybe a dollar more, but it has a huge advantage when seeing water.

the problem is a awful lot of photons spread out over the surface of the water, which acts like a mirror. And what you get back is a mess.

By switching to the VL53L1X you get a lens of the front of the Receive side.

Using this lens we can adjust the "Region of Interest", and by narrowing his region of interest, you can avoid the 'noise'.

All your hardware work is OK as the 2 chips have the same footprint. (actually the chip is very slightly larger in the X and Y directions, but it still fits in your layout.)

The VL53L1X is however 0.5mm taller. So your plastic housing has to change.

There is an UltraLite driver for this chip. It is simple to use and very small to integrate.

it is absolutely as straight forward as we could make anything. So even if you don't use the code, use it for reference.

the next trick you have to do is calibrate. (Even if you stay with the VL53L0X you have to calibrate to get accuracy.)

Read he datasheet on how to calibrate.

there is ST code on calibration. go to ST.com, search for the part (either VL53L0X or L1X) and download the API.

The code is there, but in the documentation is also a user manual.

it will guide you.

STSW-IMG005 - VL53L0X API (Application Programming Interface and documentation)

or

STSW-IMG007 - VL53L1X Full API (Application Programming Interface and documentation)

Even if you don't use the ST code, look at the calibration software.

the Crosstalk calibration accounts for the photons returned by your coverglass.

the offset calibration accounts for the small changes the chip goes through when you reflow it onto a PCB.

You need to do both.

  • good luck.
  • 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.
ARani.1
Associate II

Ok thanks for the suggestion

ARani.1
Associate II

Hi John,

Can you please suggest me a sensor available for measuring the 30 feet depth for a oil level measurement.

John E KVAM
ST Employee

To go 30 feet and spot something really black - like oil - you are going to need want I call a 'dot' laser. Bosch makes a good one. They even have versions that connect via bluetooth to a computer. They take a visable laser (so you don't point it at someone) and focus it to a single point. Otherwise they work the same way as do my sensors.

You can buy one at the hardware store for something line $40.

One can of course build one yourself. You can buy a laser, fit a lens on it to focus and then you are going to need a photo diode (or SPAD) to detect the incomming signal. Then buy a chip that will do all the math you need. Unfortunately ST doesn't make a part for you, but others do. ST does have a foundry business that can make the SPAD array in any configuration you want, but develping those is really expensive.

Of course that's a lot of work too.

Good luck.


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.