2024-11-18 01:00 AM
I hope someone can help me with the accuracy of my VL53L1 sensor. I can’t get the sensor working accurately above 40cm.
I am working on a hobby project and want to use the sensor to avoid obstacles.
The board I use is not an VL53L1-SATEL. It’s from an other manufacturer. I tried different api’s. The most recent full api and the ULD from ST. I even tried the Adafruit api for this sensor. All the api’s are producing more or less the same results.
Is there something I could test to figure out what’s going on?
2024-11-20 10:45 PM
Hi John,
@7:20 AM European time
VL53L1_DISTANCEMODE_SHORT
Distance: 1233 Status: (2) Signal Fail SignalRateRtnMegaCps: 0.19 SigmaMilliMeter: 4.75 AmbientRateRtnMegaCps: 0.06
Distance: 1228 Status: (2) Signal Fail SignalRateRtnMegaCps: 0.21 SigmaMilliMeter: 4.50 AmbientRateRtnMegaCps: 0.05
Distance: 1222 Status: (2) Signal Fail SignalRateRtnMegaCps: 0.20 SigmaMilliMeter: 4.75 AmbientRateRtnMegaCps: 0.06
Distance: 1234 Status: (2) Signal Fail SignalRateRtnMegaCps: 0.20 SigmaMilliMeter: 4.75 AmbientRateRtnMegaCps: 0.06
Distance: 1223 Status: (2) Signal Fail SignalRateRtnMegaCps: 0.21 SigmaMilliMeter: 4.50 AmbientRateRtnMegaCps: 0.05
Distance: 1213 Status: (2) Signal Fail SignalRateRtnMegaCps: 0.20 SigmaMilliMeter: 5.00 AmbientRateRtnMegaCps: 0.06
Distance: 1224 Status: (2) Signal Fail SignalRateRtnMegaCps: 0.18 SigmaMilliMeter: 5.25 AmbientRateRtnMegaCps: 0.06
Distance: 1220 Status: (2) Signal Fail SignalRateRtnMegaCps: 0.20 SigmaMilliMeter: 4.75 AmbientRateRtnMegaCps: 0.06
Distance: 1209 Status: (2) Signal Fail SignalRateRtnMegaCps: 0.23 SigmaMilliMeter: 4.25 AmbientRateRtnMegaCps: 0.05
Distance: 1225 Status: (2) Signal Fail SignalRateRtnMegaCps: 0.22 SigmaMilliMeter: 4.50 AmbientRateRtnMegaCps: 0.05
Distance: 1222 Status: (2) Signal Fail SignalRateRtnMegaCps: 0.21 SigmaMilliMeter: 4.50 AmbientRateRtnMegaCps: 0.05
Distance: 1225 Status: (2) Signal Fail SignalRateRtnMegaCps: 0.20 SigmaMilliMeter: 4.75 AmbientRateRtnMegaCps: 0.05
Distance: 1226 Status: (2) Signal Fail SignalRateRtnMegaCps: 0.20 SigmaMilliMeter: 5.00 AmbientRateRtnMegaCps: 0.06
Distance: 1225 Status: (2) Signal Fail SignalRateRtnMegaCps: 0.22 SigmaMilliMeter: 4.50 AmbientRateRtnMegaCps: 0.05
VL53L1_DISTANCEMODE_MEDIUM
Distance: 1229 Status: (2) Signal Fail SignalRateRtnMegaCps: 0.21 SigmaMilliMeter: 4.50 AmbientRateRtnMegaCps: 0.05
Distance: 0 Status: (4) Phase Fail SignalRateRtnMegaCps: 0.21 SigmaMilliMeter: 5.50 AmbientRateRtnMegaCps: 0.05
Distance: 0 Status: (4) Phase Fail SignalRateRtnMegaCps: 0.19 SigmaMilliMeter: 6.25 AmbientRateRtnMegaCps: 0.06
Distance: 0 Status: (4) Phase Fail SignalRateRtnMegaCps: 0.20 SigmaMilliMeter: 6.00 AmbientRateRtnMegaCps: 0.06
Distance: 0 Status: (4) Phase Fail SignalRateRtnMegaCps: 0.21 SigmaMilliMeter: 5.50 AmbientRateRtnMegaCps: 0.05
Distance: 0 Status: (4) Phase Fail SignalRateRtnMegaCps: 0.24 SigmaMilliMeter: 5.00 AmbientRateRtnMegaCps: 0.05
Distance: 0 Status: (4) Phase Fail SignalRateRtnMegaCps: 0.22 SigmaMilliMeter: 5.50 AmbientRateRtnMegaCps: 0.05
Distance: 0 Status: (4) Phase Fail SignalRateRtnMegaCps: 0.23 SigmaMilliMeter: 5.25 AmbientRateRtnMegaCps: 0.05
Distance: 0 Status: (4) Phase Fail SignalRateRtnMegaCps: 0.20 SigmaMilliMeter: 5.75 AmbientRateRtnMegaCps: 0.05
Distance: 0 Status: (4) Phase Fail SignalRateRtnMegaCps: 0.21 SigmaMilliMeter: 5.75 AmbientRateRtnMegaCps: 0.06
Distance: 0 Status: (4) Phase Fail SignalRateRtnMegaCps: 0.22 SigmaMilliMeter: 5.50 AmbientRateRtnMegaCps: 0.05
Distance: 0 Status: (4) Phase Fail SignalRateRtnMegaCps: 0.20 SigmaMilliMeter: 5.75 AmbientRateRtnMegaCps: 0.05
Distance: 0 Status: (4) Phase Fail SignalRateRtnMegaCps: 0.20 SigmaMilliMeter: 6.00 AmbientRateRtnMegaCps: 0.06
Distance: 0 Status: (4) Phase Fail SignalRateRtnMegaCps: 0.23 SigmaMilliMeter: 5.25 AmbientRateRtnMegaCps: 0.05
Distance: 0 Status: (4) Phase Fail SignalRateRtnMegaCps: 0.23 SigmaMilliMeter: 5.25 AmbientRateRtnMegaCps: 0.05
VL53L1_DISTANCEMODE_LONG
Distance: 0 Status: (4) Phase Fail SignalRateRtnMegaCps: 0.21 SigmaMilliMeter: 5.50 AmbientRateRtnMegaCps: 0.05
Distance: 0 Status: (4) Phase Fail SignalRateRtnMegaCps: 0.21 SigmaMilliMeter: 6.50 AmbientRateRtnMegaCps: 0.05
Distance: 0 Status: (4) Phase Fail SignalRateRtnMegaCps: 0.21 SigmaMilliMeter: 6.25 AmbientRateRtnMegaCps: 0.05
Distance: 0 Status: (4) Phase Fail SignalRateRtnMegaCps: 0.19 SigmaMilliMeter: 7.25 AmbientRateRtnMegaCps: 0.06
Distance: 0 Status: (4) Phase Fail SignalRateRtnMegaCps: 0.23 SigmaMilliMeter: 6.00 AmbientRateRtnMegaCps: 0.05
Distance: 0 Status: (4) Phase Fail SignalRateRtnMegaCps: 0.23 SigmaMilliMeter: 6.00 AmbientRateRtnMegaCps: 0.05
Distance: 0 Status: (4) Phase Fail SignalRateRtnMegaCps: 0.20 SigmaMilliMeter: 6.75 AmbientRateRtnMegaCps: 0.05
Distance: 0 Status: (4) Phase Fail SignalRateRtnMegaCps: 0.20 SigmaMilliMeter: 6.50 AmbientRateRtnMegaCps: 0.05
Distance: 0 Status: (4) Phase Fail SignalRateRtnMegaCps: 0.22 SigmaMilliMeter: 6.25 AmbientRateRtnMegaCps: 0.05
Distance: 0 Status: (4) Phase Fail SignalRateRtnMegaCps: 0.23 SigmaMilliMeter: 6.00 AmbientRateRtnMegaCps: 0.05
Distance: 1132 Status: (2) Signal Fail SignalRateRtnMegaCps: 0.23 SigmaMilliMeter: 6.00 AmbientRateRtnMegaCps: 0.05
Distance: 0 Status: (4) Phase Fail SignalRateRtnMegaCps: 0.23 SigmaMilliMeter: 6.00 AmbientRateRtnMegaCps: 0.05
Distance: 0 Status: (4) Phase Fail SignalRateRtnMegaCps: 0.26 SigmaMilliMeter: 5.50 AmbientRateRtnMegaCps: 0.05
Distance: 0 Status: (4) Phase Fail SignalRateRtnMegaCps: 0.23 SigmaMilliMeter: 6.00 AmbientRateRtnMegaCps: 0.05
Distance: 0 Status: (4) Phase Fail SignalRateRtnMegaCps: 0.20 SigmaMilliMeter: 6.50 AmbientRateRtnMegaCps: 0.05
Distance: 1035 Status: (2) Signal Fail SignalRateRtnMegaCps: 0.20 SigmaMilliMeter: 6.50 AmbientRateRtnMegaCps: 0.05
At least the ambient value is smaller than the signal value
Sometimes I get the following error:
Distance: -1185 Status: (5) Hardware Fail
Disconnecting the USB cable doesn't help.
Disconnecting the power to the sensor while the MCU is running solves the problem.
This is a snippet of the init code:
ret = VL53L1_WaitDeviceBooted(Dev);
if (ret != ESP_OK) {
ESP_LOGE(TAG, "%s",esp_err_to_name(ret));
return ret;
}
ret = VL53L1_DataInit(Dev);
if (ret != ESP_OK) {
ESP_LOGE(TAG, "%s",esp_err_to_name(ret));
return ret;
}
ret = VL53L1_StaticInit(Dev);
if (ret != ESP_OK) {
ESP_LOGE(TAG, "%s",esp_err_to_name(ret));
return ret;
}
I have never had this problem before with the vl53l0x.
2024-11-29 02:08 AM
I call it quits. Whatever I try. The sensor will not give an accurate reading beyond 40cm. I guess that the sensor is faulty or maybe a Chinese clone.
John, thank you so much for your time en information. I will order the development board and see how that will work out for me.