A friend and I once rigged up a mechanical bicycle speedometer on a 90 ton SG 0-6-0. Our design was inspired by a picture and diagram of a locomotive valve pilot indicator. The "sending unit" consisted of an arm (made from steel bar stock), one end of which was attached to a pivot on the locomotive frame, and a wheel (hard rubber treaded wheel from a hand truck) on the other end which "rode" on the rear driver tread of the locomotive. As I recall, we also ended up having to put a spring on the arm to hold it against the driver tread because the weight of the arm was not enough to hold the tread wheel against the driver tire without slipping. Also, because of the difference in wheel diameters (51" driver, 8" tread wheel, and a bicycle speedometer which was supposed to be mounted on a 26" bicycle wheel) we had to use some gearing to get the speedometer cable to turn at the correct RPM. It only worked while we were going forward. Since our rail line had no turning facilities at either end and we had to run in reverse for the return trip, that meant the speedometer didn't work half the time - but it was fun while it lasted.
T.E. Scott Jr., P.E.