Potting or overmoulding? How cable assemblies and microswitches are sealed

Potting and overmoulding protect connection points against moisture, oil, dust and vibration. How the two processes work, how they differ and which details the enquiry needs.