A thermocouple is an instrument that is made of two different metals that produce a slight 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 gas or water.