3D printer settings for small electronics enclosures

Render of our free 3D-printable housing for the CO2 Monitor Kit

Small electronics enclosures are forgiving prints, but a few settings decide whether the lid fits, the screws hold and the USB plug goes in. These are the settings we design our free housing files around.

Baseline settings

Setting Value Why
Nozzle 0.4 mm The standard nozzle. Our 2 mm walls come out as clean perimeters.
Layer height 0.2 mm (0.16 mm for lids) Strong and quick. Thinner layers make the outside face look better.
Perimeters 3 Walls become solid perimeters, which matters more than infill for stiffness.
Top / bottom layers 5 / 4 The floor and lid stay flat and opaque. A radar window prints as solid layers.
Infill 15–20 % gyroid or grid Only the bosses and ears have any infill. More doesn't help.
Supports None The base prints floor-down and the lid face-down. Vent slots are vertical with rounded tops, so they bridge.
Temperatures As printed on your spool Brands differ, so use the maker's range and run a temperature tower if unsure.

Tolerances: design for the printer you have

  • Board pockets: we leave 0.6 mm clearance on each side of a PCB. Boards drop in without force and foam tape holds them.
  • Lid lip: 0.3 mm per side. If your lid is tight, scale the lip down in the .scad (lip_c) rather than sanding.
  • Holes print small. A modelled 3.0 mm hole often comes out around 2.8 mm. That's why we model screw pilots (2.5 mm for M3, 1.6 mm for M2) and clearance holes (3.4 mm) instead of nominal sizes.
  • Elephant's foot: the first layer squashes out. Turn on your slicer's first-layer compensation if the lid won't sit flush.
  • Print one test corner first. Cut a 30 mm section of the box in your slicer and check the board and lid fit before printing the whole thing.

Screws, inserts and tape

  • Self-tapping screws into a printed pilot hole are the simplest option. Drive them slowly and stop as soon as they're snug, because PLA strips easily.
  • Heat-set threaded inserts survive repeated opening. Size the hole to your insert maker's drawing; it's not the same as the screw size.
  • Double-sided foam tape holds modules in their pockets and survives a drop. The exception is vibration sensors: glue those rigidly, because foam damps exactly what you're measuring.

Orientation and cutouts

  • Print the open box floor-down: walls are strongest along the layers and no supports are needed.
  • Print lids outer face down on a smooth or textured sheet for a clean finish. Thin radar windows then print as the first, flattest layers.
  • Make USB-C openings bigger than the socket (we use 13 × 8–12 mm) so moulded plug bodies fit.
  • Round cable holes for PG7 glands are 12.6 mm, which prints cleanly without support on a vertical wall.

Warping on long boxes

Long, thin parts (over about 150 mm) in PETG or ASA can lift at the corners. Use a clean bed, a brim, no part-cooling fan for the first layers and, for ASA, an enclosed printer.

Download the housing files from the 3D-printed housings page. Every dimension above is a variable in the OpenSCAD source.

Note: This guide and our housing files are free recommendations for educational and informational purposes only. They come as-is, with no warranty of fit, safety or suitability, and you print, assemble, install and use them at your own risk, so check your printer, materials, wiring, heat and local codes yourself. Printed enclosures aren't certified for fire, electrical, outdoor, medical or life-safety use, and our sensor kits aren't safety devices or a substitute for certified smoke, CO or gas alarms. To the extent permitted by law, The Sensor Shop / American Data Analytics LLC isn't liable for damage, injury or loss from their use, and nothing here affects your statutory rights. Full DIY disclaimer.