VL53L1X Calibration


I am fighting with the offset calibration of multiple VL53L1X.
I use the API ULD.

I build a device to have 4 sensor[4] at 140mm far from a same plan. 2 of them give a good measure, 2 of them do not.

I have tried the following process to calibrate for each sensor[4] ({xx,xx,xx,xx} are the value during the debug):

sensor[i].GetDistanceInMm(&distance[i]); // distances are {115, 142, 143, 118}
uint16_t OffSetToF;
sensor[i].GetOffsetInMm(&OffSetToF); // returned values are {0, 0, 0, 0}
sensor[i].CalibrateOffset(140, &OffSetToF); //returned values are {26, 65533, 65532, 23}
sensor[i].SetOffsetInMm(OffSetToF); //with previous values {26, 65533, 65532, 23}
sensor[i].GetDistanceInMm(&distance[i]); // distances still are{115, 142, 143, 118}

Whatever the API (ST Ultra Light Driver or native ST_API), is the GetDistanceInMm function supposed to give the measure corrected of the offset value ? or am I supposed to make the correction in my program ??


Hello, Oliver.

Are you able to use all of your sensors individually (with a program that only reads one sensor) and get readings that look accurate? In our experience, you generally do not need to calibrate the sensors to get decent results. Could you also post some pictures and a wiring diagram of your setup?

We can help you troubleshoot to make sure your sensors are working properly, but if you have questions about the functionality of ST’s API, it would probably be better to contact ST about that.

- Patrick