A thermocouple is an instrument that is made of two different metals that produce a small electrical charge when heated on one side. This small electrical charge switches on an electromagnet which opens a valve and no longer restricts the flow of water or gas.