How to Design an Enclosure for Electronics

A custom project box beats a generic one every time — it fits your board exactly, has holes in the right places, and looks finished. Here is how to design an electronics enclosure from scratch, even if you have never used CAD.

Start with the inside, not the outside

The enclosure exists to hold the board, so measure the PCB first: length, width, and the tallest component on top. Then design the internal cavity around it with clearance — a couple of millimeters on each side, and a few above the tallest part. Build a box around the contents rather than guessing at a size.

Create a rectangular enclosure with a 84 x 56 mm inner cavity,
25 mm deep inside, 2.5 mm walls

With PartWork.ai you describe the cavity and it builds the walls outward. See Creating Parts for prompt tips.

Add mounting bosses and a lid

Most boards have mounting holes. Add bosses — small posts the board screws into — so it sits off the floor:

Add four 6 mm diameter mounting bosses, 4 mm tall, with 2.5 mm holes,
positioned for an 80 x 52 mm hole pattern

For the lid, design a separate flat cover that drops into the top with a snug fit. Aim for about 0.2 mm of clearance so it seats without forcing — see tolerances for 3D printed parts for the exact gap. Need to nudge a boss after seeing it? Just describe the change — more in Modifying Parts.

Cut openings for ports

USB, power, buttons, an LED — each needs an opening. Place them by describing the wall and the position:

Cut a 9 x 4 mm USB-C slot in the short wall, centered, 6 mm up from the floor

Leave room for connectors

Make cutouts a half-millimeter larger than the connector body, and check the plug shroud clears the wall. It is the most common reason a finished case will not close.

Design your enclosure now

Start with 2 free AI generations — no card required

PartWork.ai runs in your browser — describe the box, the bosses, and the cutouts, get editable 3D geometry, export an STL for printing. Open the studio. Need more after your free generations? 100 credits for $4.99 (about 5¢ each).