Apparatus to measure the relative density of liquids