cancel
Showing results for 
Search instead for 
Did you mean: 

VL53L1X sensor integration and stability in indoor

Akuma.6
Associate III

Hi,

I am using the VL53L1X sensor interface on my MCU platform. I am able to get the data while there is an object. But the distance is not matching as per my object.

Less than 20cm it is able to detect, but after that it is not giving any stable values. Instead of a 50 cm object, it is showing 120cm.

I got this sensor breakout board from the online 3rd party distributor.

Could suggest where the issue is to get the constant values.

Regards,

Kumar

4 REPLIES 4
John E KVAM
ST Employee

There are lots of 3rd party distributors of this sensor. Sparkfun, Pololu, AdaFruit and many others. I (as ST support) encourage and support them all. They provide a great service as they might have the form-factor or the MCU support that ST does not. It's good for all of us.

Your problem is interesting. Most of the time the range is too short - due to the coverglass.

But too long is completely different.

So I'm going to suggest something, and you can tell me if my guess is correct.

The target area gets larger with distance. So at 1meter, the target is roughly 0.5M in diameter.

And as you move back, you need an ever larger target to cover the entire FoV.

The other thing to note is that ALL the photons returned are averaged together.

So say you are looking up and the ceiling is 1.5Meters away. And you place your 15 cm target at 20cm. You get 20cm, but the same target at 50cm will not cover the entire FoV. So you average in the 1.5M with the 50cm, and apparently get 120. Could that be it??

I take a piece of paper and fold it diagonally twice. This gives a triangle 22.5 degrees, which is close enough to the 27 degrees. Then place the point of the triangle at the sensor to get a visual idea of what the sensor 'sees'. People are always thinking of a 'dot' laser and discounting the 'overspray'.

If you have a target you want to see and cannot make it larger, you can make it brighter. Use aluminum foil or some reflective tape. The 'overspray' photons will still be averaged in, but there will be so many more from your reflective surface, it won't matter much.

  • john


Our community relies on fruitful exchanges and good quality content. You can thank and reward helpful and positive contributions by marking them as 'Accept as Solution'. When marking a solution, make sure it answers your original question or issue that you raised.

ST Employees that act as moderators have the right to accept the solution, judging by their expertise. This helps other community members identify useful discussions and refrain from raising the same question. If you notice any false behavior or abuse of the action, do not hesitate to 'Report Inappropriate Content'

Hi John,

Thanks for your response.

The below observations I found as per my testing. The supply is given to TOF sensor from Coin cell CR2477 battery.

I kept my Object (Brown Carton Box) 20cm distance from the sensor and the sensor showed 30cm, 29cm, 26cm, etc the values are not the similar pattern.

When I keep my object (Brown Carton Box) at 10cm distance from the sensor and the sensor shows 15cm, 15cm, 14cm, 15cm etc the values are similar pattern.

My object distance changed to more than 10 cm the values are giving irregular form.

I enabled the below Short distance registers for my initial testing. Are there any settings or missing to get the fine-tune values?

// SHORT RANGE

// timing config

VL53L0X_writeReg_16(0x29, 0x0060, 0x07);//RANGE_CONFIG__VCSEL_PERIOD_A

VL53L0X_writeReg_16(0x29, 0x0063, 0x05);//RANGE_CONFIG__VCSEL_PERIOD_B

VL53L0X_writeReg_16(0x29, 0x0069, 0x38);//RANGE_CONFIG__VALID_PHASE_HIGH

// dynamic config

VL53L0X_writeReg_16(0x29, 0x0078, 0x07);//SD_CONFIG__WOI_SD0

VL53L0X_writeReg_16(0x29, 0x0079, 0x05);//SD_CONFIG__WOI_SD1

VL53L0X_writeReg_16(0x29, 0x007A, 6); // SD_CONFIG__INITIAL_PHASE_SD0

VL53L0X_writeReg_16(0x29, 0x007B, 6); // SD_CONFIG__INITIAL_PHASE_SD1

Note: I integrated this sensor into BLE product. Is there any RF related impact for this TOF sensor?

Regards,

Kumar

HKulk.1
Associate II

I am using VL53L1X , code works fine when there is obstacle in the range of 0 to 4 meter ,if no obstacle above 4 meter sensor is giving random values , how we can fix this issue?

John E KVAM
ST Employee

This is a separate question - and an important one. I'm going to move it to a new query. Search for "no object".


Our community relies on fruitful exchanges and good quality content. You can thank and reward helpful and positive contributions by marking them as 'Accept as Solution'. When marking a solution, make sure it answers your original question or issue that you raised.

ST Employees that act as moderators have the right to accept the solution, judging by their expertise. This helps other community members identify useful discussions and refrain from raising the same question. If you notice any false behavior or abuse of the action, do not hesitate to 'Report Inappropriate Content'