
a page from Leonardo DaVinci’s Codex Atanticus
“So that we were not tired and lose time measuring it with the chain or the rope, but found on a moving vehicle we could determine with precision the already mentioned intervals, with the turning of the wheels.” Heron of Alexandria, Dioptras, paragraph 34.
The origins of the invention are unclear, possibly credited to Archimedes (287 BC – 212 BC), but the earliest account of the odometer comes from Vitruvius (~ 75 BC - 15 AD) a Roman architect and engineer. He describes a simple machine, a pin on the axle of the wheel progresses a large gear by one notch every revolution, which in turn releases one pebble to fall into a container. Distances can be measured by counting pebbles.
In Greece, Heron’s (~ 10 AD - 70 AD) account of an odometer incorporates another layer of precision, progress between pebbles is depicted by a needle turning against a protractor, marked according to the number of cogs operating on the needle’s axle.

In China, accounts of the odometer date back to the first century, and was given a name in the third century, ‘li-recording drum carriage” (‘li’ is a Chinese unit of distance, ~415 meters at this time). An account from the Song Shi describes one such carriage from the Song period, possessing multiple gears and precisely fabricated wheels so that after one li, a wooden figure bangs a drum, and after 10 li, another figure strikes a bell.
In the west, the machines were lost until Leonardo DaVinci reconstructed Vitruvius’ account in diagram, but never himself made it. A modern implementation of DaVinci’s diagram was constructed by Andre Wegener Sleeswyk in 1979, diagrammed below:

(Source: yourforum.gr)