Is there a way to measure density of liquid electronically without using tilt sensor.
It may be a bit cumbersome, but you could try deducing density from measurements of volume and mass.