Abstract: An apparatus for preventing the formation of ice on a substrate exposed to an outdoor environment or for preventing condensation of moisture in a cabinet for electrical equipment includes a sensor for measuring the temperature of the ambient air around the substrate or around or in the cabinet and calculates the rate of change of the temperature of the ambient air. The apparatus further includes a sensor for measuring the temperature of the substrate or of a surface of or inside the cabinet. A heater supplies heat to the substrate or cabinet in response to pre-arranged conditions dependent on the outputs of the sensors and on the calculated rate of change of the temperature of the ambient air. The apparatus for preventing condensation may optionally omit the sensor for measuring the temperature of a surface of or inside the cabinet.