2025-08-20 4:29 AM
Hello everyone out there,
I hope one of you can help me because I'm a bit confused about the additional information the sensor provides.
I need to measure the fill level of a salt container. I noticed that the measured values deviate by about 6 cm compared to a smooth surface. This seems to be because the light is scattered and reflected multiple times within the salt.
With the ST GUI (VL53L4CX Rev. 1.0.0.12289), when the additional information is enabled, I see a distance of 27 cm. The minimum is 25 cm and the maximum is 182 cm. However, the lower diagram shows a blue bar that ranges from 0 to approximately 107 cm. The signal strength is 18 Mcps.
Can someone explain to me how this information is determined?
Does the lower diagram represent the so-called histogram?
Why are the limits in the diagram not the same as the minimum and maximum?
I haven't really figured out how to use the histogram function yet. Perhaps that would help me correct the measured values.
Solved! Go to Solution.
2025-08-31 8:21 AM
If your idea is to know the depth of the water and the underlying salt, you are going to need a better sensor. The VL53 single zone sensors have a bin length of 20cm. And thus, each bin of the histogram is too wide for what you want to do.
Read up on the VL53L8CH. This sensor might be a bit of an overkill as far as the number of zones, but each bin is 3.75cm and thus you can pull out better histogram data.
Your next step is to take a range. Find the zone with the strongest return signal. That's the one that is perpendicular to the surface of the water. It gives you the best range.
But the CH software makes it easy to pull out the histogram data. And you can look at it.
Hopefully, you will see something in that data which will indicate your salt level.
But here you have 2 issues to fight.
One is that 940nm light is absorbed by water. If the salt layer is more than 15cm below the water, you will never see it. The laser light just cannot penetrate farther than that.
Generally, to resolve two targets within a zone, we need 60cm of separation in distance. This shows two distinct 'humps' within the data. But what you are going to have to do is evaluate the expected shape of the return signal of water, and then compare that to water with salt below it.
Might be an interesting task for AI. If you look at the data and don't see a pattern, perhaps AI can help. Find the zone with the biggest return signal, and extract the histogram for that zone. Pass the 20 or so bins you get to AI and give it a shot.
It will be difficult collecting the training data, but that is the problem with Ai.
Good luck,
- john
2025-08-21 10:11 AM
That blue bar represents an area where all your measurements would fall, if you took a lot of them.
It's kind of a wide area, but salt is a particularly difficult substance to range on.
If you look at your graph and notice the SIg:18.04
That means that if you took lot of ranges, 68% of them would fall with your distance of 27.0mm +/- 18.
Personally, I'd ignore the Min/max. it's not very useful. In my opinion the margins were so wide, it's useless as a measure. (Now that I've retired, I can state my opinion. But it's still a good sensor.)
Go with the sigma as a measure of accuracy. When the sigma gets large, take the range number with a grain of salt.
The VL53L4CX does have histograms. And those histograms are evaluated by the software on your PC to get the numbers you see.
And unfortunately, salt returns a histogram with a 'muddled' shape with the photon return signature quite a bit different from the ideal.
And that is what leads to the wide sigma.
2025-08-28 2:27 AM
I experimented a bit more and initially discovered that it wasn't the sigma value being displayed, but rather the signal rate, which in this example is 18.04.
Then I read the sigma value directly. Unfortunately, it's not helpful. Regardless of whether it's salt or a smooth surface, the value is always around 5 to 10 mm. Only when the measuring distance increases does the sigma value increase.
My idea is that I can correct the distance by a few centimeters using the large difference between min and max, which is typical for salt. Essentially, the difference between salt and water needs to be detected.
However, I can't currently figure out how the min and max values are determined. Is there a precise description of the additional data (VL53LX_histogram_bin_data_t)?
How exactly should the bin data be interpreted?
One more question: Is it possible that the VL53L4CD and VL53L4CX sensors only differ in their range? I was surprised that both can be operated with the other GUI.
Kind regards
2025-08-31 8:21 AM
If your idea is to know the depth of the water and the underlying salt, you are going to need a better sensor. The VL53 single zone sensors have a bin length of 20cm. And thus, each bin of the histogram is too wide for what you want to do.
Read up on the VL53L8CH. This sensor might be a bit of an overkill as far as the number of zones, but each bin is 3.75cm and thus you can pull out better histogram data.
Your next step is to take a range. Find the zone with the strongest return signal. That's the one that is perpendicular to the surface of the water. It gives you the best range.
But the CH software makes it easy to pull out the histogram data. And you can look at it.
Hopefully, you will see something in that data which will indicate your salt level.
But here you have 2 issues to fight.
One is that 940nm light is absorbed by water. If the salt layer is more than 15cm below the water, you will never see it. The laser light just cannot penetrate farther than that.
Generally, to resolve two targets within a zone, we need 60cm of separation in distance. This shows two distinct 'humps' within the data. But what you are going to have to do is evaluate the expected shape of the return signal of water, and then compare that to water with salt below it.
Might be an interesting task for AI. If you look at the data and don't see a pattern, perhaps AI can help. Find the zone with the biggest return signal, and extract the histogram for that zone. Pass the 20 or so bins you get to AI and give it a shot.
It will be difficult collecting the training data, but that is the problem with Ai.
Good luck,
- john