cancel
Showing results for 
Search instead for 
Did you mean: 

Tuning parameters for fill level sensor P-NUCLEO-53L8A1 evaluation kit

plaitenberger
Associate II

Good morning.

I am trying to evaluate a P-NUCLEO-53L8A1 evaluation kit. I downloaded the software example from your website and am trying to carry out some tests with water and cofffee.

I am wondering whether I could ask you another question to the GUI for the cup and liquid detection software. 

I seem to be able to detect the cup ok. Also the cup height and diameter measurements are ok. However, I struggle with the liquid level detection, using water or coffee (two liquids I got readily available) in a coffee mug. The issues I see are:

- The measured liquid level is often too low in comparison to the actual fill level.

- Often the measured fill level increases initially but then decreases even though the actual fill level increases monotonically. 

- Often, when the liquid level reaches the top of the cup, several of the pixels in the 8x8 ranging image are black without any value, while others show very large distance values (i.e. several times larger than the actual distance to the liquid surface).

Would you know what I am doing wrong? Are there any parameters I can adjust?

Sorry to trouble you with this.

Thank you very much!

 

 

4 REPLIES 4
John_Kvam
Senior

No trouble at all. 

Level detect (in theory) is an easy problem. Just find the zone with the biggest return signal, and that is the zone that is perpendicular to the liquid - and has the best answer. 

But this assumes the photons that don't reflect off the surface of the water just disappear. And they do if you have a deep enough container - or the container has a very black, non-reflective bottom.

But your coffee cup is not like that is it. 

So, ST put RogerM on the job. 

And he did a lot of work. He needed to actually look into the time the first photons came back. And so, he pretty much single-handedly invented the CNH software to solve the problem. The Compressed, Normalized, Histogram that comes with the VL53L8CH - is just what you need.

Now I know this is a lot to take in. But lucky for you we published all RogerM's work.

It's in a software package called STSW-IMG051, and you can read the databrief at Data brief - STSW-IMG051 - Smart cup detection solution using Time-of-Flight (ToF) sensors VL53L7CH and VL53L8CH with compact normalized histogram (CNH)

Read the databrief, and assure yourself it's just what you need. 

Then download the STSW-IMG051 code and read the entire user's guide. 

It tells you how it works, why it works, what issues you might see - and then try it out. 

Lucky for you it works with the P-Nucleo-53L8A1 you already bought. 

Give it a try. 

If your design has trouble putting that big board in the right spot above your cup, you can buy the Satel-VL53L8 and wire it to the Nucleo board you have. (There is app note on how to do this.) 

An awful lot of work went into this, and it would be silly of you to do it again. 

At least download the code and read that users guide.

Even if you don't use the code, it will get you started. 

- john

 

If this or any post solves your issue, please mark them as "Accept as Solution". It really helps the next guy.
And if you notice anything wrong do not hesitate to "Report Inappropriate Content".
I am a recently retired ST Employee. My former username was John E KVAM.
plaitenberger
Associate II

Dear John,

Thank you very much for your message and tips. They are very helpful.

I am using the STSW-IMG051 software, but am struggling to get it working. I set up the system and adjusted the height of the sensor above the base to the specified value. The system measured the height above the base correctly and also detects the cup ok when placed below the sensor.

However, when I fill the cup with water, the fill level is not indicated correctly. The measured level increases as water runs into the cup, but the measured level drops again even though the water level in the cup is still rising.

The 8x8 display of the measured distances shows highly variable values within the perimeter of the cup, with some values being close to the base height, some showing smaller values and others showing considerably larger values than the distance from the base. Some of the pixels are also blacked out.

I am not sure which values in the configuration files I can adjust to improve this behaviour. 

Would you have any tips or hints where I can start?

Thank you very much for all your kind help!

All the best

Peter

 

 

Good morning.

Thank you very much for your message and tips. They are very helpful.

I am using the STSW-IMG051 software, but am struggling to get it working. I set up the system and adjusted the height of the sensor above the base to the specified value. The system measured the height above the base correctly and also detects the cup ok when placed below the sensor.

However, when I fill the cup with water, the fill level is not indicated correctly. The measured level increases as water runs into the cup, but the measured level drops again even though the water level in the cup is still rising.

The 8x8 display of the measured distances shows highly variable values within the perimeter of the cup, with some values being close to the base height, some showing smaller values and others showing considerably larger values than the distance from the base. Some of the pixels are also blacked out.

I am not sure which values in the configuration files I can adjust to improve this behaviour. 

Would you have any tips or hints where I can start?

Thank you very much for all your kind help!

All the best

Peter

RogerM
ST Employee

Peter,
I have sent you a PM. 
Roger