Temperature is a statistical property of particles in motion. Mercury expands when warmed and thus indicates temperature. Electron mobility in semiconductor is similarly influenced but more easily scaled and thus makes a better thermometer.
A mercury thermometer routes the expanding liquid from the reservoir bulb into a narrow and uniform passage, optically magnified by the surrounding glass, to provide visible motion agains an engraved scale.
A digital thermometer measures current \( \propto (e^\frac {qV} {kT}-1)\) where \(T\) is absolute temperature and the remaining terms are physical, operational, or mathematical constants derived from the semiconductor physics. Clever feedback circuits amplify, duplicate, cancel and reference these currents to make stable temperature measurements.
The matchstick sized DS18B20 digital thermometer uses the physical properties of silicon to measure temperature and signal the result to a computer.
The DS18B20 digital thermometer converts temperature sensitive current to digital, transmits that on demand through a protocol, while optionally powering all the circuitry from busts of voltage made present on one wire between packets. pdf
Measurements are available over an operating range of -55°C to +125°C and spec'd accurate to ±0.5°C over the range of -10°C to +85°C. The device has a maximum reporting resolution of 1/16°C.
Experience shows a reporting resolution eight times that of the expected accuracy to be justified as measurements are highly repeatable over short time periods and show uniform step rates when observing slow changes of large thermal masses.
See List of Sensors