An odometer or odograph is an instrument for measuring the distance travelled by a vehicle, such as a bicycle or car. The device may be electronic, mechanical, or a combination of the two. The noun derives from the Greek words hodós ("path" or "gateway") and métron ("measure"). In countries where Imperial units or US customary units are used, it is sometimes called a mileometer or milometer, the former name especially being prevalent in the United Kingdom and members of the Commonwealth[dubious ].
Possibly the first evidence for the use of an odometer can be found in the works of the ancient Roman Pliny (NH 6. 61-62) and the ancient Greek Strabo (11.8.9). Both authors list the distances of routes traveled by Alexander the Great (r. 336-323 BC) as by his bematists Diognetus and Baeton. However, the high accuracy of the bematists's measurements rather indicates the use of a mechanical device. For example, the section between the cities Hecatompylos and Alexandria Areion, which later became a part of the silk road, was given by Alexander's bematists as 529 English miles long, that is with a deviation of 0.2% from the actual distance (531 English miles). From the nine surviving bematists' measurements in Pliny's Naturalis Historia eight show a deviation of less than 5% from the actual distance, three of them being within 1%. Since these minor discrepancies can be adequately explained by slight changes in the tracks of roads during the last 2300 years, the overall accuracy of the measurements implies that the bematists already must have used a sophisticated device for measuring distances, although there is no direct mention of such a device.
An odometer for measuring distance was first described by Vitruvius around 27 and 23 BC, although the actual inventor may have been Archimedes of Syracuse (c. 287 BC - c. 212 BC) during the First Punic War. Hero of Alexandria (10 AD - 70 AD) describes a similar device in chapter 34 of his Dioptra. The machine was also used in the time of Roman Emperor Commodus (c. 192 AD), although after this point in time there seems to be a gap between its use in Roman times and that of the 15th century in Western Europe. Some researchers have speculated that the device might have included technology similar to that of the Greek Antikythera mechanism.
The odometer of Vitruvius was based on chariot wheels of 4 feet (1.2 m) diameter turning 400 times in one Roman mile (about 1400 m). For each revolution a pin on the axle engaged a 400 tooth cogwheel thus turning it one complete revolution per mile. This engaged another gear with holes along the circumference, where pebbles (calculus) were located, that were to drop one by one into a box. The distance traveled would thus be given simply by counting the number of pebbles. Whether this instrument was ever built at the time is disputed. Leonardo da Vinci later tried to build it himself according to the description, but failed. However, in 1981 engineer Andre Sleeswyk built his own replica, replacing the square-toothed gear designs of da Vinci with the triangular, pointed teeth found in the Antikythera mechanism. With this modification, the Vitruvius odometer functioned perfectly.
The odometer was also independently invented in ancient China, possibly by the prolific inventor and early scientist Zhang Heng (78 AD - 139 AD) of the Han Dynasty. By the 3rd century (during the Three Kingdoms Period), the Chinese had termed the device as the 'jì l? g? ch?' (????), or 'li-recording drum carriage' (Note: the modern measurement of li = 500 m/1640 ft). Chinese texts of the 3rd century tell of the mechanical carriage's functions, and as one li is traversed, a mechanical-driven wooden figure strikes a drum, and when ten li is traversed, another wooden figure would strike a gong or a bell with its mechanical-operated arm.
Despite its association with Zhang Heng or even the later Ma Jun (c. 200-265), there is evidence to suggest that the invention of the odometer was a gradual process in Han Dynasty China that centered around the huang men court people (i.e. eunuchs, palace officials, attendants and familiars, actors, acrobats, etc.) that would follow the musical procession of the royal 'drum-chariot'. The historian Joseph Needham asserts that it is no surprise this social group would have been responsible for such a device, since there is already other evidence of their craftsmenship with mechanical toys to delight the emperor and the court. There is speculation that some time in the 1st century BC (during the Western Han Dynasty), the beating of drums and gongs were mechanically-driven by working automatically off the rotation of the road-wheels. This might have actually been the design of one Loxia Hong (c. 110 BC), yet by 125 AD the mechanical odometer carriage in China was already known (depicted in a mural of the Xiaotangshan Tomb).
The odometer was used also in subsequent periods of Chinese history. In the historical text of the Jin Shu (635 AD), the oldest part of the compiled text, the book known as the Cui Bao (c. 300 AD), recorded the use of the odometer, providing description (and interestingly enough attributing it to the Western Han era, from 202 BC-9 AD). The passage in the Jin Shu expanded upon this, explaining that it took a similar form to the mechanical device of the south-pointing chariot invented by Ma Jun (200-265, see also differential gear). As recorded in the Song Shi of the Song Dynasty (960-1279 AD), the odometer and south-pointing chariot were combined into one wheeled device by engineers of the 9th century, 11th century, and 12th century. The Sunzi Suanjing (Master Sun's Mathematical Manual), dated from the 3rd century to 5th century, presented a mathematical problem for students involving the odometer. It involved a given distance between two cities, the small distance needed for one rotation of the carriage's wheel, and the posed question of how many rotations the wheels would have in all if the carriage was to travel between point A and B.
The historical text of the Song Shi (1345 AD), recording the people and events of the Chinese Song Dynasty (960-1279), also mentioned the odometer used in that period. However, unlike written sources of earlier periods, it provided a much more thoroughly detailed description of the device that harkens back to its ancient form (Wade-Giles spelling):
The odometer. [The mile-measuring carriage] is painted red, with pictures of flowers and birds on the four sides, and constructed in two storeys, handsomely adorned with carvings. At the completion of every li, the wooden figure of a man in the lower storey strikes a drum; at the completion of every ten li, the wooden figure in the upper storey strikes a bell. The carriage-pole ends in a phoenix-head, and the carriage is drawn by four horses. The escort was formerly of 18 men, but in the 4th year of the Yung-Hsi reign-period (987 AD) the emperor Thai Tsung increased it to 30. In the 5th year of the Thien-Sheng reign-period (1027 AD) the Chief Chamberlain Lu Tao-lung presented specifications for the construction of odometers as follows:
What follows is a long dissertation made by the Chief Chamberlain Lu Daolong on the ranging measurements and sizes of wheels and gears, along with a concluding description at the end of how the device ultimately functions:
The vehicle should have a single pole and two wheels. On the body are two storeys, each containing a carved wooden figure holding a drumstick. The road-wheels are each 6 ft in diameter, and 18 ft in circumference, one evolution covering 3 paces. According to ancient standards the pace was equal to 6 ft and 300 paces to a li; but now the li is reckoned as 360 paces of 5 ft each.
[Note: the measurement of the Chinese-mile unit, the li, was changed over time, as the li in Song times differed from the length of a li in Han times.]
The vehicle wheel (li lun) is attached to the left road-wheel; it has a diameter of 1.38 ft with a circumference of 4.14 ft, and has 18 cogs (chhih) 2.3 inches apart. There is also a lower horizontal wheel (hsia phing lun), of diameter 4.14 ft and circumference 12.42 ft, with 54 cogs, the same distance apart as those on the vertical wheel (2.3 inches). (This engages with the former.) 
Upon a vertical shaft turning with this wheel, there is fixed a bronze "turning-like-the-wind wheel" (hsuan feng lun) which has (only) 3 cogs, the distance between these being 1.2 inches. (This turns the following one.) In the middle is a horizontal wheel, 4 ft in diameter, and 12 ft circumference, with 100 cogs, the distance between these cogs being the same as on the "turning-like-the-wind wheel" (1.2 inches).
Next, there is fixed (on the same shaft) a small horizontal wheel (hsiao phing lun) 3.3 inches in diameter and 1 ft in circumference, having 10 cogs 1.5 inches apart. (Engaging with this) there is an upper horizontal wheel (shang phing lun) having a diameter of 3.3 ft and a circumference of 10 ft, with 100 cogs, the same distance apart as those of the small horizontal wheel (1.5 inches).
When the middle horizontal wheel has made 1 revolution, the carriage will have gone 1 li and the wooden figure in the lower story will strike the drum. When the upper horizontal wheel has made 1 revolution, the carriage will have gone 10 li and the figure in the upper storey will strike the bell. The number of wheels used, great and small, is 8 inches in all, with a total of 285 teeth. Thus the motion is transmitted as if by the links of a chain, the "dog-teeth" mutually engaging with each other, so that by due revolution everything comes back to its original starting point (ti hsiang kou so, chhuan ya hsiang chih, chou erh fu shih).
Odometers were first developed in the 1600s for wagons and other horse-drawn vehicles in order to measure distances traveled.
Levin Hulsius published the odometer in 1604 in his work Gründtliche Beschreibung deß Diensthafften und Nutzbahrn Instruments Viatorii oder Wegzählers, So zu Fuß, zu Pferdt unnd zu Fußen gebraucht werden kann, damit mit geringer mühe zu wissen, wie weit man gegangen, geritten, oder gefahren sey: als auch zu erfahren, ohne messen oder zehlen, wie weit von einem Orth zum andern. Daneben wird auch der grosse verborgene Wegweiser angezeiget und vermeldet.
In 1645, the French mathematician Blaise Pascal invented the pascaline. Though not an odometer, the pascaline utilized gears to compute measurements. Each gear contained 10 teeth. The first gear advanced the next gear one position when moved one complete revolution, the same principle employed on modern mechanical odometers.
Odometers were developed for ships in 1698 with the odometer invented by the Englishman Thomas Savery. Benjamin Franklin, U.S. statesman and the first Postmaster General, built a prototype odometer in 1775 that he attached to his carriage to help measure the mileage of postal routes. In 1847, William Clayton, a Mormon pioneer, invented the Roadometer, which he attached to a wagon used by American settlers heading west. The Roadometer recorded the distance traveled each day by the wagon trains. The Roadometer used two gears and was an early example of an odometer with pascaline-style gears in actual use.
In 1895, Curtis Hussey Veeder invented the Cyclometer. The Cyclometer was a mechanical device that counted the number of rotations of a bicycle wheel. A flexible cable transmitted the number of rotations of the wheel to an analog odometer visible to the rider, which converted the wheel rotations into the number of miles traveled according to a predetermined formula.
In 1903 Arthur P. and Charles H. Warner, two brothers from Beloit, Wisconsin, introduced their patented Auto-meter. The Auto-Meter used a magnet attached to a rotating shaft to induce a magnetic pull upon a thin metal disk. Measuring this pull provided accurate measurements of both distance and speed information to automobile drivers in a single instrument. The Warners sold their company in 1912 to the Stewart & Clark Company of Chicago. The new firm was renamed the Stewart-Warner Corporation. By 1925, Stewart-Warner odometers and trip meters were standard equipment on the vast majority of automobiles and motorcycles manufactured in the United States.
By the early 2000s, mechanical odometers would be phased out on cars from major manufacturers. The Pontiac Grand Prix was the last GM car sold in the USA to offer a mechanical odometer in 2003, the Canadian-built Ford Crown Victoria and Mercury Grand Marquis were the very last Fords sold with one in 2005.
Whilst an odometer is used to record distance (units can vary, usually between miles and kilometres), a mileometer specifically records only in miles. The equivalent used to record kilometres is sometimes referred to as a "kilometreometer".
Most modern cars include a trip meter (trip odometer). Unlike the odometer, a trip meter is reset at any point in a journey, making it possible to record the distance traveled in any particular journey or part of a journey. It was traditionally a purely mechanical device but, in most modern vehicles, it is now electronic. Luxury vehicles often have multiple trip meters. Most trip meters will show a maximum value of 999.9. The trip meter may be used to record the distance traveled on each tank of fuel, making it very easy to accurately track the energy efficiency of the vehicle; another common use is resetting it to zero at each instruction in a sequence of driving directions, to be sure when one has arrived at the next turn.
A form of fraud is to tamper with the reading on an mileometer/odometer and presenting the incorrect number of miles/kilometers traveled to a prospective buyer; this is often referred to as "clocking" in the UK and "Busting miles" in the US. This is done to make a car appear to have been driven less than it really has been, and thus increase its apparent market value. Most  new cars sold today use digital odometers that store the mileage in the vehicle's engine control module making it difficult (but not impossible) to manipulate the mileage electronically. With mechanical odometers, the speedometer can be removed from the car dashboard and the digits wound back, or the drive cable can be disconnected and connected to another odometer/speedometer pair while on the road. Older vehicles can be driven in reverse to subtract mileage, a property that provides the premise for a classic scene late in the comedy film Ferris Bueller's Day Off, but modern odometers add mileage driven in reverse to the total as if driven forward, thereby accurately reflecting the true total wear and tear on the vehicle.
The resale value of a vehicle is often strongly influenced by the total distance shown on the odometer, yet odometers are inherently insecure because they are under the control of their owners. Many jurisdictions have chosen to enact laws which penalize people who are found to commit odometer fraud. In the US (and many other countries), vehicle mechanics are also required to keep records of the odometer any time a vehicle is serviced. Companies such as Carfax then use these data to help potential car buyers detect whether odometer rollback has occurred.
Research by Irish vehicle check specialist Cartell found that 20% of vehicles imported to Ireland from Great Britain and Northern Ireland had had their mileometers altered to show a lower mileage.
Most odometers work by counting wheel rotations and assume that the distance traveled is the number of wheel rotations times the tire circumference, which is a standard tire diameter times pi (3.1416). If nonstandard or severely worn or underinflated tires are used then this will cause some error in the odometer. The formula is (actual distance traveled) = ( (final odometer reading) - (initial odometer reading) ) * (actual tire diameter) / (standard tire diameter). It is common for odometers to be off by several percent. Odometer errors are typically proportional to speedometer errors.