Thermocouples are used in many types of heating systems, including boilers, as a way to sense temperature. The technology in thermocouples is quite simple and they are fairly affordable to make, which is part of why they are used so often. Thermocouples operate on a principle related to the way that metal reacts to temperature.
Thermocouples operate because of the interaction between two different metals. As the temperatures change in the heating system, the two metals react with each other. Thermocouples are made from a variety of different metals, and the exact metals used in a boiler system will depend on the maker of that particular part. The metals in thermocouples are chosen in pairs because of the way they react together. For instance, a thermocouple might be made of nickel-chromium and nickel-aluminum, or iron and copper-nickel.
An electric current moves through the thermocouple wire. As the temperature changes, the amount of voltage produced by the thermocouple changes. This is what signals to the rest of the boiler system what temperature is being registered. This is a good way to measure the temperature produced by the pilot light in a boiler system, because thermocouples are still accurate even when under heat that is much higher than room temperature.
The reason a boiler has a thermocouple is to monitor the status of the pilot light. Boilers that are powered by gas and rely on a pilot light for ignition are equipped with thermocouples. They act as a safety for the pilot light, since if that pilot light goes out, gas will continue to enter the system without being consumed. The thermocouple tells the gas valve that there is still a flame and that gas should continue to enter the system.
Thermocouples wear out over time. When this happens, the required electricity is no longer conducted from the wire to the gas valve. This causes the boiler to shut down. Obviously, when the boiler gas shuts off, you must make sure there is no other problem with the boiler first, as the thermocouple exists as a safety check. However, remain aware that a degraded thermocouple that is not conducting properly could be the cause of the problem, rather than indicating another issue.