Design for electronics · 3D printing
5 tips for 3D printing PCB mounts that actually fit
You measure the board, draw the enclosure, hit print, and three hours later the board won't drop in, the screws strip the plastic, and the lid won't close over the USB cable. Every maker has been there. I certainly have.
None of these are hard problems. They're just things nobody tells you until you've printed the enclosure twice. Here are the five that save me the most reprints.
1. Design in clearance, then prove it on a test print
A printer doesn't make what you drew. Holes come out a little small, outside edges a little big, and the first layers squash outward (elephant's foot). If you draw the pocket for a 50 mm board at exactly 50 mm, it won't go in.
- Board pocket: add 0.3–0.5 mm per side around the PCB outline.
- Screw clearance holes: draw an M3 hole at 3.2–3.4 mm, not 3.0 mm.
- Hole positions: take them from the board's drawing or your PCB files, not a ruler. Then measure the real board with calipers, because cheap modules don't always match their datasheet.
- Chamfer the first layer by 0.4–0.5 mm on anything that has to fit, so elephant's foot doesn't close it up.
Every printer is different, so print a small test piece before the full enclosure. It's the same idea as the hex bit test block: ten minutes of plastic to save three hours.
2. Use heat-set inserts, not screws into plastic
Screwing straight into a printed hole works once or twice, then the thread strips. Brass heat-set inserts give you real machine threads that survive the lid coming off again and again.
- Hole size: use the insert maker's recommended hole. For common short M3 inserts it's usually around 4.0–4.2 mm. Inserts vary, so check the listing.
- Hole depth: about 1 mm deeper than the insert, so displaced plastic has somewhere to go and the screw doesn't bottom out.
- Wall: at least 1.6 mm of plastic around the hole (or three or four perimeters), or the boss will split.
- Iron temperature: start near the filament's printing temperature (around 210 °C for PLA, 240 °C for PETG) and let the insert sink under its own weight. Don't force it, and keep it square.
3. Get the standoffs right
Standoffs are where most PCB mounts fail: too thin, too tall, or too close to something.
- Leave room underneath. Through-hole leads stick out 1.5–2 mm below the board. A gap of 3 mm or more stops them shorting on screws or pressing on the floor.
- Make them fat. A boss about twice the screw size across (6–8 mm for M3) with a fillet where it meets the floor won't snap off the first time you tighten a screw.
- Keep them short. A tall, thin standoff wobbles and breaks. If you need height, raise the whole floor or use brass standoffs.
- Support at least three corners. Two is a hinge. Press a button on a board held at two points and it flexes and cracks solder joints.
4. Design snap-fit lids that survive
A good snap-fit lid means no screws, no inserts, and a box you can open in seconds. A bad one snaps the first time you open it.
- Material matters. PLA is stiff and brittle, so its clips crack. PETG flexes and comes back, which makes it the better choice for clips. (The Slic3D PETG I use for utility prints is ideal here.)
- Print clips lying down. The layer lines should run along the length of the clip, not across it. A clip printed standing up breaks between layers.
- Make the arm long and the catch small. A longer, thinner arm bends further without breaking. A catch of 0.4–0.6 mm is plenty to hold a lid on.
- Leave a gap. Allow about 0.2–0.3 mm between the lid lip and the walls so it closes without forcing.
5. Leave room for the real world
The board fits perfectly, then you plug in a cable and the lid won't close. Design around how the thing will actually be used.
- Cables: a USB plug's moulded body is much bigger than the socket. Size the opening for the plug, not the port, and leave space for the cable to bend.
- Antennas: keep metal (screws, inserts, standoffs, batteries) away from the ESP32's antenna end. Plastic is fine, but put the antenna near a wall rather than buried in the middle. On boards with a U.FL socket, like the XIAO ESP32C5, leave room to route the antenna lead.
- Heat: regulators, LoRa radios transmitting and chargers all get warm. Add a few vent slots high and low so air can move through.
- Access: think about the BOOT and RESET buttons, the status LED and the SD card before you seal the box. A small hole for a paperclip or a light pipe saves taking the lid off every time.
The short version
Add clearance and test it, use heat-set inserts, make standoffs fat and short, print clips in PETG lying down, and leave room for cables, antennas and heat. Do those five things and your next enclosure should fit first time. Well, second time. It's still 3D printing.
Related: Designing printed holes for 1/4" hex bits · Slic3D PETG on the Bambu P1S and A1 · ESP32 pin planner