thermostat is a component of a control system which senses the temperature of a system so that the system's temperature is maintained near a desired setpoint. The thermostat does this by switching heating or cooling devices on or off, or regulating the flow of a heat transfer fluid as needed, to maintain the correct temperature.

A thermostat may be a control unit for a heating or cooling system or a component part of a heater or air conditioner. Thermostats can be constructed in many ways and may use a variety of sensors to measure the temperature. The output of the sensor then controls the heating or cooling apparatus. A thermostat may switch on and off at temperatures either side of the setpoint. This prevents equipment damage from frequent switching.

A thermostat is an instance of a "bang-bang controller" as the heating or cooling system output is not proportional to the difference between actual temperature and the set temperature; the equipment runs at full capacity until the set temperature is reached, then shuts off. Increasing the difference between the thermostat setting and the desired temperature therefore does not shorten the time to achieve the desired temperature.