Automatic densimeter