extracting voltage and distance from sensor output