Blog · · 6 min read

Waterproof electronics enclosure: what IP ratings promise, and where the water really gets in

IP65 or IP67 on a datasheet does not keep a prototype dry. How to read the rating, design the seal, bring cables through the wall and deal with condensation in a small enclosure.

Many small devices live close to water. A garden sensor stands in the rain. A bike light gets road spray. A plant watering controller sits next to a tank and a pump. So the first enclosure question is usually: "Which IP rating do I need?"

It is a good question, but it is only the start. A box that is rated IP67 when it leaves the factory can be wet inside after you drill one hole for a cable. This article explains what the rating says, and then goes through the four places where water really gets in: the lid, the cables, the air and the wall itself.

What the two digits mean

The IP code comes from the standard IEC 60529. The first digit is about solid objects and dust. The second digit is about water.

For dust, the two values that matter for electronics are 5 (dust protected: some dust may enter, but not enough to cause harm) and 6 (dust tight).

For water, the common values are:

  • 4: splashing water from any direction
  • 5: water jets from a nozzle
  • 6: powerful water jets
  • 7: temporary immersion, up to 1 metre deep for 30 minutes
  • 8: continuous immersion, under conditions that the manufacturer states

One detail surprises many people. The scale is not a simple ladder above 6. The jet tests and the immersion tests are different kinds of stress. A device that passes immersion (7) has not automatically passed water jets (5 or 6). That is why some products carry two ratings, such as IP65 and IP67 together. If your device will be cleaned with a hose and may also fall into a pond, you need both.

Also remember what the test is: clean fresh water, a new seal, a short time, room temperature. It says nothing about salt water, soap, sunlight after three summers, or a lid that has been opened forty times.

Choose the rating from the real situation

Do not pick the highest number. Higher ratings cost money and make the device harder to open and service. Ask instead what will really happen:

  • Indoors, near water (kitchen, plant shelf): splashes and drips. IP54 is often enough, if the openings point downward.
  • Outdoors, fixed, rain only: IP65 is a common and sensible target.
  • On a vehicle or bike: spray from below at speed, plus vibration. IP66 or IP67.
  • May lie in a puddle or be submerged: IP67 or IP68, and a real test.

Then write the answer into the requirements, with the reason. "IP65, because it stands in rain and is hosed down once a year" is a requirement a designer can work with.

Leak path 1: the lid

A seal works because it is squeezed. A soft ring or foam strip is pressed between lid and housing and fills the small gaps. Three things decide whether it works:

Compression. A solid rubber ring in a groove wants to be squeezed by roughly 15 to 30 percent of its thickness. Soft foam gaskets need more, often 25 to 50 percent. Too little, and water finds a path. Too much, and the lid bends or the seal is damaged for good.

A hard stop. The lid should close onto a solid surface, with the seal in a groove beside it. Then every assembly gives the same compression, whoever turns the screws. Without a stop, the result depends on the screwdriver.

Even pressure. A thin plastic lid with four screws in the corners bows between the screws. The seal is tight at the corners and open in the middle. Use a stiffer lid, ribs, or more screws with less distance between them.

Also keep the seal in one piece around the whole opening. Corners where two strips meet are a classic leak.

Leak path 2: cables and connectors

Every hole in the wall is a new seal to design. Cables are the most common reason why a rated box leaks.

  • Use a cable gland that matches the outer diameter of the cable. Each gland has a clamping range. A thin cable in a large gland does not seal.
  • Glands seal on round cables. Flat cables and loose single wires leave gaps between them.
  • Water can travel inside a cable, between the strands, from one wet end to the dry end. For submerged use, this matters.
  • Let the cable hang lower than the entry point before it rises into the box. Water then drips off at the lowest point of this drip loop instead of running along the cable into the gland.
  • Put entries on the bottom or on the side, not on top.

Buttons, displays and status lights are holes too. A light pipe glued into the wall, or a membrane over a button, is often easier to seal than a moving part.

Leak path 3: the air inside

This one is not obvious. A sealed box is full of air. When the sun heats it, the pressure inside rises. When cold rain cools it suddenly, the pressure drops, and the box pulls on its seals. If any seal is weak, the box now sucks water in, drop by drop, at every weather change.

The usual answer is a pressure vent: a small membrane that lets air and water vapour pass but holds liquid water back. With it, the pressure inside and outside stays equal, and the seals have an easy life.

The second air problem is condensation. Warm, humid air closed into the box on assembly day will give off water when the box gets cold. A vent helps the box dry out again. A small bag of drying agent helps for a while. For harsh places, a protective coating on the board, or potting the electronics completely, takes away the risk.

Leak path 4: the wall itself

For prototypes, the housing is often 3D printed. Parts printed in layers from a plastic thread are not watertight by default. Small gaps between the lines let water creep through, slowly, even when the wall looks solid.

It helps to print thicker walls with more outlines and slightly more material flow, and to place the layers so that the sealing surfaces are flat and smooth. For anything beyond splashes, add a coating, or use a different process for the housing. Printed sealing surfaces are also rough, so a soft gasket seals better on them than a hard ring.

Design it so that a leak does no harm

No seal is perfect for ever. A good design assumes that some water will get in one day:

  • Mount the board above the floor of the box, on posts, not flat on the bottom.
  • Put connectors and the board at the top, cable entries at the bottom.
  • In boxes that only need to resist rain, a small drain hole at the lowest point can be better than a perfect seal.
  • Keep mains voltage and water apart by distance and by separate chambers, not only by a gasket.

Test it before you trust it

A simple test finds most problems. Put dry paper tissue inside instead of the electronics, close the box exactly as in real use, with all cables. Then spray it from all sides, or hold it under water for half an hour, depending on your target. Open it and look at the paper. Repeat the test after the box was heated and cooled, and after the lid was opened and closed several times.

This is not a certified IP test. That needs a test lab. But it tells you in one afternoon whether the design has a chance.

Where this shows up in a project

On our platform, the sealing concept is part of the requirements before the 3D model starts: target rating, seal type, cable entries, vent and mounting position. The public project DIY Automatic Plant Watering System is an example of a device where electronics, a pump and a tank share one small space, and where every opening needs this kind of thought.

Watch hardware get built by AI. Follow public projects on makemachine.ai, read every result in full and get an email when there is something new.

Get started See the live projects

More from the blog

Open-hardware projects built with AI