Electronic – How to ‘fix’ this in an enclosure without glueing


enter image description here

I have an enclosure, and want to fix/put a STM32 inside, a relay and probably later a small circuit board.

However, the STM (STM32F103C8T6) and the relay do not have holes to fix them… and I do not want to glue them because maybe later I want to change/add components.

What is the best way to do this?

Note the USB cable will be get a separate hole to attach (or maybe even a separate connector in the enclosure. The enclosure itself will be attached to a box that will be moved regularly (even during working conditions).

Also, I wonder if holes would be needed to prevent too much heating. The STM32 will run on a very low frequency initially, but later maybe on 72 MHz.

(I know putting this is not entirely an electronics question, however, I think it's better appropriate here because more people doing electronics have experience how to handle my problems. It's the first time I use an enclosure).

Best Answer

Cut a piece of pcb stock (or any sheet plastic) to fit properly in the housing, including screw holes to match those bosses.

Then attach your components to this base plate either with double sided tape, velcro, or cable ties going through holes in the plate.

Run the cable through a notch in the edge of the housing rather than a hole so it can be easily removed, but won't pull out by accident (unless you want it to be removable in the field).