ESP32-S3 enclosure design: give the antenna its 15 mm
Jerome Privott · · 6 min read

What changed in this post
The first version of this post told you to leave 3 to 5 mm of air around an ESP32-S3's PCB antenna. Espressif's own hardware design guidelines ask for at least 15 mm. That was wrong, and so were several other numbers in it that I could not trace to a source. This version keeps only figures from Espressif and from two published measurement papers I read end to end, and cuts the rest.
Start with Espressif's numbers, not a forum's
Espressif's ESP32-S3 Hardware Design Guidelines, section "General Principles of PCB Layout for Modules", covers two separate things: where the module sits on your board, and what the housing does around it. The ESP32-S3-WROOM-1 datasheet (v1.8) doesn't repeat the rules. It points you to that section.
On the board. Put the module's PCB antenna outside the base board, with the feed point close to the board edge. If the antenna can't hang off the edge, cut the base board away on both sides of the antenna and below it. Espressif's keep-out figure shows that cleared area running at least 15 mm beyond the side of the antenna. It also says not to put the module in the middle of the board and hollow out clearance on all four sides.
In the housing. This is the part an enclosure designer owns. The guidelines say, verbatim: "A clearance of at least 15 mm is recommended in all directions." They also say the finished product should be tested for throughput and communication range.
Fifteen millimetres in every direction is a lot of space in a palm-sized case. If your design can't give it, you are outside Espressif's recommendation, and the only honest way to know what that cost you is to measure it (see the last section).
What goes in that 15 mm, and what doesn't
None of this needs a number to be true:
- No metal. Screws, heat-set inserts, battery packs, shield cans, display frames and metal mounting brackets stay out of the clearance zone. A LiPo pouch is foil; treat it like any other conductor.
- No ground copper under the antenna. That's what cutting the base board away is for.
- Noisy parts away. Espressif names the USB port, the USB-to-serial chip, UART lines, crystals and other high-frequency parts as things to keep as far from the antenna as possible.
- Face the antenna outward. Point the antenna end toward the outside of the product, not toward the middle of the device or a wall it gets mounted against.
- Cables routed elsewhere. Ribbon cables, sensor leads and power wiring shouldn't run across the antenna end of the board.
- No conductive filament. Carbon-fibre and conductive filaments don't belong anywhere near the antenna. Use a plain, unfilled plastic for the part of the case that surrounds it.
What the plastic itself does at 2.4 GHz
Plastic isn't invisible to the antenna, but it's also not a shield. Two numbers describe it: relative permittivity (εr), which is how much the material slows and stores the field, and loss tangent (tan δ), which is how much of it the material turns into heat.
Lee et al. at Loughborough measured 3D-printed ABS and PLA (Raise3D filament, 100% infill, samples about 1.5 to 1.7 mm thick) with a split-post dielectric resonator at 2.4 GHz. That's exactly the band we care about:
| Material | εr at 2.4 GHz | tan δ at 2.4 GHz |
|---|---|---|
| ABS | 2.31 | 0.005 |
| PLA | 2.53 | 0.009 |
Source: Lee et al., Designs 2019, 3(4), 47, Tables 5 and 6.
Other labs get different numbers. Behzadnezhad et al. measured printed PLA at 3.11 / 0.013 and ABS at 3.18 / 0.012, but at 63 MHz on a different printer, for MRI coils (J. Magn. Reson. 2018). Treat the table as a ballpark for the band, not a design constant. I couldn't find a PETG measurement at 2.4 GHz that I could open and read, so there's no PETG row.
Two things follow from those numbers.
Loss is small. A loss tangent under 0.01 means a thin printed wall absorbs little.
Proximity is what matters. A permittivity above 1 means plastic pressed against the antenna loads it. The field around the trace sees more than air, and the antenna's resonance moves lower than where it was tuned. That's why Espressif's rule is about clearance, not wall thickness. Air around the antenna is what keeps it tuned.
Infill changes the material. Lee et al. note that the air gaps in FFF printing lower both permittivity and loss compared with a solid moulded part. Kuzmanić et al. measured printed PLA anywhere from 1.78 to 2.81 depending on infill density and pattern (Progress in Additive Manufacturing, 2023). That was a low-frequency LC-meter test, not 2.4 GHz, but the trend is the point. Your slicer settings are part of the RF design, so test the print settings you'll actually ship.
How we handle it at byitl
The HC-01 humidor controller runs on our own board with an ESP32-WROOM-32E module. Its enclosure is parametric build123d code, and the design carries an _assert_clear_of_antenna() check that runs against every standoff boss. When a revision moves a boss into the antenna keep-out, the build fails instead of shipping a part that only looks fine. A WROOM-32E isn't an S3 module, so the S3 figures above aren't its spec, but the check works the same way whatever the keep-out is. Several of our 2026 samples use an Adafruit Feather ESP32-S3. You can't move a Feather's antenna, so there the housing is the only part of the rule you control.
A check in code beats a note on a drawing because enclosures get revised. A boss gets moved for a screw or a wall shifts for a connector, and nobody re-reads the RF note.
Test it: RSSI with the lid off, then on
Espressif says to test the finished product, and that's the only test that counts. Keep it simple:
- Same access point, same spot, same orientation.
- Log RSSI for a minute with the board bare, then with the enclosure closed.
- Compare averages, not single readings. RSSI jumps around.
On ESP-IDF the connected AP's RSSI comes from esp_wifi_sta_get_ap_info():
#include "esp_wifi.h"
#include "esp_log.h"
void log_rssi(void) {
wifi_ap_record_t ap;
if (esp_wifi_sta_get_ap_info(&ap) == ESP_OK) {
ESP_LOGI("rssi", "%d dBm", ap.rssi);
}
}
If closing the case costs you a noticeable drop, look at what moved into the 15 mm before you blame the plastic.
Checklist
- Antenna off the board edge, or base board cut away beside and below it.
- At least 15 mm of clearance around the antenna inside the housing, per Espressif. If you can't get it, measure.
- No screws, inserts, batteries, cables or ground copper in that zone.
- Antenna end facing the outside of the product.
- Plain, unfilled plastic around the antenna. No carbon-fibre or conductive filament.
- RSSI logged with the case open and closed, same spot, averaged.
Building the whole device, not just the case? At byitl we design the custom PCB, the ESP32 firmware and the enclosure together and hand you one working unit, from $7,500, in 4–6 weeks.
Related

It works. It is also too big.
Part five. HC-01 is running in a real humidor: 522 logged samples, agreement with an independent hygrometer, and one closed control loop.
· 6 min read

What a 3D-printed prototype enclosure actually costs in 2026
Filament is under half a percent of the bill. Here's the itemized total for a palm-sized ESP32 enclosure, design time included.
· 10 min read

From jumper wires to a custom PCB: building the HC-01 humidor controller
An ESP32 rat's nest became a four-revision custom board. The most expensive mistake was a sensor we never actually measured.
· 4 min read