Tank level learning project

Hi iam new to the forum..
I have a disel tank with unknown dimentios so.
I want to know the liters capacity of my tank using ultrasonic level sensor but it will only give hight in cm
So can i use flow meter with ultrasonic level sensor to make the
Calculations??
Example.. tank is empty . I add 100 liters through the flow meter and the ultrasoinc read 10 cm .
Any code can learn that the first 10 liters =100 liters
The shape of my tank cannot be calculated ..
So i have to make a learning code with flow meter and ultrasonic

Big thnxxx
Any help will be greatful

Moved your topic to it's current location as it is more suitable.

Could you take a few moments to Learn How To Use The Forum.
It will help you get the best out of the forum in the future.

Bob.

That would be one way of getting a height vs. volume profile. Adding water by the bucket would be another way.

This is just basic calibration: known input, read the output, so later you can turn it around.

Empty the tank
Add liquid based on height, maybe 2cm at a time, note amount of liquid added at each step, you want to go slow and let the liquid settle down for each measurement

Repeat until tank if full - you have just made a graph showing volume vs/ height - now just put that in a lookup table and done (well except for the rest of the program. Works like a champ, did it several times in a previous lifetime

saildude:
Empty the tank
Add liquid based on height, maybe 2cm at a time, note amount of liquid added at each step, you want to go slow and let the liquid settle down for each measurement

Repeat until tank if full - you have just made a graph showing volume vs/ height - now just put that in a lookup table and done (well except for the rest of the program. Works like a champ, did it several times in a previous lifetime

Thnx mate exact your idea but want to do it automated with water flow meter and the audrino build the table based on the liters added and the ultrasoinc hight

If you are using a flow meter, the purpose of which is not so clear, why not have two, the purposes for which will be clear - one for inlet, one for outlet. The first is used to determine the overall volume, if you really need it, and Arduino does the rest.

Most tanks are of a conventional shape - rectangular or cylindrical , so it should be possible to calculate , or at least know the Likely relationship between depth and volume.

Is your "flow meter" volume or rate?

You need to build a table, my experience building based on height works much better than just dumping in some volume -

You could put the Arduino in charge of adding a specific height - add diesel to a specific height - stop and let liquid quiet down and take a new reading - then repeat. The type of "flow meter" an the rate of filling will have a great effect on the accuracy - filling very slow is better - if your meter gives a rate of flow - you will have more math and problems to solve

The best is to have a volume based meter like you find at your local gas station - very controllable and easy to stop at a specific point