cancel
Showing results for 
Search instead for 
Did you mean: 

Am I implementing this liquid level detection right?

ABrun.7
Associate

I am impementing a water level detection in the sub 1 meter range down to ~50 mm closest distance.

My environment is consistently pretty dark concerning visible light. There is no change in time of ambient light.

There is very little dynamics in level height. Bubbles and turbidity are no problem. Also I expect a relatively smooth surface.

I have to compensate for tilt and temperature changes. The container I am measuring in does not have mirroring walls or bottom.

Tilting angle can change +/- 15° in every direction and Temperature can change between 10°C and 30°C.

I decided to go with VL53L5CX over VL53L4CD as I would like to try compensate tilt with averaging over the complete FOV.

I do not have strong demands in accurate absolute distance measuring as I am wanting to calibrate the sensor with different liquid levels before putting it into action. As it is a quasi static measurement over time I need to achieve very repeatable results even with varying tilt and temperature. My measurements do need to lay within +/- 3 mm of actual distance after calibration repeatably.

The following are my current findings (note, all meaurements done without cover glass):

 Temperature compensation: Not a big problem as offset of distance varies quite linear with change in temperature. ST noted in a white paper that offset due to temperature is independent from actual distance.

Tilt compensation: From a different post I recon @John E KVAM​ stating that it would be the best to only take the strongest signal for detecting water level. My findings are that with my demands I did achieve better results with only leaving out the edge pixels but averaging over the rest of pixels regardless of their signal strength. The nearer the surface gets to the sensor the more influence does tilt have on the measurement. My plan is to get tilt information of the 4 pixels strongest in signal forming a square. The further it gets out of the middle position the higher is the tilting angle.

Both compensations work relatively nicely on my desk.

  • Can I derive real world behaviour from this?
  • Am I going to be able to achieve measurements withing +/- 3 mm consistently with the VL53L5CX sensor in the environment descibed above?
  • How much is the influence of VCC fluctuations? Is this a major concern with this sensor?
  • Does the sensor behave as linear without a cover glass as with a cover glass applied in the sub 60 cm range after compensating XTalk?
  • Would it be useful to weigh pixels according to their signal strength when averaging?

Thanks for discussing the topic!

3 REPLIES 3
ABrun.7
Associate

I found an answer for parts of my above questions.

Weighing the distance values of the pixels according to their signal strength does improve the accuracy quite a lot especially when ranging shorter distances.

Could this be the case as misled photons have larger impact on distance reading the shorter the actual distance gets?

As I do not have the VL53L4CD sensor at hand: How is the accuracy on short distances (<50 mm) compared to the VL53L5CX? Can it measure water down to actually a few millimeters?

John E KVAM
ST Employee

the L4 is a good sensor for this - until you consider tilt. The L4 will not handle that very well as it has a very narrow Field of View.

You are clearly on the right track with what you have. The L5's crosstalk calibration will handle your coverglass as long as you choose a good one. Please read the article on coverglass at the top of the community page.

https://community.st.com/s/article/Time-of-Flight-Cover-glass

It specifies the ideal coverglass. Try to stick to that and you will be fine.

I never tried a weighted average as I found the perpendicular zone was the best measure, and it had the strongest signal - sometimes by a lot. One might consider weighing it's neighboring zones, but the zones on the fringe are not helping you at all. What about averaging in all neighboring zones who's single strength are within 10 or 20% of the largest zone's signal strength? It would handle the case where the ideal was at the point midway between a zone, Or at the intersection of 4 zones.

=- john


If this or any post solves your issue, please mark them as 'Accept as Solution' It really helps. And if you notice anything wrong do not hesitate to 'Report Inappropriate Content'. Someone will review it.
Anne BIGOT
ST Employee

ST just published a FAQ about liquid level monitoring.

You can find it here.

There were also a webinar in November 2022.

You can find a SW package here with example code.


Our community relies on fruitful exchanges and good quality content. You can thank and reward helpful and positive contributions by marking them as 'Accept as Solution'. When marking a solution, make sure it answers your original question or issue that you raised.

ST Employees that act as moderators have the right to accept the solution, judging by their expertise. This helps other community members identify useful discussions and refrain from raising the same question. If you notice any false behavior or abuse of the action, do not hesitate to 'Report Inappropriate Content'