2025-11-12 11:00 PM - last edited on 2025-11-13 12:00 PM by Peter BENSCH
We have TOF data collected every half hour, but we are surprised by the results, as the TOF data is not consistent each time.
2025-11-18 1:28 AM
Hello
Can you please let us know with Hardware and which SW package you are using ?
2025-11-19 8:38 AM
Vraj -
Because the ToF uses a laser people expect mm accuracy. Unfortunately this is a still a sub 10 dollar part - maybe a little more, but it's still amazingly inexpensive.
Because the sensor is so inexpensive, and low power, the clock speed is not all that high, and the speed of light is really fast. So the sensor has to use statistics. And some variability is expected.
Have a look at the datasheet. It will tell you the expected results.
But I'm guessing that if you only take a measurement once every half hour, it's temperature that is getting you.
As the temperature changes, the sensor adjusts, but only about 2 degrees C per range. But on a fall day, the temp can change more that that in a half hour.
So you can stop the sensor and go through the init procedure again, then take a measurement. But I suspect that if you just took 3 measurements keeping the last one, you would do better.
You did not say which sensor you have. Choices are VL53L0, L1, L1X, L3, L4CD, L4CX, L5, L7 or L8 so it's hard to tell you more.
Try taking 3 measurement when you want a range and compare that to your expected outcome. Should be better.
But you are still going to vary by a few mm either way.
- john
2025-11-25 11:25 PM
Hi John,
2025-11-29 9:00 AM
I'm impressed. Cool idea.
So lets talk accuracy. Generally the sensor claims +/- 3%, but below 10 or 15 cm, that breaks down and you get something like +/- 5mm. Do check the datasheet.
But you are seeing something more than that.
So by giving a quick glance at your code I see that you are NOT setting a timing budget or Inter-measurement period.
that means the sensors are emitting continuously, and although the sensors done generally interfere with each other there are limits, and you found them. With 4 sensors emitting inside a box, that box is too full of light.
So this is what I think you can do...
Start one up, take 3 measurements, then shut it down. Evaluate the results. I'm thinking the last range will be best, but an average of the last two might be better. You can either shut it down by dropping the XShut line (which requires a re-init) or you can issue the stop command, which will retain all your setting and just re-issue the start when you want to go again.
then repeat for the other sensors.
By NOT interfering with each other, you will do better.
Consider changing the timing budget to something like 100ms if you can afford the power and time.
That will give you the best shot at a great answer.