Bench note
Enclosure tolerances before the filing session
You already drilled the holes
The board fits. The standoffs thread in. Then you realize the USB connector fouls on the inside rib, or the lid won't snap because a cap is 0.8 mm too tall, or the panel-mount toggle sits crooked because you eyeballed the hole. You file plastic for twenty minutes and promise yourself you'll measure next time.
Next time is now. Enclosure tolerances aren't about precision—they're about knowing what will bite you and leaving room before it does.
Start with the things that don't bend
Connectors, switches, and tall components define your Z-axis budget. Measure them with calipers, not the datasheet. A right-angle header that's spec'd at 8.5 mm might be 9.1 mm with the plastic shroud, and that half-millimeter will cost you an entire lid revision.
Write those heights into your board notes or bill of materials. If a cap is 12 mm and your enclosure interior is 13 mm, you have 1 mm of play—PCB thickness, standoff tolerance, lid warp. That's tight. Budget 2 mm minimum for anything you care about closing cleanly.
Check connectors along all three axes. A barrel jack might clear the lid but foul the side wall if you didn't account for its diameter plus the mating plug. Panel-mount parts need their mounting-hole diameter and the clearance behind the panel for the nut and any wire dress.
Walls and ribs are not your friends
Molded enclosures have internal ribs for rigidity. They also have draft angles so the part pops out of the mold. That means the wall isn't plumb, and the rib that looks 2 mm wide at the base might be 1.2 mm at the top.
When you're placing standoffs or planning board edges, assume the wall is 0.5 mm closer than it looks and the rib is 0.3 mm thicker. If you're 3D-printing your own box, your slicer's dimensional accuracy setting matters—most printers run 0.1–0.2 mm wider on inside features. Test-print a small bracket first and measure it.
Panel cutouts deserve a drill template
You can't correct a mis-drilled hole without a Dremel and regret. Make a paper template, tape it to the enclosure, center-punch through it, then drill pilot holes before you commit to the final diameter. For rectangular cutouts—like a small OLED or a rocker switch—use a step drill or file to final dimension after you've roughed it in.
Leave yourself 0.3–0.5 mm of wiggle room on all sides of a panel-mount part. The bezel or faceplate will cover the gap, and you'll thank yourself when the part actually drops in square. Fasteners matter here too: if you're using a locknut, the hole needs to be big enough that the nut doesn't bottom out on the panel before it clamps the part.
Lid fit and thermal reality
Snap-fit lids need 0.2–0.4 mm of clearance around the perimeter or they'll bind. Screwed lids need the same clearance or the screw boss will crack when you torque it down. If your box sits outside or near a heat source, plastic expands—ABS grows about 0.08 mm per 10°C per 100 mm of length. In a 150 mm enclosure going from 20°C to 50°C, that's 0.36 mm. It adds up.
If you're mounting a linear regulator or anything else that gets warm, your thermal relief strategy affects enclosure placement. A part that runs at 60°C will radiate into the lid. If the lid is polycarbonate and you're close to its deflection temp, you'll get warp. Space hot parts away from the lid by at least 5 mm, or add a heat sink that doubles as a spacer.
Document what you measured
Write down your clearance budget. It doesn't need to be formal—an annotated photo or a text file in the repo works. List the tallest components, the standoff height you chose, the actual PCB thickness, and how much room is left. When you rev the board or try a different enclosure, you'll know immediately whether it still fits.
Tolerance is just margin you planned for instead of discovered with a file. Measure twice, drill once, and your next build will close clean.