Cheat sheet

Print tolerances and enclosure design rules

Starting clearances, hole and heat-set insert sizes, wall thicknesses and the IoT-specific rules for antennas, sensors, regulator heat and lithium cells when you 3D print an enclosure.

EspressifLast verified 28 November 2026· ESP Hardware Design Guidelines (ESP32-C5, latest); Sensirion design guide v2; CNC Kitchen insert poster (2025)

This page collects the rules we use when designing printed enclosures, mounts and jigs for connected devices. The first half covers fit on a desktop FFF (fused filament fabrication) printer: clearances, holes, heat-set inserts and walls. The second half covers what is different about an IoT enclosure: the antenna, a sensor that has to see outside air, heat from the regulator and processor, and lithium cells. Each figure comes from the printer maker, insert maker, chip maker or sensor maker named next to it.

1. Fit clearances

Fit Starting point Source
Expected accuracy of a well-tuned printer About 0.2 mm Prusa says Original Prusa printers are accurate to at least 0.2 mm
Moving parts (hinge, slider, lid that rotates) At least 0.3 mm clearance Prusa’s first value for movable parts
Holes for screws, pins and pegs Print the nominal size, measure, then correct in the slicer Bambu Lab: holes usually come out undersized
  • Expect holes to shrink. Bambu Lab lists the causes: filament contracts as it cools, elephant’s foot from a squashed first layer, wet filament, untuned flow and the seam position. In Bambu Lab’s own example, an M6 test hole printed with no compensation measured 5.66 mm.
  • Correct holes with the slicer’s hole compensation, not by scaling. Bambu Lab says its shrinkage setting scales the outer dimensions only, and that XY hole compensation enlarges a hole’s diameter by twice the value you enter.
  • Expect shrinkage mostly in X and Y, according to Bambu Lab, and calibrate again for each filament.
  • Do not design holes below about 1 mm and expect them to be accurate. Bambu Lab notes holes below 1 mm are hard to tune.
  • Take board outlines and hole positions from the maker’s mechanical drawing, with its revision, not from a photo or a marketplace listing.

2. Holes, bosses and heat-set inserts

Heat-set inserts are threaded metal parts melted into a printed hole. CNC Kitchen publishes hole sizes for its own inserts:

Insert (thread x length) Insert diameter D1 Hole diameter D2 Minimum wall around the hole W
M2 x 3 3.6 mm 3.2 mm 1.3 mm
M2.5 x 4 4.6 mm 4.0 mm 1.6 mm
M3 x 3 and M3 x 5.7 4.6 mm 4.0 mm 1.6 mm
M4 x 4 and M4 x 8.1 6.3 mm 5.7 mm 2.1 mm
M5 x 5.8 and M5 x 9.5 7.1 mm 6.5 mm 2.6 mm

Source: CNC Kitchen, “Heat-Set Insert Dimensions and Design Guidelines” poster, 2025. These sizes apply to CNC Kitchen inserts. Another maker’s inserts need that maker’s table.

  • Make blind holes at least the insert length plus 1 mm deep (CNC Kitchen).
  • Keep insert holes straight, not tapered. CNC Kitchen says a chamfer at the hole edge is normally not needed.
  • Set the soldering iron 10 °C to 20 °C above the filament’s printing temperature (CNC Kitchen).
  • In OpenSCAD, set the circle resolution for holes. The defaults are $fa = 12 (degrees) and $fs = 2 (mm), which give small circles few segments. A $fn greater than zero overrides both. Measure the printed hole either way.

3. Walls and overhangs

Prusa gives approximate wall thicknesses for a 0.4 mm nozzle:

Perimeters Wall thickness
1 about 0.45 mm
2 about 0.9 mm
3 about 1.35 mm
4 about 1.8 mm
  • Design walls as a whole number of perimeters. Prusa says a wall thinner than one perimeter cannot print, and thicknesses between perimeter counts do not print as drawn.
  • Keep unsupported overhangs within the 45° to 60° that Prusa says a printer handles cleanly, depending on nozzle and settings. Prusa says its printers with the Nextruder and 360° cooling manage up to 75°, and a 0.25 mm nozzle may manage less than 45°. Prusa’s page does not say which axis the angle is measured from, so check it with a test print on your machine.
  • Use chamfers rather than fillets on edges that touch the bed. A fillet there starts as a very steep overhang.
  • Orient load-bearing parts such as mounting tabs so the load does not pull layers apart. Prusa notes printed parts are weaker in one direction than another.

4. Near the antenna

Enclosure wallBase boardModuleANTat least 15 mm clearanceno wall, screw, insertor battery in this zone
Top view of a module-on-board design inside a printed housing, after the ESP32-C5 guidance in Espressif's Hardware Design Guidelines (read 28 November 2026). The module's PCB antenna sits past the base board edge, and the dashed zone marks the at least 15 mm clearance Espressif recommends in all directions inside the housing. Not to scale.
  • Put the module’s PCB antenna outside the base board, with the antenna’s ground point near the board edge. If it cannot overhang, Espressif says to cut the base board away on both sides of and below the antenna. It advises against a module in the middle of the board with cut-outs on all four sides.
  • Inside the housing, keep at least 15 mm clearance around a PCB antenna in all directions, as Espressif recommends for ESP32-C5 modules.
  • Treat screws, heat-set inserts, the battery and any metal plate as part of the housing for this rule. Espressif’s text talks about the housing. We read it to include metal parts you add inside, because they sit even closer to the antenna.
  • Measure if you can. Our RF loss through enclosures method page describes how we measure the effect of a printed housing.

5. Venting and sealing around sensors

A temperature and humidity sensor reports the air inside its compartment, not the room. Sensirion’s design guide for its SHT and STS sensors (Version 2, March 2024) gives four rules:

  • Keep the dead volume around the sensor small, so the air there changes quickly.
  • Separate the sensor into its own compartment, walled off from the rest of the housing.
  • Give that compartment a large opening to the outside.
  • Decouple the sensor thermally from heat sources on the board.

Why it matters: Sensirion says that at 90 %RH, a temperature error of 1 °C gives a humidity error of about 5 %RH. A sealed box around a warm board reads warm and dry.

  • Vent the electronics and the sensor compartment separately, so warm air from the board does not flow past the sensor on its way out. Sensirion’s figures show a wall shielding the sensor from heated air.
  • A vented enclosure is not a waterproof one. This page makes no ingress protection (IP) claim for any printed design.

Our vented enclosure for the ESP32-C5-DevKitC-1 applies these rules.

6. Regulator and processor heat

  • Find the heat sources: the voltage regulator, the processor while the radio transmits, a charger IC, a display. Sensirion names conduction through the PCB from power electronics, processors and displays as the most common cause of temperature error.
  • Keep the sensor far from them, use thin copper connections to the sensor, and add milled slots in the board around it where you design the board (Sensirion).
  • Consider a flexible connection to the sensor. Sensirion suggests a flex PCB as a way to cut heat conduction, and a small sensor board on a cable follows the same idea.
  • Choose the filament with the hottest expected location in mind. These are filament-level statements from Prusa’s knowledge base, given without test conditions, not ratings for a printed part:
Filament Prusa’s statement
PLA Softens and deforms above 60 °C. Low UV and temperature resistance. Not suitable for technical and outdoor use.
PETG Prusa rates it for indoor parts and many outdoor parts that stay under 80 °C.
ASA Temperature resistance up to 93 °C, high UV resistance, suitable outdoors. Warps significantly, needs an enclosure for large parts, and releases potentially dangerous fumes, so print it in a ventilated room.

We make no temperature, UV or flame rating for any printed part on this site.

7. Lithium cells

  • Use a cell or pack with its protection circuit in place, and never bypass or remove it.
  • Hold the cell without clamping, piercing or pressing on it, and keep sharp edges and screw tips away from it.
  • Relieve strain on the cell leads so that pulling on the cable does not load the solder joints or the protection board.
  • Keep the cell out of the antenna clearance zone in section 4 and away from the regulator.

Our battery-pack enclosure shows strain relief for a protected cell.

8. Test print before the real part

  1. Print a coupon with the same filament, nozzle and slicer profile as the final part. Include holes at the nominal sizes you use, one insert hole from the table in section 2, a short wall at your chosen thickness and a corner of the board pocket.
  2. Let it cool to room temperature before measuring, as Bambu Lab advises for its shrinkage test.
  3. Measure holes and the pocket with calipers. Try the real screw, insert and board.
  4. Adjust hole compensation or the model, and reprint the coupon until it fits.
  5. Record the printer, nozzle, filament, profile and compensation values with the design, and redo the coupon when any of them changes.

For makers

Start from the tables, print the test coupon first, and leave the antenna end of the board in free space. Put the sensor in its own vented corner, away from the regulator.

For product teams

Treat printed enclosures as prototypes for fit and RF checks. Measure radiated performance with the final housing and battery in place before certification testing, since the housing is part of what the antenna sees. Keep the clearance and sensor-compartment rules when the design moves to moulding.