Hi all,
I've been testing the VL53L0X on a test bench that I 3D printed.
I'm getting these readings when the sensor is situated approximately 5 centimeters away from the target:
Reading a measurement... Distance (mm): 85
Reading a measurement... Distance (mm): 85
Reading a measurement... Distance (mm): 84
Reading a measurement... Distance (mm): 86
Reading a measurement... Distance (mm): 83
I'm just using the example code from Adafruit:
#include "Adafruit_VL53L0X.h"
Adafruit_VL53L0X lox = Adafruit_VL53L0X();
void setup() {
Serial.begin(115200);
// wait until serial port opens for native USB devices
while (! Serial) {
delay(1);
}
Serial.println("Adafruit VL53L0X test");
if (!lox.begin()) {
Serial.println(F("Failed to boot VL53L0X"));
while(1);
}
// power
Serial.println(F("VL53L0X API Simple Ranging example\n\n"));
}
void loop() {
VL53L0X_RangingMeasurementData_t measure;
Serial.print("Reading a measurement... ");
lox.rangingTest(&measure, false); // pass in 'true' to get debug data printout!
if (measure.RangeStatus != 4) { // phase failures have incorrect data
Serial.print("Distance (mm): "); Serial.println(measure.RangeMilliMeter);
} else {
Serial.println(" out of range ");
}
delay(100);
}
Are the readings that I am getting normal for the sensor? If so, what are some other ranging sensors with better accuracy? If not, what can I do to make the sensor more accurate?