An odometer (mileometer, milometer) indicates distance traveled by a car or other vehicle. The device may be electronic, mechanical, or a combination of the two. The word derives from the Greek words ""hodós", meaning "path" or gateway and "métron", "measure".
In the early autos a top reading of 99,999 was enough. With improvements, modern vehicles need an extra digit. At the top reading, an odometer restarts from zero (odometer rollover).
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 travelled 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.
Possibly the first evidence for the use of an odometer can be found in the works of Pliny (NH 6. 61-62) and Strabo (11.8.9). Both authors list the distances of routes traveled by Alexander the Great (r. 336-323 BC) as measured by his bematists Diognetus and Baeton. However, the high precision 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.4% 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 even less than 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 mentioning of such a device.
An odometer for measuring distance was first described by Vitruvius around 27 and 23 BC. The actual invention may have been by Archimedes of Syracuse during the First Punic War. Hero of Alexandria 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.
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 travelled 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 tried to build it according to the description but failed. Later, Ben Franklin invented his own version. Benjamin Franklin invented a simple odometer when he was going on trips in carriages. He wanted to know how far he was going, and the speed he was travelling.
The odometer as used in modern systems, where a separate gear controls each digit, was invented in 1847 by William Clayton with help from Orson Pratt. Clayton, a Mormon pioneer, developed the odometer (dubbed the "roadometer") to keep track of wheel revolutions on the pioneer wagons. The odometer had at least two gears, including one which turned every quarter-mile and one which turned every ten miles.
The odometer was also later invented in ancient China, possibly by the profuse inventor and early scientist Zhang Heng (78–139 AD) of the Han Dynasty (202 BC–220 AD). Zhang Heng is often accredited with the invention of the first odometer device in China, an achievement alongside earlier contemporaries Archimedes and Heron of Alexandria from the Hellenized West. 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 (ie. 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 Xiao Tang Shan 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 (refer to South Pointing Chariot). The Sun Tzu Suan Ching (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).
In modern times, Andre Sleeswyk was able to make a working model of an odometer using gears similar to the Antikythera mechanism as opposed to the traditional cogwheel.
A common form of fraud is to tamper with the reading on an odometer; this is often referred to as clocking. 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. Many 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 dash board and the digits wound back, or the drive cable can be disconnected and connected to another odometer/speedometer pair while on the road. Modern odometers now add mileage driven in reverse to the total as if driven forward, to accurately reflect the true total wear and tear on the vehicle (older vehicles could be driven in reverse to subtract mileage).
The resale value of a vehicle is often strongly influenced by the number of miles or kilometres a passenger vehicle has 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 this data to help potential car buyers detect whether odometer rollback has occurred.
Recently, exercise enthusiasts have observed that an advanced Global Positioning Satellite (GPS) receiver (GPSr) with an odometer mode serves as a very accurate pedometer for outdoor activities. While not truly counting steps (no pendulum is involved) an advanced GPSr odometer can reveal the accurate distance traveled to within 1/100th of a mile (depending on the model, perhaps 1/1000th of a mile). 1/1000th of a mile is approximately the distance of a single pace or 2 steps (1.609 m). Precise metric odometers have a precision of 1/100 or 1/1000 km, 10 or 1 metre(s) respectively.
A GPSr with odometer mode is also an excellent and inexpensive means to verify proper operation of both the speedometer and odometer mounted in a vehicle.
This would be a road vehicle tax collected per distance unit of travel. This may become increasingly important with the increasing presence of electric vehicles & very fuel efficient gas burning models.