An enclosure for my PCB (ESP32 example)
Wrap a real dev board in a printable case with a snug fit, port cutouts, vents, a lid and screw bosses, using the ESP32 as the worked example.
Follow along
Enclosure example
A bare circuit board is fragile and ugly. A well-made enclosure protects it, cools it, and makes it feel like a product. This playbook builds one around an ESP32 dev board, but every step applies to Arduino, Raspberry Pi or your own PCB.
What you will end up with: a two-piece case (box and lid) with the board held in place, a cutout for the USB port, vent slots, and four screws holding the lid on.
1. Start from the real board
Dev boards are in the Bought pieces library with their real dimensions: ESP32, Arduino, Raspberry Pi and more. Use the real thing instead of typing dimensions from memory.
Add an ESP32 DevKit V1 board from the library. Then design an enclosure around it.
The board arrives as a Bought piece with its true size, connector positions, and mounting details. The board can be a choice parameter (board), so changing it later updates the enclosure.
2. Decide how the board is held
Many ESP32 dev boards have no mounting holes at all. Check yours.
- If the board has holes: use standoffs and screws. The agent has a standoff feature for this.
- If it has none: hold it with a snug pocket, small side ribs, and a lid that presses down. This is just as secure for a project box.
The board has no mounting holes. Make a pocket that holds it with 0.3 mm clearance per side, with a rib under each long edge so it sits 3 mm off the floor and the pins have room underneath. The lid should press gently on top.
3. Cutouts, vents and cables
Say what has to be reachable:
Add a cutout for the USB port so a cable plugs in fully, a hole on the opposite side for a power cable, and 2 mm wide vent slots on the sides, above the chip, with a total vented area of about 600 mm².
The agent uses smart features for common things like a USB-C cutout, a cable hole and vent slots. They become single, readable Recipe steps with parameters.
Remember to account for the connector shell. A cable plug is often wider than the port itself, so a cutout that matches the port exactly will not fit the plug. Ask the agent to size the cutout for the plug.
4. The lid and the screws
Add a lid with a 1.5 mm lip that locates it on the box and a 0.25 mm clearance per side. Fasten it with four M3 x 8 screws into heat-set inserts in the corner bosses.
- Lid lip gives a self-aligning fit.
- Heat-set bosses give durable threads. Each needs a wall of 1.5 to 2 mm of plastic around it.
- The screws and inserts appear on the Make list.
5. Make the size follow the board
Ask for the key relationships as parameters and rules, so it still works if you swap boards:
Make the inner size follow the board size plus 1 mm clearance. Make the wall thickness 2.4 mm. Always keep the walls at least 1.6 mm thick.
Now board, clearance and wall control the whole enclosure. See Parameters and formulas and Design intent.
6. Check it
In Make, choose 3D Print (FDM) and your printer. For this kind of box:
- Print the box open side up and the lid flat. No supports needed.
- Watch for overhangs from the cable hole or cutouts. Chamfer them or make them teardrop shaped.
- Confirm bed fit and the printability score.
Material: PETG handles warmth well, and ASA is better still if the box will sit in sun or a hot enclosure. PLA softens around 55 to 60 degrees Celsius.
7. Test the fit, then print
Print only a short section of the box wall and lid lip first, or a very low box (10 mm tall), and test the fit with the real board. It takes minutes and avoids a failed overnight print. Adjust fit_clearance if needed.
Checklist before printing
| Check | Done |
|---|---|
| Board matches the library part (or measured) | |
| USB and power cutouts sized for plugs, not just ports | |
| Vents are not blocked by walls or the lid | |
| Lid fits with 0.2 to 0.3 mm clearance per side | |
| Screw bosses have 1.5 mm or more wall | |
| Printability score checked for my printer |
Try it
Open the Enclosure template and run the whole thing in one go:
Turn this into a case for an ESP32 DevKit V1. Hold the board in a pocket with 0.3 mm clearance, add a USB cutout, side vents, a lid with a locating lip, and four M3 heat-set screw bosses. Make everything driven by parameters, and check it for FDM on a Prusa MK4 in PETG.
Smart mode with Thorough effort is a good choice for a request this size.
Did this help?
Keep reading
Ideas
Parameters and formulas
Name the numbers that matter, tie the others to them with formulas, and your model becomes a family of designs you can reshape with a slider.
Beginner4 min readIdeas
Designing for 3D printing
Overhangs, walls, bridges, orientation, supports and heat-set inserts: the handful of ideas that make FDM prints succeed, and how Solid Vibes helps with each.
Beginner5 min readIdeas
Tolerances and fit: clearance, slip and press
Why parts that match in CAD do not match in real life, and the rules of thumb (0.2 to 0.4 mm for FDM) that make them fit.
Intermediate5 min read