Floating potentiometer

perhaps a gas tank float