Suppose I would like to insert data-cables of varying diameters -- e.g., a cable of 5 mm diameter -- into the 6 mm diameter hole of a plastic enclosure. The wires within the cable are terminated via soldering to a PCB inside the enclosure.

What methods are used in the industry to ensure that pulling the cable won't make it slide in and out of the enclosure (thus preventing damage to the wire connections to the PCB inside)?



Some options that I have considered:


Two small lengths of thick heat shrink tubing placed around the cable, both just inside and just outside the wall of the enclosure. If the tubing is wide enough, then it will block the cable from sliding. This could work but may have to use too many layers of tubing and also the fit just by friction alone may not be strong enough.
Apply a thick layer of rubber-compatible adhesive in a circle around the cable, both just inside and just outside the wall of the enclosure. The glue blob would act as sort of a bolt/washer. This is too messy in practice, and probably not usable professionally.
Use rubber-and-steel-compatible adhesive to place two bolts around the cable, one just inside and one just outside the wall of the enclosure. The problem with this is that it is hard to find an adhesive that bonds well to both rubber and steel.


There are a few industry approaches to this.

The first is molded cables. The cables themselves have strain reliefs molded to fit a given entry point, either by  custom moulding or with off the shelf reliefs that are chemically welded/bonded to the cable. Not just glued, but welded together.



The second is entry points designed to hold the cable. The cable is bent in a z or u shape around posts to hold it in place. The strength of the cable is used to prevent it from being pulled out.



Similarly, but less often seen now in the days of cheap molding or diy kits, is this. The cable is screwed into a holder which is prevented from moving in OR out by the case and screw posts.


Both of those options are a bit out of an individual's reach.

The third is through the use of Cord Grips or Cable Glands, also known as grommets. Especially is a water tight fit is needed.



They are screwed on, the cable past through, then the grip part is screwed. These prevent the cable from moving in or out, as well as sealing the hole. Most can accommodate cables at least 80% of the size of the opening. Any smaller and they basically won't do the job.

Other options include cable fasteners or holders. These go around the cable and are screwed or bolted down (or use plastic press fits). These can be screwed into a pcb for example.



Cable grommets are a fairly hacky way of doing it, as they are not designed to hold onto the cable. Instead they are designed to prevent the cable from being cut or damaged on a sharp or thin edge. But they can do in a pinch. As can tying a knot, though that mainly prevents pull outs, but might not be ideal for digital signals. Pushing a cable in doesn't happen too often, so you might not worry about that.

Similar to the second method, is using two or three holes in a pcb to push a cable through (up, down, up), then pulling it tight. This moves the point of pressure away from the solder point and onto the cable+jacket.


The other industry method is avoiding all this in the first place, by using panel mounted connectors (or board mounted connectors like Dell does for power plugs, yuck).
