Your PCB layout is making enclosure decisions for you right now, whether you realize it or not.

Your PCB layout is making enclosure decisions for you right now, whether you realize it or not.

And most of them are wrong.

Most product creators finish their board first, and then plan to design an enclosure around it later.

And that's where products get into trouble, because at least seven enclosure decisions directly control how your PCB needs to be laid out.

Make those calls too late, and you're looking at a board respin that costs you a month and a few thousand dollars, a tooling change on a mold that already cost you tens of thousands, or an ugly compromise that ends up shipping in production.

Which comes first, the PCB design or the enclosure design?

The answer is both.

If the electronics are the most complicated part of your product, let the board lead, and if the appearance is what really sells it, let the enclosure lead.

But either way, you have to take the other one far enough along to know the two will meet, and what you can't do is ignore one completely while you work on the other.

To do that, you need to lock in these seven constraints before you finalize your component placement and routing.

That's how you design a complete product, instead of designing a board you have to force into a box that was never made for it.

So in this video, I'm going to walk you through all seven of them, and the one I saved for last is the one that's almost impossible to fix once your board is routed.

Click here to watch or read

Decision #1 - Off-the-Shelf or Custom Enclosure?

Choosing between an off-the-shelf enclosure and a custom one is the master decision, because it determines who has to conform to whom.

With an off-the-shelf enclosure, your PCB conforms to the enclosure.

The board outline, the mounting hole positions, and the wall openings are already fixed in a datasheet from companies like Polycase, Hammond, or Bud Industries.

Then you just download their drawing, design your board to match it, and you're done.

It's cheap, it's fast, and for plenty of products it's completely fine.

There's also a middle path, because most of these companies will machine your custom openings into a stock enclosure for a pretty small fee.

That gets you a housing that looks custom enough for a lot of products without ever paying for a mold.

A custom enclosure means the board and the enclosure become a co-design, where neither one is fixed and both get developed together.

For early units that usually means 3D printing or urethane casting, and once you reach production volume it means injection molding.

With my own product, the enclosure drove far more iterations than the electrical parts, and I went through about a dozen 3D printed versions before everything fit together properly.

The molds for it ended up costing a little over $100,000, and that's not a typo.

They were that expensive because my manufacturer was confident enough in the product that they wanted to go straight to multi-cavity, high-volume tooling, and normally I'd never tell anyone to jump from prototypes to molds like that.

But they covered the upfront cost and just charged me an extra dollar per unit on the first hundred thousand units, so they were carrying the risk, not me, which made it an easy yes.

So how do you decide between off-the-shelf and custom?

It mostly comes down to your expected sales volume, how much the look of the product matters, and whether you need serious dust or water protection.

The practical move is to go shopping for stock enclosures before you commit to a board outline, because if you find one that works, you've just skipped the entire custom path.

Decision #2 - How Your PCB Mounts

Every board needs a way to physically attach inside its enclosure, and you've really got three options, screw bosses, snap fits, or card slots.

Screw bosses are the little plastic posts molded into the enclosure that your board screws down onto.

Snap fits hold the board with small plastic clips instead, and card slots let the board slide into rails molded into the walls.

Just be careful with snap fits on 3D printed prototypes, because printed plastic doesn't flex like molded plastic, and clips that work perfectly in a print can fail in production, or the other way around.

Whichever one you pick settles a surprising amount of your layout.

We're talking the number of mounting holes, exactly where they sit, their diameter, whether they're plated or non-plated, the keep-out zones around each hole, and your edge clearances.

That plated or non-plated choice matters more than it sounds, because plated holes with metal screws and standoffs often become part of your grounding strategy.

And this is a classic cause of a full respin, because adding mounting holes to a board that's already routed means ripping up finished copper and re-routing everything around them.

Decision #3 - Connector and Port Placement

Every cable that plugs into your product has to enter through a specific wall, and those entry points need to be settled before you route the board.

For each connector, you need to know which wall it exits, how high it sits above the board, and whether it's a right-angle or vertical part.

You also need to decide if it mounts directly on the PCB, or on the panel with a pigtail, which is just a short cable running back to the board.

Those choices lock in your board outline, the exact connector part numbers you buy, and the tolerance stack between the connector face and the enclosure opening.

That tolerance stack is where designs that fit perfectly in CAD fall apart, because the board, the connector, and the enclosure each come out slightly different from the dimensions on the drawing.

So always design in real clearance based on worst-case tolerances, instead of assuming every part lands exactly on its ideal dimension.

Also keep in mind that board-mounted connectors feed every plug and unplug force straight into their solder joints, while panel-mount versions take that stress off your PCB completely.

And when this gets decided too late, you get the product where the USB port sits 1mm too deep behind the enclosure wall, and some cables never quite click in.

Decision #4 - Maximum Component Heights

Your enclosure hands you a fixed interior height budget, and every part on the board has to live inside it.

That budget covers your tallest components, things like electrolytic capacitors, inductors, connectors, and shields, plus wherever the battery sits and any board-to-board stacking.

Don't forget that wall thickness and any internal ribs eat into that budget too.

And if anything on your board runs hot, the way you get that heat out comes out of this same budget, whether that's a heatsink, a soft thermal pad that presses against the enclosure wall so the enclosure itself sheds the heat, or just clearance for air to move around the part.

The battery deserves special attention here, because it's usually the single biggest space claim inside the enclosure, and switching from a cylindrical cell to a flat pouch cell late in the game changes everything around it.

Locking this in early determines which components you can even select, which zones of the board they're allowed in, and sometimes which side of the board they go on.

A 2mm surprise on a single part is all it takes, and then you're choosing between a taller enclosure, which means a tooling change, or a re-layout of the board.

The simple tactic here is to keep a running height map of your board, or better yet, export the 3D board model and check it against the enclosure model from your very first placement pass onward.

Decision #5 - User Interface Positions

Buttons, LEDs, and displays need to sit where they make sense for the person using the product, not where they happen to be convenient for routing.

A power button that ends up on the bottom of the product, just because that's where routing was easy, is the kind of thing customers complain about forever.

Once those positions are fixed, a bunch of details follow, like whether each LED mounts right at the wall or shines through a light pipe, which is just a clear plastic piece that carries the light out to the surface.

You'll also need to nail down your tact switch heights and button actuators, plus the alignment and tolerances for any display window.

Displays are the strictest of all, since the viewing window, the mounting, and the connector routing all have to line up within a fraction of a mm.

The failure here is an LED that ends up nowhere near the front panel, and then gets patched with a long light pipe snaking across the enclosure or a wire flying off the board.

So mark up your panel positions on a printed mockup before you place a single LED, because it takes about an hour and it locks the position of every part sitting behind that panel.

Decision #6 - Ingress Protection Rating

If your product needs any protection against dust or water, you need to pick your target IP rating before you start layout, instead of waiting for certification time.

IP stands for ingress protection, and it's the standard rating that defines how well your enclosure keeps dust and water out.

That one number ripples through your whole PCB, because sealed connectors have different footprints and cost more, gasket channels eat up space around the board edge, and buttons often become sealed membrane switches instead of through-wall tact switches.

You may also need vent membranes, which are small patches that let air pressure equalize while keeping water out, and those have to be planned into the walls too.

And even if the answer is that you don't need any sealing at all, make that call on purpose, because it frees you up to use cheaper connectors and simple through-wall buttons.

So if an IP65 requirement, meaning dust-tight and able to handle water jets, shows up after your layout is done, you're basically restarting the mechanical design and most of your connector selection from scratch.

Decision #7 - Enclosure Material and Your Antenna

The material your enclosure is made from is the most expensive decision on this list to learn about late, which is exactly why I saved it for last.

If your product has any wireless function and you put it inside a metal enclosure, your internal antenna is dead, because the metal acts as a shield that blocks the radio signal.

That leaves you with an external antenna, which adds cost, hurts the look of the product, and can affect your certification testing, or it forces you back to a plastic enclosure.

That's why plenty of wireless products use a plastic end cap or window on an otherwise metal body, it gives the antenna a spot to radiate through.

A plastic enclosure keeps your antenna alive, but it still drives your layout, because the antenna needs a keep-out zone with no copper around it, and it needs to sit near the correct wall of the product.

And that keep-out isn't just the top layer, it means no copper on any layer under or around the antenna, including your ground pours, and your module vendor's datasheet will give you the exact dimensions to respect.

Plastic still pulls on the antenna a little, because any material sitting right next to it shifts the tuning, which is why you tune the antenna with the enclosure in place instead of on a bare board sitting on your bench.

Even the finish matters, because metallic paint on a plastic enclosure can choke your antenna almost as much as a metal wall.

Get this one wrong, and you end up with wireless range problems that no firmware update will ever fix, and that's how products die right at the finish line.

Talk soon,

John

P.S. If you need help working through enclosure decisions like these for your own product, then you can get help from me and other experts inside the Hardware Academy.