Heat is a description of how much the molecules in an object are moving about
We’ve discussed before how molecules and atoms within a material are always wiggling about. This degree of vibration is heat, and measuring the temperature of something really measures the amount of kinetic energy stored in the wiggling of the atoms. You can heat something until its atoms break free of their bonds, which turns a solid into a liquid or liquid into a gas. You can also try to cool something down until there is no motion in the atoms—that point is absolute zero, or -459.67° Fahrenheit (-273.15° Celsius), and is pretty tough to reach, but that’s another post.
Different materials will have different thermal expansion coefficients, which describe how much they expand when heated
If the atoms in a material are hot they will be moving around bumping into each other—the frequency and energy of the collisions are related to the heat contained in the material. More energetic collisions means the particles will move farther from each other each time they hit. Imagine you’re in a room with a dozen or so beach balls—the harder you throw one ball at another, the further and faster it will fly away, and it will probably knock into other balls along the way.
The balls knocking around on the walls of the room are akin to the atoms of a gas knocking into their container. This is the source of pressure: atoms colliding with the walls of their container. In a solid or liquid those atoms are colliding with each other, but not quite enough to overcome the atomic bonds that are holding them into the solid or liquid form. So we don’t call the effect pressure, but there’s a similar idea going on: atoms moving faster collide with each other and move farther apart, which effectively increases the volume taken up by that solid or liquid.
Liquids expand more than solids, and metals expand more than glass, so mercury in glass makes a good thermometer
Most materials expand as they get hotter—there are a few that don’t work this way, but usually only do so over a small temperature range. One notable example is liquid water, which actually contracts a bit when heated from 0 °C to 4 °C. Everything else expands as it gets warmer, but does so by different amounts depending on what the material is. Liquids will typically expand more than solid because their atomic bonds aren’t quite as strong (which is why they are a liquid at that temperature in the first place). Metals also tend to expand more than glass when their temperatures are increased by the same amount.
Mercury is the only metal that is in its liquid phase at room temperature and pressure. Because of this, some thermometers are made by placing the mercury inside a glass tube—here the glass doesn’t expand much when it’s heated, but the mercury will. It expands by a known amount as well, so by marking certain points along the glass an absolute temperature can be obtained. Alcohol is another good substance to use inside the glass—this is what’s inside any thermometer you see that has red fluid.
To calibrate such a thermometer, you have to use two known temperatures. The easiest thing to do is use the freezing point and boiling point of water. A glass of ice water will be at 0 °C (if there’s no ice it’s probably a bit warmer, and if there is all ice it could be colder, but as long as both are present the temperature must be 0 °C), and similarly a steam bath will be at 100 °C. Marking the position of the mercury in these two environments gives you two set points, and picking some gradation between them will give you a scale for measuring temperature. Interestingly, this is why you might see warnings to bring your thermometer inside if the temperature is going to be near -40 °C, because mercury will freeze here, which can break your thermometer!
Digital thermometers tend to not use mercury—instead they rely on another property of a material that temperature can effect: namely the resistance. Resistance is how hard it is for electric current to flow through a material—since this depends on atoms transferring charge between each other (the details are another post!), it is also affected by their wiggling motion and thus the temperature of the material. These devices, which rely on the change of resistance with temperature, are called thermistors (for “thermal resistor”).
Bonus physics—Thermal expansion around you
Materials getting larger or longer as they get hotter happen all the time around you. For example, watch overhead power lines on cold and hot days—you’ll find that when it’s warm the lines will sag between the poles and be taught when it’s cold, because the materials in the lines expand from the heat. Another example of thermal expansion is in bridge connections—the longer a bridge the more it can expand as its temperature increases, and the force from this is easily great enough to crack the road on either side.