21
\$\begingroup\$

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).

\$\endgroup\$
  • 5
    \$\begingroup\$ I would use a bit of hot glue, which is easily removable. \$\endgroup\$ – vofa Jan 27 '18 at 16:39
  • 1
    \$\begingroup\$ Use a strip of Velcro. \$\endgroup\$ – Hot Licks Jan 28 '18 at 14:02
  • 3
    \$\begingroup\$ Double-sided foam sticky tape. \$\endgroup\$ – immibis Jan 28 '18 at 23:30
  • 1
    \$\begingroup\$ @immibis, that's a good idea. Except I used the foam sticky tape to hold a USB hub in one spot at work (while I was doing some signal strength measurements) and now it's stuck there forever :( So beware, might be a little too permanent. \$\endgroup\$ – Catsunami Jan 29 '18 at 18:41
  • 3
    \$\begingroup\$ Maybe I'm imagining things, but velcro sounds like an ESD disaster waiting to happen. \$\endgroup\$ – R.. Jan 29 '18 at 20:38

17 Answers 17

27
\$\begingroup\$

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).

\$\endgroup\$
  • \$\begingroup\$ might work as a very quick and dirty way of working but i wouldn't do it. the STM PCB has bottom side components and the double sided tape might tear them of with rough handling. \$\endgroup\$ – gommer Jan 27 '18 at 16:52
  • 2
    \$\begingroup\$ I didn't mention any glue. If you are referring to doublesided tape, it doesn't damage anything. If you have a source of any tape whose adhesive is that strong, please share! \$\endgroup\$ – Jeanne Pindar Jan 27 '18 at 16:58
  • 5
    \$\begingroup\$ I like the "cable ties on a custom base plate" approach very, very much! \$\endgroup\$ – Marcus Müller Jan 27 '18 at 17:01
  • 1
    \$\begingroup\$ I probably corrected glue to double sided tape while you were typing. the double sided tape with foam types that are used to stick objects to a wall: yes they could do this. Not from the first moment but after longer abuse. Remember that solder is actually very brittle and it can't really handle repeated stress very well. I know it's only a hobby project but I would like to avoid intermittent failures by cracked solder joints myself and avoid this solution. \$\endgroup\$ – gommer Jan 27 '18 at 17:09
  • \$\begingroup\$ Foamed doublesided tape used to hold mirrors at the wall is pretty adhesive. \$\endgroup\$ – Janka Jan 27 '18 at 18:30
31
\$\begingroup\$

You can buy (or 3d print) fasteners made for such a case. Search PCB mounting feet. These include a standoff to help cooling and prevent shorts.

te

\$\endgroup\$
  • 2
    \$\begingroup\$ excellent suggestion. I'd mount those on another piece of pcb and then fix the whole assembly to the existing studs on the bottom of the case. but OP's relay board is so small and cramped that there is no corner to attach to... \$\endgroup\$ – dlatikay Jan 27 '18 at 21:17
  • \$\begingroup\$ Thanks, never heard of this (but never done a project, let alone in an enclosure. \$\endgroup\$ – Michel Keijzers Jan 28 '18 at 12:52
  • \$\begingroup\$ I couldn't find the exact ones, but found one with a 'hole' instead of a corner, which will do too in case I use this method. \$\endgroup\$ – Michel Keijzers Jan 29 '18 at 21:03
20
\$\begingroup\$

I would try something like that:

POC

You assemble like that, put crazy glue on the legs, let it dry in the container. Then you can unscrew when fixed to pick up the device.

\$\endgroup\$
  • 1
    \$\begingroup\$ Very nice solution. \$\endgroup\$ – Michel Keijzers Jan 28 '18 at 12:48
  • \$\begingroup\$ Can you tell me the English name of this part? \$\endgroup\$ – Michel Keijzers Jan 28 '18 at 12:55
  • 4
    \$\begingroup\$ Nylon standoffs or spacers. \$\endgroup\$ – Karzon Jan 28 '18 at 13:23
9
\$\begingroup\$

I use Industrial-grade hook-and-loop fastener material (also known as Velcro). This works extremely well and is reliable over a long period of time.

It's easy to remove and replace the individual boards as needed.

The stuff we use comes from Aplix. If you do a electronics.stackexchange search for "Aplix", you will find the part number of the Aplix product that I use.

\$\endgroup\$
  • \$\begingroup\$ Thanks, I will check (but note this is at least for now a 10 euro project (at least the electronics part). \$\endgroup\$ – Michel Keijzers Jan 28 '18 at 13:00
9
\$\begingroup\$

You could try this: cut two pieces of rubber or soft plastic pipe or hose, a little bit longer than the PCB. Cut a groove on their side and insert them on both sides of the pcb. Then drill holes throught the pipe to fix them in the case. Attention: the picture is not related to my answer. Just gives a visual idea.

pcb side fix

\$\endgroup\$
6
\$\begingroup\$

For ease of removal but holds under gentle handling, I would use 2 or 3 "dots of hot glue to PCB bottom and try to avoid solder joints or high frequency signals. (RF)

This can peel off pretty easy if small enough. So only use just enough to hold with the minimum surface area.

For permanent mounting I highly recommend sub-floor adhesive ( aka Polyurethane) This is semi-rigid, take a couple days to fully cure but is non-toxic and bonds very well. This is cheap and comes in big extrusion tubes from any home hardware store. It is the consumer grade of what Pro's use for big parts in power supplies.

enter image description here The tube end must be sealed from air leaks to prevent drying too deep which is a PITA between usage. I use Electrical tape.

The case can be filed to allow space for the cable and gentle clamp without damaging cable.

\$\endgroup\$
5
\$\begingroup\$

For the relay, I'd simply consider glueing two pieces of scrap wood or plastic to the bottom of your casing, so that it can't shift around. To prevent it from falling/jumping out of that "cage", you could "push it down" using another piece of the right length glued to the top of your casing, with a bit of soft material (rubber? The things you put under furniture feet to prevent them from scratching the floor?), attached to it.

That way, it would be safe in place as long as the lid is on the casing, and extractable when opened.

For the PCB: It really depends. As a quick and dirty method, maybe just screw a piece of flexible rubber (cut from a bike tire?) between two of your case's screw holes and "clamp" the PCB underneath.

More permanently would be a solution where you design a board with the right female pin headers to just plug in your PCB, but with screw holes to affix it to the case directly.

\$\endgroup\$
  • 1
    \$\begingroup\$ The pin headers seem to be in the common 2.54mm raster, that way one could use a cheap prototype board for the female headers instead of designing one. \$\endgroup\$ – Turbo J Jan 27 '18 at 16:50
  • \$\begingroup\$ yep; the custom board might be necessary / helpful if any of these pins are meant to carry signal :) \$\endgroup\$ – Marcus Müller Jan 27 '18 at 17:02
  • \$\begingroup\$ Good idea about 'pushing' blocks and rubber. \$\endgroup\$ – Michel Keijzers Jan 28 '18 at 13:01
5
\$\begingroup\$

I wanted to recommend hot glue, but it already was mentioned.

Alternatively, you can cut/drill 2 or 4 holes in the enclosure and clamp the PCB.

enter image description here

\$\endgroup\$
5
\$\begingroup\$

"the box will be moved regularly". That means regular knocks and thumps, which sooner or later break everything which can float or vibrate freely. You should have some solid blocks with grooves to prevent the parts moving. There's no need to make holes in the case for screws if you make a PCB assembly which has holders for the parts. The groove blocks are fastened with screws.

Tight grooves are difficult to make, slightly loose ones are easier. A piece of soft rubber can be glued to the PCB to prevent the parts vibrating in their grooves.

If you want to have an enclosure to keep out dirt and water, it can't have holes. Cable feedthroughs must be tight and stop all tension and twisting which otherwise would break the connectors on the PCB. Use proper feedthrough adapters.

Cooling through the enclosure without holes is well possible, but you must test the temperature rise with a proper dissipation test with a resistor. Hopefully you know how much your electronics will dissipate. Aluminium has superior thermal conductivity when compared to common plastic case materials.

About glue:

  • if the joint comes unstuck at the edge, the fault advances because the already loose part is an extending lever for the vibrations
  • many easy to use glues become weak well below 100 degrees centigrade
  • adhesive tapes cause often chemical reactions with other materials - the joint becomes goo after few weeks or months. Industry uses proper adhesive+material combinations, but an individual cannot get them.
\$\endgroup\$
  • \$\begingroup\$ Read more deeper, I use plastic casing (at least for my first project), since I don't want to spend more than needed (in case it will not work anyway). For this project it will not dissipate much (planning to run it at the lowest speed, but later I might need more. I will check what a dissipation test means (never heard of). \$\endgroup\$ – Michel Keijzers Jan 29 '18 at 20:57
4
\$\begingroup\$

I'd unsolder the four-pin connectors, and use something like this to stack vertically onto a rectangular piece of grid PCB which I'd attach to the four studs on the bottom. Support the side that's not soldered into the lower PCB with two small spacer bolts, and you're good.

Holes for cooling: What you have so far, is all small-signal and probably uncritical. As you mentioned that you consider adding a third board, you may need an estimate of the power that the assembly is going to dissipate under load. Some information related to this can be found here.

\$\endgroup\$
  • \$\begingroup\$ I'm not sure if there is place in my enclosure to fit it vertically but like the idea. Thanks also for the heat link,, altough it seems a lot of formules to go through. I don't expect that much heat generation. \$\endgroup\$ – Michel Keijzers Jan 28 '18 at 12:51
4
\$\begingroup\$

Double-sided tape has already been brought up, but I wanted to mention a particular type:

Acrylic tape

acrylic tape

  • Adhesion is very strong, and the tape is typically thick enough to allow protrusions to sink in. This allows it to hold against the uneven component heights, or even just the tips of pin headers.

  • Doesn't tear/flake like foam tape, which makes for easier removal.

  • Because it's clear, you can use it over LEDs, read silkscreens/components, or see if magic smoke has been released underneath.

\$\endgroup\$
  • \$\begingroup\$ Thanks... might be nicer than glue to ' stick' the relay to the enclosure. \$\endgroup\$ – Michel Keijzers Jan 29 '18 at 15:20
4
\$\begingroup\$

I've mostly used for exactly same applications arduino NANO shields with screwholes or I've made them. Both versions are showed below, but also consider using M3 spacers (M3 is unwritten standard for all electronics) and try to collect some different lenght spacers and different polarities (male-male, male-female, female-female), as they come very helpfull.

PS: Some chinese copies even have holes at the edges holes for M2 or M2.5 sc

enter image description here

And the way, you can make your own from soldering protoboard: just cut as the red line goes and drill the 3mm holes where the arrows show and for the same distance between those 2 holes, another 2 holes int othe plastic case. Below your new "shield", add 8mm (or more) M3 spacers and tighten the shield from both sides. When you solder those black female header pins, you don't need to connect them anywhere, they're there only for holding arduino down. enter image description here

female header pin: enter image description here

\$\endgroup\$
  • \$\begingroup\$ Sounds like a very good idea, I will check also for the spacers. Thanks \$\endgroup\$ – Michel Keijzers Jan 29 '18 at 17:07
  • 1
    \$\begingroup\$ Thanks. Spacers are quite cheap, you can get 100pcs for about 5$ over the web. I'm using 10mm most often (female-female) and in 99.5% of my electronics, I use M3 screws. It's a good way to "standardize" your screws and nuts. That's why I keep about 50-60 different M3 screws (lenghts, heads, materials). \$\endgroup\$ – Jakey Jan 29 '18 at 18:55
  • 1
    \$\begingroup\$ thanks ... yes I also going to order a set. This will not be my first project anyway. \$\endgroup\$ – Michel Keijzers Jan 29 '18 at 19:49
  • 1
    \$\begingroup\$ They are called "female header pins". I've corrected my answer to show you photos of them. \$\endgroup\$ – Jakey Jan 29 '18 at 21:55
  • 1
    \$\begingroup\$ Yes. Also consider buying "extended header pins" in case you will be doing arduino shields for etc. Uno or Mega2560. Shields are stacking one onto another easier. Also you could buy "professional header pins", but I personally don't like to use them. Never did. \$\endgroup\$ – Jakey Jan 29 '18 at 22:38
3
\$\begingroup\$

To expand the notion of the PCB stock to provide a floor in this box.

I would mount stands into the floor that would hold the circuit boards at the height they need to be in order to stay cool. Then I would build an L or U shaped bracket that would hold the board down on the stands. Looks like L brackets are your best bet given the boards that are in them.

The stands can be out of anything rigid. I would probably avoid metal but no matter what I used I'd what some form of rubber pad between the circuit board and the stands and L brackets.

The rubber serves 2 purposes. First, it should keep the circuit from sliding at all. A tight fit with the stands and brackets will prevent sliding as well. Second, and more importantly, the rubber will reduce any high frequency vibrations transmitted from the box to the circuit boards. Not a lot but sometimes a little is all you need.

\$\endgroup\$
  • \$\begingroup\$ Thanks for these comments ... later maybe I want to add RF signals so it might be needed. \$\endgroup\$ – Michel Keijzers Jan 28 '18 at 12:57
2
\$\begingroup\$

Hot glue wont last and or stick well to plastic cases.
So at first i would use a silicon caulk kind or glue which holds it but is easily removable. Or neater and hybrid answer would be to make a bracket that takes some kind of zip ties or nylon clasps that bond your boards to the bracket. then glue those brackets with the silicon caulk to the inside of the chassis it will be insulated and alters nether the boards or the case. also keeps the caulk off your circuit boards. Thats why i recommend saving parts out of junk. you always need something for a homemade project or prototype

\$\endgroup\$
1
\$\begingroup\$

Drive-by answer but coming from outside an outside perspective I would do this using Kaizen foam.

They sell it as an organizational aid but it's got a thousand hobby protective uses once you start thinking about it. I'd just cut a small block sized to that box then cut out a few spaces for the boards, make a nice channel for the wiring and cut a little notch at the of the cap for wire exit (can make a gasket for the notch with a little dot/dab of silicone that will (after it's dried) "smush" against the exiting wire to make a good makeshift seal.

I've worked with foams but the Kaizen stuff's pretty balls-simple once you get the hang (only need a retractable snap-off blade and your fingers and watch some youtubes or on their site they have good vids). It comes as 2x4 ft sheet in different thicknesses. The thick ones around 2 1/8" and I use that most. I just noticed that reads a lot like a commercial. Sorry. No affiliation just a happy camper.

Here's a link to the foam. They have good vids too - Kaizen at main supplier

Also, just found it on Amazon in the 7/8" thick Kaizen on Amazon

\$\endgroup\$
  • \$\begingroup\$ Sounds really good, but a bit costly (Amazon shipping is not free to the Netherlands). I found however audio foam on aliexpress (about 1 euro)... or do you think it could contain conductive material? Or cause heat problems. For your foam, I really take it into account in projects when I'm a bit more experienced :-) \$\endgroup\$ – Michel Keijzers Jan 29 '18 at 10:12
1
\$\begingroup\$

If you can find a box which your things fit in snugly, you could use potting compound to hold it all in place.

\$\endgroup\$
  • \$\begingroup\$ Thanks (seems a bit costly for my project, but maybe if I need it more in future it is useful). \$\endgroup\$ – Michel Keijzers Jan 29 '18 at 10:08
1
\$\begingroup\$

Yet another option is to use plastic screws or fasteners:

enter image description here

Drill holes outside the area occupied by the module, then fasten the screws to hold it firmly in place. Unscrew when you want to remove/replace a module.

Another option is to get an enclosure which is a better fit. If I'm not mistaken, your MCU module has the "Arduino Nano" form-factor. Goodling for "arduino nano enclosure" shows plenty of options, some of which have some space for additional modules. Or you can just make one with Lego bricks and super glue.

\$\endgroup\$
  • \$\begingroup\$ Do you mean to drill them in the enclosure? Or you mean on the component in unused area? (not sure what you mean with ' module' ) \$\endgroup\$ – Michel Keijzers Jan 29 '18 at 13:13
  • \$\begingroup\$ @MichelKeijzers The modules occupy some of the area of the case. Holes for the screws should be made in the enclosure, just outside of that area. When screws are fastened, they will hold the modules in place. \$\endgroup\$ – Dmitry Grigoryev Jan 29 '18 at 13:54
  • \$\begingroup\$ Ah ok clear ... I'm not sure if I want to make (temporary) holes in the enclosure, but for the final version it might be a good way to fix them tight. \$\endgroup\$ – Michel Keijzers Jan 29 '18 at 13:56
  • 1
    \$\begingroup\$ @MichelKeijzers BTW, try googling for Arduino Nano Enclosure and see if anything attractive comes up. \$\endgroup\$ – Dmitry Grigoryev Jan 29 '18 at 13:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.