An infusion pump uses sensors and a computer program to detect tubing in a tube-loading section of the pump. The pump and the computer program also measures one or more of the tubing outer diameter, outer circumference, inner diameter, inner circumference, and tubing wall thickness. The infusion pump utilizes proximity sensors, such as an ultrasonic sensor, a capacitive sensor, or even an air-in-line sensor to detect proximity between two infusion pump surfaces, such as the surfaces that clamp the tubing in the pump, to determine thickness. At least one of the clamping surfaces is equipped with sensors to indicate contact length of the tubing with the surface. Using these measurements, the tubing wall thickness and inner diameter can be determined. Knowing the actual tubing inner diameter, increased volumetric accuracy is possible, up to a three or four percent improvement over present measurements.