Ingress protection (IP) ratings explained

The marine environment is harsh and often has a high chance of water entering boxes where it shouldn’t. How do I know if I have the right level of protection in a box or enclosure against water ingress?