Choosing an Enclosure: What Actually Kills Electronics in the Field
IP ratings describe a laboratory test, not a plant. The real failure mechanisms are condensation, thermal cycling, chemical attack and vibration — and the rating tells you almost nothing about any of them.

Ask which enclosure a product needs and the answer comes back as a rating: IP66, IP67, NEMA 4X. The rating is useful, but it is a laboratory result — a defined quantity of water sprayed from a defined angle for a defined time on a new enclosure at a stable temperature. Very little in a plant resembles that test, and the mechanisms that actually destroy field electronics are mostly ones the rating does not measure.
The first and most common is condensation, and the important point is that it comes from inside. A sealed box is sealed against liquid water, not against the water vapour already in the air trapped at assembly. The enclosure heats during the day and cools at night; every cycle the internal air contracts and expands, and a box that is not perfectly sealed breathes damp air in. When the internal surface falls below the dew point, water forms on the coldest thing inside, which is frequently the board. A higher IP rating makes this worse rather than better, because it slows the drying that a leakier box would do naturally. The remedies are a breather vent with a hydrophobic membrane, conformal coating, desiccant with a real replacement schedule, or deliberately putting the heat source where it keeps the board above dew point. Choosing IP68 and hoping is not among them.
The second is thermal cycling, which attacks joints rather than components. Every material in the assembly expands at its own rate, so each cycle works the solder joints, the connector contacts, the potting interfaces and the cable glands slightly. Over thousands of cycles this produces cracked joints, fretting corrosion on contacts and gland seals that have relaxed enough to admit water. Cycling is also what defeats gaskets: a compressed elastomer takes a permanent set, and a seal that was good at commissioning is a seal that merely looks good five summers later. Specify the number of cycles and the range, not just the maximum temperature.
The third is chemical and UV attack on the enclosure itself rather than on the electronics. Polycarbonate is excellent until it meets certain cleaning agents, ammonia, or sustained ultraviolet, at which point it crazes and then cracks. Stainless steel is excellent until it is the wrong grade near chlorides, where it pits. Aluminium is excellent until it sits in a washdown area with caustic detergent. In food plants the cleaning regime is usually more aggressive than the process; in coastal and desert installations the UV and salt load are the design case. Ask what gets sprayed on it and how often, because that answer changes the material more than the ingress rating does.
The fourth is vibration and mechanical loading, which rarely breaks the enclosure and frequently breaks what is inside it. Heavy components — large capacitors, connectors, relays, anything cantilevered — concentrate stress at their joints. Cables that enter without a strain relief transmit every movement to the board. A cable gland tightened onto a cable that then gets pulled becomes a pivot. On mobile equipment, mining machinery and anything mounted on a motor or a compressor, this is the dominant mechanism and it shows up as intermittent faults long before it shows up as a dead device.
Then the practical constraints that are not failure mechanisms but decide the design anyway. Heat has to leave: a sealed box cannot convect to outside air, so the path is conduction through the wall, and a device dissipating more than a few watts in an enclosure in direct sun needs that path calculated rather than assumed. Antennas do not work inside metal, so any wireless device in a metal enclosure needs an external or window-mounted antenna and the resulting penetration is another seal to get right. And access matters: an enclosure that has to be opened for a battery change, a SIM swap or an SD card is one whose seal is only as good as the last person who closed it, and specifying captive screws and a gasket that survives repeated opening is a real design decision.
A workable method is to write the environment down before choosing anything: temperature range and cycles per day, humidity and whether condensation is expected, what liquids contact it and at what pressure and temperature, chemical exposure including cleaning agents, UV, vibration profile and mounting, altitude if relevant, and who opens it and how often. Then choose the rating to match that description rather than choosing a high rating as a substitute for having the description.
Finally, test the way it will fail, not the way the standard tests. A cycling chamber that takes the unit from cold to hot with humidity present will find condensation problems in weeks that the field would find in a year. A salt-fog run finds the wrong stainless grade. And a single unit left outdoors on the roof for a season, instrumented and opened at the end, is the cheapest and most honest environmental test anybody runs.