ToF vl53lx inside a tube

Hello everyone, I’m trying to use this cool sensor Vl53lx inside a tube of 2,5 m but I have a measure of 2,4. Can anyone help me? please! I’m using Arduino mega 2560 with the basic code with details. The tube has 5/8 inches. I’m using a mirror that is moving inside.

Thank you so much for your help!


Hello, JJ.

Sorry for the delayed response. The field of vision of the VL53L1X sensor is 27 degrees, so it is unclear exactly what the sensor is measuring the distance to in your system (it could be seeing a blurred response from the walls of the tube, for instance). We do not have any specific advice for using that sensor in such a configuration, but you might try to do a calibration to see if you can develop a repeatable relationship between the value the sensor returns and the distance of the target that is in the tube. Also, in general, highly reflective surfaces like mirrors can be less than ideal measurement targets for optical sensors like this. Although the surface might return a high percentage of light directly to the sensor if it is oriented correctly, you should also keep in mind that the outbound light might also be reflected off the mirror to another surface and the sensor might try to measure that other surface through the mirror.


Thanks Nathan.
Well I did some experiments, but I would like to improve trying with only 15 degrees, can you help me with this question, Can I use 15 degrees with Arduino mega 2560? Is there any code done, already?

Thank you again


The sensor IC does have a feature to limit its field-of-vision and it should be possible to use ST’s API for the sensor to access the feature. We have a port of that API to the Arduino IDE available on GitHub. Our port has not been tested with the ATmega2560 based boards and we have not tested the field-of-vision features in the API (so we don’t have any example Arduino code to use those features), but the API should be helpful for you.


1 Like

Thank you, Nathan, I’m going to do some experiments