VL53L0X Tolerances

Hello,

I am building a measuring machine for ceramic abrasive pads and I chose to use the VL530X board. I 3D printed a testing mount for the sensor with the face of the laser module aprox. 1.244"-1.334" (31mm-33mm ish) from the face of the ceramic disc depending on if its lined up with a groove or not. Its hooked up to an arduino mega and running the adafruit example code that just displays the distance in mm to serial port monitor. But it seams like the sensor isn't able to pick up the grove as I spin the abrasive pad under the sensor. In fact the with the disk stationary the distance values are jumping up and down between 38-41mm, which isn't even close the intended distance of 31-33mm, though this could be do to inaccuracy of the 3d print. That aside is the VL53L0X not capable of this? I know I'm asking a lot of this board and wanting it to perform at reasonably tight tolerances given the boards specs. But I thought I could find a work around knowing that the grooves are evenly spaced and taking multiple measurements around the disk. I even aligned the sensor at the same angle as the groves to maximize the surface area of the grove it is measuring.

Should I be using something else?

or is the 3d print possibly messing with the readings cause the laser is shooting down a tight channel?

also why is the measurements so jumpy? I thought it might jump hear or there but with a stationary disk but I thought it would at least be somewhat consistent in the distance measurement even if it was off by a mm or two.

In the end the measuring machine will be filled with 30-50 abrasive disks where they will be pushed out one by one and then rotated using a geared motor with encoder, then as it spins it needs to find the location of the grooves so it can spin the disks to locate the large pads under an electronic dial indicator where it will take thickness measurements and using a data cable and excel figure out if the disk is in tolerance then repeat.

Bellow I'll attach pictures of my testing setup as well as screen shots of the 3d model so you can see how I printed the fixture.

Is there a better board to use?

Thanks!

#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(200);
}




I've not used the VL530X, however I noticed the opening for the beam is on the small side. I would hang the sensor off the edge of the pedestal with plenty of clearance and retest.

i gave that a try and it still seems to jump all over. Though the distance hasn't changed now its reading between 43-47mm. I don't see why the the distance range wouldn't be the same?
do shadows play a role? I even increased the time in between measurements to make sure I'm not fooling myself with too many numbers scrolling by, but the same thing occurs. Though the sensor can read the slightest shift in angle. just seems to be a little weird to me. I must be doing something wrong, cause ive tried multiple different surfaces and still get a 4-6mm swing in readings which is quite large.

I wonder if there is an optimal distance it should be mounted at, as if its calibrated or something. but i would assume closer is better to a point.

I took a quick look at the VL53L0x spec and they talked about a 200 ms measurement. Also I don't recall the distances but they talked about different error at different differences. You might want to take a look.

so I took another look at the spec sheet from digikey. I saw 200ms as well as it looks to be more accurate at closer ranges like 25mm-50mm kind of like I thought.

But 200ms mean i should get the most accurate readings if I space the timing of each reading by 200ms? or am I not understanding this right?

I just quickly spaced the timing to 200ms and it seems as if the deviation of the readings is still 40-44mm but I was able to get it to jump up to 45-48mm when i lined up to a groove. So it might be possible to use this as is.

Still I was hoping for a bit more of a tighter range about 2mm rather than 4mm.
obviously I want better than 2 but I realize I'm asking a lot of a cheap board I ordered on amazon.

I wonder if I can pay a little more for a board with tighter tolerance?

I'll link the one i ordered below:

Hi,
Have you tried it with a different coloured material?
Like flat black.
Without the disc fitted in the jig?

Can you please post your code?
Can you please post a circuit diagram?
How are you powering your project?

Thanks for the clear pictures.

Tom... :grinning::+1: :coffee: :australia:

I don't believe a the board has anything to do with accuracy. This board is basically just a breakout for the VL53L0X sensor. If you google "VL53L0X" you will be able to read the device specification.

I went on digikey and read the sensors specifications and I still feel like it should perform slightly better than it is. I've tried it on multiple different colored surfaces, flat black, flat, white, grey, blue etc. I've also used it on different surfaces types live a mate blue rubber phone case, a black apple box as well as white, on the blue petg print, as well as on the disk. Though the white and black surfaces performed the best they still vary 4mm. Could there not be something on the board that could cause feedback or interference with the reading.

All of this testing was done with the board mounted off the side of the stand so that the small channel wouldn't play a roll in the readings. I'll take a photo of how its currently set up as well as post code and diagrams.

I have add the code as well as a "diagram" to the main post.

Sorry for the poor diagram, I had to do it in paint as I'm working on an old work computer and can't be downloading things to it randomly.

The code is an example code I installed while following a tutorial (tools>Manage Libraries>Search VL53X>install Adafruit_VL53L0X)

The only change I made to the code was changing the delay from 100 to 200

Here is a photo of how the sensor is currently mounted to ensure it is rigid and not moving while making sure the narrow channel isn't playing a role in the deviation of the reading.

The arduino is running of power it is getting from my computer via the usb