Liquid density measurment with arduino

Hi to everyone, this is my first post on this forum, and I hope someone can help me finding the right sensor.
I need to measure density of a liquid on an open tank and I don't know if there is a density sensor available. I've founded on a website that I can get to density values reading pressure on two different heights of the tank (differential pressure between sensors) and calculate with some other data like height difference between the two measurement points and gravity. But if there is a sensor o density, much better!
I'm not a native english speaker... sorry! And thank you for your help!

It should be possible.
The easiest way I can think of: take a pressure sensor, submerge it at a certain well known depth, measure the pressure, and with the depth you can then calculate the density. Pressure is a function of the density of the liquid and the depth, so it's very important that you know exactly how deep the pressure sensor is below the surface.

Two absolute pressure sensors at known height difference seems viable, or differential sensors
referenced to external air pressure (which measures the difference in density of the fluid in the
tank and of the air). Good sensor matching would be needed, or a means to swap them over
to cancel out any drift in value.

If you suspend a mass of known density on a sensitive scale in a liquid the weight of the mass will vary with the density of the liquid. Google Galileo thermometer.

That has the advantage of not needed to modify the tank, thinking about it. A load-cell and a suitably
weighted bob slightly denser than the maximum density of the liquid...

A company I worked for used that method for quality control, before a batch of molten metal was used, a small amount was tapped off and poured into a mold of 4 small ingots (about 50 grams each) after cooling an ingot was suspended on a scale that read down to 0.1 mg, then a container of 4 degree C distilled water was "elevated" under it until submerged, the weight diff was fed to a computer program that figured out the % of alloy.

I thought UV spectroscopy was used for alloy composition determination?

Thank you all for your answers! I think I can try both methods (pressure sensors and load cell) and compare results before deciding, and now, wich pressure sensors and load cells model do you recommend?

Pressure sensor is the hardest to suggest as it depends highly on the liquid. Most can handle water but if you're talking about corrosive liquids like strong acids or bases, or hydrocarbons, they may not survive for long.

The load cell + suspended weight is for that matter the safest.

@MarkT;
Correct. What I described was just a quick, on the fly, GO/NO GO test, they did use a spectroscopic machine that sparked like a TIG welder on the finished product.