A thermostat is a regulating device which senses the temperature of a physical system and performs actions so that the system's temperature is maintained near a desired setpoint.