A specific gravity measurement apparatus has a specific gravity hydrometer that carries a codestrip at the top. A linear optical encoder is disposed to view the codestrip and to output electronic signals that are indicative of a movement of the codestrip relative to said encoder. The movement is indicative of a change in the specific gravity of the liquid, such as a change in a salinity of the aquarium water in which the hydrometer floats. The measurement apparatus may be incorporated into a saltwater aquarium salinity control system where an electronic controller uses the measurement inputs to control a plurality of pumps for selectively adding saltwater or freshwater to the aquarium water in order to control the salinity of the water at a given setpoint level.