Digital high-precision liquid level sensor