This paper addresses the need for accurate and continuous measurement of walked distance in applications such as indoor localisation, gait analysis or the 6-minute walk test (6MWT). We propose a method to continuously collect ground truth data of walked distance using an IoT-based trundle wheel. The wheel is connected via Bluetooth Low Energy to a smartphone application which allows the collection of inertial sensor data and GPS location information in addition to the reference distance. We prove the usefulness of this data collection approach in a use case where we derive walked distance from inertial data. We train a 1-dimensional CNN on inertial data collected by one researcher in 15 walking sessions of 1 km length at varying speeds. The training is facilitated by the continuous nature of the reference data. The accuracy of the algorithm is then tested on holdout data of a 6-min duration for which the error of the inferred distance is within clinically significant limits. The proposed approach is useful for the efficient collection of input and reference data for the development of algorithms used to estimate walked distance, such as for the 6MWT.