That's a different approach but i can imagine it will work. You mean somthing like this .....I would have a solid flat surface where the ToF can start reflecting from as the push button starts the stepper and that could be the ref point too, and the ToF is moved up or down (assuming the pipe is horizontal and the ToF moves oryhoganaly) by the stepper. by the push of the start button, Stepper move the ToF and it can take readings from the 'ref' surface as it travels, it will hit the pipe's edge, where one end of the pipe' s peak and as ToF travels to the centre of the pipe, that gives us radius, and it continues to the other end till the readings are same (back to the ref surface). So the readings around the pipe should from highest point (but below ref surface readings) and the lowest being where the ToF gets to the centre point of the pipe OD, and then the readings starts to climb back again. How would you convert that into diameter? 1st ever lowest point to the lowest of lowest point, will give us radius, times that into diameter may be..... i would be interested in knowing how you would go about it.