2024-06-18 09:19 PM - last edited on 2024-06-19 03:07 AM by Peter BENSCH
Hi,
I was doing a distance test on the VL53L4CX sensor using ESP32 and the ST example codes on Arduino. I'm getting inconsistent offset errors across the range. The setup is a brine tank with salt inside it. Any ideas on this?
Thank you.
2024-06-20 09:36 AM
When looking at water (briny or not) you have a problem with light penetrating the liquid, being slowed down, hitting the bottom of the tank and reflecting. If the liquid is deeper than about 15 cm, or if you paint the bottom with a non-reflective coating, this effect goes away.
Could you run the experiment again putting more than 15cm of water in the bucket?
Looking at your data, I'm going to guess you added some liquid to a bucket, then lifted your sensor and took measurement. So, the bottom might have an 'offset' effect. Both sensors over-range by about the same amount (except at 600 - that data point is an outlier.
I going to guess that maybe you did NOT do an offset calibration before you started. That might account for all your numbers being low.
Try doing an offest cal on your sensors - see what it tells you. If you get 20mm of offset, I'd say the numbers looks as good as they can. (Just update your data by the offset amount and have another look.)
I'm not sure I can explain the data point at 600 though. Experimental error.
Try it again with a deeper pool of water, and doing the calibration. Then we can re-visit the numbers.
- john
2024-06-25 07:54 AM
2024-06-25 08:27 AM
there are lots of reasons to under-range. Coverglass being the main culprit. But OVER-ranging - especially by this much is a completely new one on me. Is it possible that you are using crosstalk correction but have removed the coverglass? It's really all I can think of. Or somehow you did the offset correction and got the sign wrong direction?
To be off by 100+ is basically impossible.
Could it be that your target is small and the 18-degree FoV is seeing something in the background that is getting averaged in? (The diameter of the target should be at least 1/3 of your max distance. So at 600mm, the diameter should be at least 20cm.
Can you add a picture of your setup? Something is really odd.
- john
2024-06-27 06:25 AM
2024-06-27 06:27 AM
I also didn't apply any correction since I'm just using the example code. I tried removing the glass cover too and it didn't affect the readings.
2024-06-27 07:15 AM
It has to be something with the property of the salt that we are not understanding.
Could you take that same set up and prove that it works acceptably when looking into some sort of bucket.
Then add 10cm or so of salt.
You should get 10cm less distance. Do you?
940nm light can do unexpected things. It sees right through pasta for instance. It doesn't detect it all. Same with Gummy Bears. But salt sure looks reflective.
If it's the property of salt, then we are going to need a look-up table. Basically, what you have several posts ago.
It's just this range number really means that depth.
This is not the first time someone wanted to know how much salt is in a tank, but I am not privy to how it was done.
Sorry I cannot be more helpful