# ESP32 & sensor enclosure

Generate a 3D-printable two-chamber enclosure for ESP32, ESP32-S3, or D1 Mini boards with a thermally separated vented sensor bay, PIR window, and USB slot.

- Page: https://paramlet.com/tools/mcu-enclosure/
- Tool id: `mcu-enclosure` · version 1.3.0 · Paramlet Module Spec 1.1 · API version 1 · docs: https://paramlet.com/agents/
- Category: workshop / jigs-fixtures · status: live
- Parameter schema (JSON Schema): https://paramlet.com/tools/mcu-enclosure/schema.json · presets: https://paramlet.com/tools/mcu-enclosure/presets.json
- Core parameters (`exportFormat`, `exportTol`, `units`, `massUnits`) are in schema.json under `x-coreParams`, not `properties`; both are accepted.
- Presets: `measure-your-own` (Measure your own board), `fits-esp32-devkit-30pin` (Fits ELEGOO ESP32 DevKit (30-pin)), `fits-esp32-s3-devkitc-1` (Fits ESP32-S3-DevKitC-1), `fits-d1-mini` (Fits D1 Mini ESP8266 (USB-C)). Each has a page: https://paramlet.com/tools/mcu-enclosure/measure-your-own/, https://paramlet.com/tools/mcu-enclosure/fits-esp32-devkit-30pin/, https://paramlet.com/tools/mcu-enclosure/fits-esp32-s3-devkitc-1/, https://paramlet.com/tools/mcu-enclosure/fits-d1-mini/
- Deep link with parameters: `https://paramlet.com/tools/mcu-enclosure/?p=<url-encoded JSON>` or single values `?key=value`
- Deep link with a project: `https://paramlet.com/tools/mcu-enclosure/#project=<base64url project JSON>` (8,000 characters max)
- In the page: `window.paramlet` (getSchema, getParams, getState, getRecommendedMaterials, setParams, loadProject, getProject, exportModel, exportSTL, export3MF).
- WebMCP tools: `mcu_enclosure_get_parameter_schema`, `_get_state`, `_set_parameters`, `_load_project`, `_download`, and `get_recommended_materials`.
- Validation: unknown keys and out-of-range values are rejected; nothing is applied from an invalid request. Keys with x-agentSafe false can only be changed in the page.
- Output: 3mf, stl (default 3mf), millimetres, parts lying on the bed in print orientation. Every download contains README.txt and parameters.json (a project file).
- Downloads: free and unlimited at launch; API exports use the same download path as the button, including a short page with recommended products (affiliate links) that the user closes before the file starts.
- Export types: `3mf`, `stl`.

## Features

- Separate vented sensor chamber isolated from MCU heat
- Optional PIR dome window, USB-C cutout, and cable gland hole
- Presets for 30-pin ESP32, ESP32-S3-DevKitC-1, D1 Mini, and custom boards
- A colour to match your filament or your room
- A lid in a colour of its own: a two-colour box from two filaments, with no nozzle change

## Use cases

- Build a Home Assistant ESPHome temperature/humidity node without MCU self-heating drift
- House a D1 Mini or ESP32 with an HC-SR501 PIR motion dome

## Safety

- Measure clone dev boards before printing; PETG is recommended outdoors.

## Recommended materials & tools

_As an Amazon Associate Paramlet earns from qualifying purchases. Some links are affiliate links; we may earn a commission at no extra cost to you._

- [PETG Filament 1.75 mm (1 kg) — heat-resistant & durable](https://paramlet.com/go/petg-filament-1kg?src=agent) — Stronger and more heat-resistant than PLA for molds, jigs and outdoor parts. (Affiliate link (Amazon Associates, tag paramlet-21))
- [Matte PLA Filament 1.75 mm (1 kg) — smooth surface finish](https://paramlet.com/go/pla-matte-filament?src=agent) — Clean matte finish for decorative vases, ornaments and candle holders. (Affiliate link (Amazon Associates, tag paramlet-21))

## FAQ

**Why are there two chambers?**
WiFi and voltage-regulator heat inside an ESP32 case can skew BME280/DHT22 temperature readings; the baffle keeps the sensor isolated.

**How is the lid held on?**
By a lip. The lid has a 1.5 mm frame underneath that presses into the opening of the base, with a quarter of a millimetre of play on each side. There are no screws, no snap hooks and no mounting holes. To fix the box to a wall, use double-sided tape on the base.

**What holds the board?**
Nothing but the floor: there are no standoffs and no screw posts. Lay the board in its chamber with its USB port towards the opening and fix it with a piece of double-sided tape or a drop of hot glue. One thing to watch: the lip of the lid runs along the inside of the walls and passes over the very edge of the board, so a part that sits right at the edge of the board must not be taller than the height you entered.

**Which USB port fits through the opening?**
The opening is 13 mm wide and 8 mm tall. It is cut in the wall at the short end of the box and starts 2 mm above the floor. It takes USB-C, micro-USB and USB-A, with the board lying flat on the floor.

**How do I wire the sensor into the second room?**
Through a notch in the wall between the rooms, 8 mm wide and 6 mm tall, just above the floor. The second room has slots in its end wall and in the lid, so the sensor sees the air of the room and less of the heat of the board.

## Parameters

| key | label | type | range / values | default | agents |
|---|---|---|---|---|---|
| `pcbLength` | Board length (measure) | number | 25–110 mm (step 0.5) | 52 | yes |
| `pcbWidth` | Board width (measure) | number | 18–65 mm (step 0.5) | 28 | yes |
| `pcbHeight` | Internal height | number | 8–35 mm (step 1) | 14 | yes |
| `sensorChamber` | Separate vented sensor bay | integer | 0|1 | 1 | yes |
| `sensorBayLen` | Sensor bay length | number | 15–45 mm (step 1) | 24 | yes |
| `pirWindow` | PIR sensor dome window in lid | integer | 0|1 | 0 | yes |
| `pirDia` | PIR dome Ø | number | 12–30 mm (step 0.5) | 23 | yes |
| `glandDia` | Cable gland hole Ø (0 = none) | number | 0–16 mm (step 0.5) | 8 | yes |
| `material` | Filament | string | petg|pla | "petg" | yes |
| `wallCount` | Perimeter walls | integer | 2–6 count (step 1) | 3 | yes |
| `infill` | Infill | integer | 5–100 pct (step 5) | 20 | yes |
| `lidTexture` | Lid surface texture | string | none|hex|diamond|waves|dots|basketweave|wood|hammered|folk | "none" | yes |
| `textureDepth` | Texture depth | number | 0.3–0.6 mm (step 0.1) | 0.4 | yes |
| `textureScale` | Texture scale | number | 4–18 mm (step 1) | 8 | yes |
| `color` | Colour | string | string | "#c5c9cc" | yes |
| `lidColor` | Lid colour | string | string | "#c5c9cc" | yes |
