Learn / PCB and making / Enclosures and 3D printing

Designing an Enclosure That Fits

ReviewedIntermediate MakerAbout 6 min
In short

Designing an Enclosure That Fits: the short answer

Start from measurements, not guesses. Measure the PCB outline, the mounting hole positions and diameters, and the tallest component with a vernier caliper, or better, export a 3D model of your KiCad board as STEP and design the box around it.

Level
Intermediate
Time
About 6 min
Topic
PCB and making
You will learn to

Design a printed enclosure around a real board with standoffs, openings, airflow and fixings that work first time.

Before this: 3D Printing Basics for Electronics, Planning a Prototype

Start from measurements, not guesses. Measure the PCB outline, the mounting hole positions and diameters, and the tallest component with a vernier caliper, or better, export a 3D model of your KiCad board as STEP and design the box around it. Add clearance on every side: about 1 mm between the PCB edge and the inside wall, and 2 to 3 mm above the tallest part. Note every opening you need: USB, power jack, buttons, LEDs, sensors and a display window.

Mount the board on standoffs, never loose. Printed bosses with 2.5 mm holes take M3 self-tapping screws in PLA, or use brass heat-set inserts pressed in with a soldering iron for threads that survive repeated opening. Standoffs 3 to 5 mm high leave room for solder joints underneath. Line up connector openings with the actual connector position and make them 0.5 mm larger on each side; a USB plug's moulding is larger than the socket. Light pipes or thin printed walls (0.4 to 0.8 mm) let LEDs show through.

Plan for heat, air and water. Regulators and Wi-Fi modules warm the air inside; add vent slots low on one side and high on the other so air flows through, and put temperature and humidity sensors in a separate vented section or outside the box. Avoid metal close to Wi-Fi antennas. For outdoor use, a printed box is rarely watertight; use a commercial IP65 box with cable glands, or add a gasket, and orient openings downwards with a drip loop on cables.

Measure the real parts

Start with the board's actual dimensions, mounting holes and the height of the tallest part, and measure with calipers instead of trusting a drawing. Leave a gap of 1 to 2 mm around the board, and room for cable bends, since a USB or power plug needs space beyond the socket.

Mark where each connector, button, LED and sensor needs an opening, and check the cutout sizes against the plugs, not only the sockets.

Printing and tolerances

A 3D printer makes holes slightly small and parts slightly large, so allow about 0.2 to 0.4 mm of clearance on mating parts and test with a small piece first. Use standoffs or bosses for the mounting holes, and heat-set inserts or screws into plastic for parts you will open more than once.

Design for assembly: can you get your fingers or a screwdriver to every screw, and does the lid come off without pulling the wires?

Heat, light and water

Parts that heat up, such as regulators and motor drivers, need vents or a thermal path. Sensors that measure air or light need openings that do not let internal heat or LED light affect them. For outdoor use, an enclosure needs gaskets and drip edges, and cable glands for the cable entries.

Common mistakes
  • Designing from a datasheet drawing without measuring the real board.
  • Using exact dimensions with no clearance for the printed tolerance.
  • Putting a temperature sensor next to a heat-producing part inside a closed box.
Intermediate lesson · Maker plan

Practise this lesson with Maker

The explanation above is free for everyone. The practice for Intermediate lessons in every domain are part of the Maker plan at ₹499 a month, and Pro includes them too.

With Maker you also get: a worked example, a hands-on task, a 3-question check.

Common questions

What will I learn in "Designing an Enclosure That Fits"?

Design a printed enclosure around a real board with standoffs, openings, airflow and fixings that work first time.