Ingress Protection ratings

Ingress Protection (IP) ratings measure how resistant a device is against dust and water.

IP ratings usually have two numbers:
1st number: The level of protection against solid objects (e.g. dust)
2nd number: The level of protection from liquids (e.g. water)

The higher the number, the better the protection – let’s take a closer look…

IP: 1st number – protection against solid objects

5 Dust resistant
6 Dust proof

IP: 2nd number – protection against liquids
2 Resistant to splashes
3 Resistant to light rain
4 Resistant to heavy rain
5 Resistant to low pressure jets of water from all directions
6 Resistant to very short periods in water
7 Resists immersion for up to 30 minutes at up to 1m of water
8 Resists long periods of submersion underwater

So, a product with an IP rating of IP54 has level 5 protection against dust and level 4 protection against water, which means it would be fine to use in harsh environments like factories and there would be no problem using it in the rain, but it may not survive being dropped in a swimming pool!
When the device is only protected from one of these an X is put instead of a number to show there is no resistance against that element.

For example, IPX4 means that a device is not protected from solid objects, but is against sprays of water.

Remember: only devices with IP68 rating are completely waterproof!
MIL-STD 810 C, D, E and F:

This is a US standard that tests devices not just for resistance to water and dust, but also to shock, extreme temperatures and vibration, etc.