VL53L0X gives "wrong" reading when no object in range

Dear all,

I have got a strange problem trying to use a VL53LOX flight of time sensor for messuring the distance to an object.

My problem is that when I put the object I want to locate in the direction of the laser I get a correct reading ... but when there is no object in the direction of the sensor I get readings arround 170 mm.

This is extremly annoying as I have no way to know if there really is an object located in 170 mm distance or if there i no object at all. (In the beginning I thought that 170 mm might be the max disctance that I can meassure with this sensor but when I move an object in the beam "behind" the 170 mm I get instantly a reading of e.g. 240 mm.

Any idea what could cause this problem and how to fix it?

I want to use the laser to locate an object in a field (by rotating the laser) ... therefore I need some value that tells me that no object was in range (either 999, or Timer Overflow,... or whatever).

thanks Michael

Unfortunately you forgot to post your code, wiring, or any other useful details about your project, so not much we can do.

The datasheet I found doesn't seem to have any register map, nor any description of the returned data.

I presume there are some settings to control sensitivity, and probably some way of getting a signal strength indication too?

Is there a better document describing these details?

Pololu’s web page for their VL53L0X sensor breakout provides a number of cautions on the use of that sensor. I would not trust measurements past about 120cm.

If you need distances longer than 120cm, consider using the longer range version, VL53L1X.

OP is looking for 17-24 cm distance. That’s comfortably within range for the VL53L0X.

Ahh, didn't notice the "mm" unit.

Something is wrong: defective sensor, wiring or code. Which the OP forgot to post, of course.

Hi folks,

Sorry for responding so late .. I thought I would get email notification when there are replys to my topic and just found out today I missed the answers therefore.

The code I use is the standard example code coming with the VL32LOX library from Pololo.

The wiring is quite straight forward. GND, VCC and SCL and SCA directly wired to the Arduino UNO ports. One thing that might induce some interference is that the SCL and SCA lines are around 50 cm long and are within a bundle of lines that drive 3 stepper motors ... so there might be some issues from this side but the problem doesn't change if I add additional pull up resistors.

Two things I found out in the meantime. The maximum range for "finding" a wooden cube is quite low ... arround 25cm ... when I cover the cube with metal foil then I get readings for clearly longer distances. But even then I stay below 50cm range.

My actual workaround for the problem with the "false readings" when nothing is in range is that I am buildig a reflective wall "behind" my working area. Then the sensor allways gives valid readings for the distance to the wall and I know when I get shorter readings that there really is an object.

Nevertheless this is not truely sattisfying and only a workaround.

One other thing for you to worry about is the narrow beam, only a few degrees. You have to be REALLY in front of the sensor, and a tiny sensor like this my be hard to aim and easy to misalign.

50 cm is OK for I2C, but you best keep it away from wiring with serious current spikes, like you have with your stepper wiring. It's not likely the cause of your problems, though (it more generally just messes up communication completely).

Maybe your cube is too small to give enough reflection? I've been working with this sensor to find the distance to my hand while pointing upwards and it works quite well to detect the distance to it - 50 cm no problem. Indoors that is, as the sensor is obviously very sensitive to stray IR. It just doesn't work at all outdoors when pointing up, a bit better when pointing sideways. That was under a cloudy afternoon sky, no sunlight.

I do not dismiss problems with long I2C leads so cavalierly, especially when they are bundled with other wires. I2C was designed and intended for chip to chip communications on a single PCB.

The obvious experiment to do is to test the sensor alone, with SHORT leads to the Arduino I2C pins.