2025-07-10 8:07 AM
I am currently using a VL53L1X Sensor to read a distance in the range of 40cm to 130cm.
I initialized the Sensor to work in the short distance mode, so the range should not be a problem.
I used the VL53L1X_calibration library to get the values for offset and xtalk.
In the Datasheet i read that with the function VL53L1X_GetDistance() the distance should be returned in mm.
The value i get returned from that function does change when i change the physically measured distance, but it is not the expected value. For example when i want to measure a distance of 1m i get a value of about 55500.
Also the measurement change on the same height in a range of 1000.
For the offset and xtalk calibration i set the physical distance to 1m and gave that as a parameter in the function as 1000(mm).
I copied the values i got from the function to the function setoffset and setxtalk.
To calibrate i used the following diagramm:
And my init in my software looks like this:
I dont really understand why my measurements are this far off, have i maybe missed something in the calibration or init? Or are there other possible faults i have made?