Topic hub

Enclosures and 3D printing

How an enclosure changes a connected device's radio, sensor readings and heat, how to mount it, and where our parametric print files live. The hub for the Build section.

Updated 28 November 2026 · 3D printed enclosure, antenna detuning, antenna clearance, sensor venting, dead volume, thermal decoupling, DIN rail, OpenSCAD, parametric enclosure

Overview

An enclosure on a connected device is more than a box. It sits in the antenna’s near field, it decides what air the sensor sees, it traps the heat from the regulator and radio, and it fixes how the device is mounted. This hub explains those effects for makers printing a first case and for product teams briefing an industrial designer. It is also the entry point to our Build section, where every design is parametric source plus exported print files.

One rule runs through all of it. We publish no ingress protection (IP), flame, UV or temperature rating for any printed part, because none has been tested to the relevant standard. Where a page says “vented” or “outdoor”, it describes the geometry, not a rating.

Key ideas

The enclosure is part of the antenna

Plastic close to an antenna shifts its resonant frequency. TI’s application note SWRA726 (March 2022) shows an 868 MHz chip antenna 1 mm from a plastic case moving down to 862.875 MHz, with a standing wave ratio (SWR) of 2.53:1 at 868 MHz and about 18% of the power lost. For a 15 mm × 6 mm compact 2.4 GHz PCB antenna, the same note reports SWR rising from 1.70 in free space to 3.68 in the case and held in a hand. TI says the amount of detuning depends on the plastic’s chemistry and carbon level, and that it cannot be predicted, only measured. Our reading of that is to keep carbon-filled and metal-filled filaments away from the antenna end until you have measured them.

Distance is the main lever. Espressif’s ESP32-C5 guidelines (v1.4) recommend at least 15 mm of clearance in all directions around the module’s PCB antenna inside the housing, with the antenna past the edge of the base board. The Pico 2 W datasheet warns against metal enclosures, which form a Faraday cage. For on-body devices, TI suggests taping a 0.33 litre plastic bottle of water to the device as a stand-in for a hand during measurements.

Section through a sensor enclosurelarge openings,small dead volumesensorwall keeps warm airoff the sensorregulatorheat sourcemoduleantenna≥ 15 mm≥ 15 mmno metal orcarbon fillmounting tabs: screw or rail clip, antenna end away from metal
Section through a sensor enclosure: a walled sensor compartment with large openings, heat sources kept apart from it, and at least 15 mm of clear space around the antenna with no metal nearby. Our drawing from the Sensirion humidity and temperature design guide (version 2, March 2024), the ESP Hardware Design Guidelines for ESP32-C5 (v1.4) and the Pico 2 W datasheet (release 3).

Venting is for the sensor first

A humidity or temperature sensor reads the air in its own small pocket, not the room. Sensirion’s design guide (version 2, March 2024) asks for a small dead volume around the sensor, a separate sensor compartment, a large aperture and, where possible, several openings so air can flow past. It notes that a larger aperture speeds up response, and that harsh conditions force a trade-off between exposure and response time. A sealed box with one small hole and a large dead volume will respond slowly, however good the sensor is.

Heat stays inside the box

Sensirion names heat conduction through the PCB from power electronics and processors as the most common source of temperature error. Its remedies are distance, thin copper connections, milled slits around the sensor, and internal walls that keep warm air from other components off it. In an enclosure this means the sensor compartment sits at the cool end, away from the regulator and the radio, with a wall between them. Venting for the electronics and venting for the sensor are separate design questions.

Outdoor use, without claims

Sunlight, rain, dust and condensation act on a printed case in ways we have not measured. We cannot tell you that a given material or wall thickness keeps water out or survives a summer, because we have not tested it to a standard, so this site does not say so. The geometry we publish keeps the antenna clearance and lets you choose the sensor’s exposure, the trade-off Sensirion describes. If you need a rating, use a certified enclosure and put your board inside it.

Mounting and orientation

Where and how a device is mounted changes its radio as much as the case does. Mount the antenna end away from metal. A metal cabinet is a metal enclosure, which the Pico 2 W datasheet warns forms a Faraday cage. Our wall and DIN rail mount carries the ESP32-C5-DevKitC-1 with its antenna end pointing up. Keep the USB connector reachable for recovery flashing.

Batteries

Our battery pack enclosure holds a three-cell AA holder and gives the lead strain relief. It does not touch the cells or the holder contacts. Designs on this site never bypass or modify a cell’s protection circuit.

Where to start

Print your first case with /learn/beginner/10-printing-an-enclosure/, then keep the print tolerances and enclosure rules open for clearances and insert sizes. The vented ESP32-C5 devkit enclosure is the worked example for the ESP32-C5-DevKitC-1 (board v1.2). To check what your case does to the radio, follow the RF loss through enclosures method with the RF test jig, which can hold a flat wall sample at a fixed distance in front of the antenna. Board-level antenna placement is on Hardware design for IoT.

For makers

Start from one of our parametric builds and change parameters rather than drawing from scratch. Leave at least 15 mm around the antenna, print the antenna end in plain filament, and give the sensor its own walled pocket with large openings. Compare signal strength with the lid on and off before you trust a case. Keep the device indoors unless you use a rated enclosure.

For product teams

Bring the enclosure into RF tuning: final antenna matching should be done in the production housing and, for handheld or worn products, with a body stand-in. Agree the antenna clearance and sensor compartment with the industrial designer before the PCB outline is frozen. Any IP, flame, UV or temperature claim on the product needs a test to the relevant standard on production parts, not on printed prototypes.

Tools and platforms

Job Use Source
Set antenna clearance At least 15 mm in all directions inside the housing ESP Hardware Design Guidelines (ESP32-C5) v1.4
Place the board in the case Antenna past the board edge, no metal enclosure ESP32-C5 guidelines v1.4, Pico 2 W datasheet release 3
Check for detuning SWR measurement in free space, in the case and in hand TI SWRA726
Stand in for a hand 0.33 litre plastic bottle of water taped to the device TI SWRA726
Design the sensor pocket Small dead volume, separate compartment, large aperture Sensirion design guide v2
Keep the sensor cool Distance, thin traces, PCB slits, internal walls Sensirion design guide v2
Clearances and inserts Starting values from printer and insert makers Print tolerances and enclosure rules
Measure loss through a wall Fixed antenna and sample geometry RF loss through enclosures

Common mistakes

  • Printing the case wall a few millimetres from a PCB antenna and blaming the router for poor range.
  • Using carbon-fibre or metal-filled filament at the antenna end without measuring it.
  • Putting the humidity sensor in the same air space as the regulator.
  • One small hole for the sensor in an otherwise sealed box.
  • Mounting the device flat against a metal cabinet or rail with the antenna facing it.
  • Calling a printed case waterproof or outdoor-rated without a test.
  • Covering the USB port, so recovery needs a screwdriver.

Going deeper