A temperature sensor is a device that gathers data concerning the temperature from a source and converts it to a form that can be understood either by an observer or another device. These sensors come in many different forms and are used for a wide variety of purposes, from simple home use to extremely accurate and precise scientific use. They play a very important role almost everywhere that they are applied; knowing the temperature helps people to pick their clothing before a walk outside just as it helps chemists to understand the data collected from a complex chemical reaction.
The best known example is the mercury-in-glass thermometer. Mercury expands and contracts based on changes in temperature; when these volume changes are quantified, temperature can be measured with a fair degree of accuracy. The outside temperature is the source of the measurements and the position of the mercury in the glass tube is the observable quantification of temperature that can be understood by observers. Typically, mercury-in-glass thermometers are only used for nonscientific purposes because they are not extremely accurate. In some cases, they can be used in high school or college chemistry labs when a very accurate measurement of temperature is not important.
A more complex temperature sensor will generally be computerized for more accurate results. These, too, are sometimes used in homes for nonscientific purposes; some people keep sensors outside that wirelessly send the outside temperature to a digital display inside. In a lab, a digital sensor will typically be calibrated to be far more accurate. These devices typically take one of two forms: contact sensors measure their own temperatures after they have achieved thermal equilibrium with their environments, and noncontact sensors measure heat radiation from their environments within a given area. All heat sensors tend to have some level of error in their readings, as temperature is quite difficult to measure accurately.
Many organisms, including humans and most animals, have biological temperature sensors that serve essentially the same function as artificial ones: they collect data and transfer it into an understandable form. Human sensory nerves, for example, send sensory information from the skin to the brain in the form of electrical impulses. The brain produces the sensations of hot and cold that people experience while standing in the sun or walking through the snow. While the impulses themselves would make no sense if set in front of an individual, the general feelings of hot and cold make perfect sense.