A typical machined electronics enclosure combines a 2 to 3 mm aluminum wall, M3 or M4 mounting bosses, and a gasket groove that holds dust and moisture out of the housing. It must carry a PCB on a fixed hole pattern, seal against intrusion, route cables and connectors through the walls without admitting water, and present a finished appearance when the customer opens the product. Sheet metal reaches the same goal cheaply at high volume, but a machined aluminum enclosure wins on prototypes, low volumes, and products needing tight tolerances, EMI shielding, or a premium look. This guide covers the geometry a machined enclosure requires, the tolerances that matter, and the shop-floor choices that keep the PCB fitting on the first attempt.
Starting from the PCB mounting pattern
The enclosure exists to hold the board, so the board defines the inside dimensions. Start from the PCB outline, mounting hole positions, and connector locations. Mounting bosses inside the box use M3 or M4 tapped holes on a 2.5 to 4 mm wall, raised three to five millimeters off the floor so the board sits clear of the base. Boss height tolerance runs ±0.2 mm: too tall and the board sits crooked, too short and the screw bottoms out.
Position the bosses on the PCB drill pattern rather than the enclosure wall, and hold hole positions to ±0.1 mm relative to the outside datums. When the enclosure mates to a front panel, the PCB holes and panel cutouts share the same datum stack so connectors line up with their openings. The bolt hole patterns guide covers spacing rules, and the enclosure design tips article walks through boss-to-wall distances that keep walls from flexing.
Wall thickness, stiffness, and tool access
A machined aluminum enclosure wall runs 2 to 3 mm on a small box under 200 mm, and 3 to 4 mm on a larger one. Thinner walls flex when screws drive in and leak at the gasket; thicker walls waste material and add weight. The inside pocket mills from a solid block or an extrusion, leaving a floor, four walls, and a removable lid. Floor thickness stays above 1.5 mm for stiffness.
Internal corners in the pocket carry the end-mill radius, usually R2 to R6 mm depending on wall thickness. If the PCB carries a square corner that must sit tight, add a clearance notch in that corner rather than demanding a sharp internal radius the cutter cannot produce. On a two-piece enclosure with base plus lid, the parting line forms a flat machined face, and the lid seals with a continuous gasket groove cut into that face, typically a 2 by 2 mm O-ring groove. The housings and enclosures article covers the two-piece and one-piece options.
Connector cutouts and EMI shielding
Every cable entry in the box ranks as a potential leak point. USB, HDMI, DB9, and power entries need cutouts matching the connector front-panel profile, usually milled to ±0.1 mm so connector screws line up cleanly. For round cable glands, tap a 1/2 NPT or M20 hole in the wall and use a standard gland sized to the cable diameter.
EMI shielding marks where machined boxes outperform plastic ones: the aluminum wall itself conducts, and the parting line receives a conductive gasket or a series of spring fingers. For EMC compliance, skip paint on the mating flange and leave it bare anodized or nickel-plated, since powder coat breaks the ground path. For heat-generating boards, machine fins into the outside of the box rather than bolting on a separate heat sink; the CNC heat sink guide covers fin spacing and base thickness that transfer heat efficiently, and the PCB itself bolts to an internal boss pattern that also acts as a thermal path to the outside wall.
Internal standoff spacing should clear wire harnesses and keep connector bodies from touching the enclosure wall, while screw bosses leave enough room for a driver without colliding with adjacent components. Cable relief near gland entries protects insulation from a sharp edge, and a consistent boss height keeps the board parallel to the base so connector stacks align with their panel openings.
Sealing, finish, and lid design
An enclosure needing IP54 or IP67 seals on the parting line. The O-ring groove cuts into the base flange, and the lid compresses the ring to 15 to 25 percent of its cross-section. Lid screws run M3 or M4 on a 50 to 80 mm spacing, and screw bosses stay clear of the O-ring so clamp force does not pinch the ring off center.
Finish choice drives both appearance and sealing behavior. Clear or black anodize on aluminum delivers a durable, slightly matte surface and adds ten to fifteen microns of thickness, so machine the gasket groove after anodizing when tolerance runs tight. Powder coat adds 40 to 80 microns and breaks EMI continuity, reserved for non-sealed, non-shielded boxes. Bead-blast plus anodize supplies the premium finish, while visible milled tool marks read as the industrial look; the chosen option belongs on the drawing, since the shop cannot infer it from the model alone. Before sending the file, assemble a five-item checklist: PCB outline overlay, connector panel cutouts with the exact model, IP rating, finish and bare-EMI surfaces, and the lid screw pattern.
