Apparatus, including a rigid gripper configured tofasten around a cylindrical object. The apparatus furtherincludes a pair of conductors attached to the gripper so asto make contact with one another, while the gripper isfastened around the cylindrical object, at a location along alength of the conductors that varies responsively to adiameter of the cylindrical object. The apparatus alsoincludes a sensing circuit configured to measure an impedanceof a current passing through the pair of conductors and togenerate an indication of the diameter responsively to theimpedance.