Will a PCB antenna still work inside a metal enclosure?
The board talked fine on the bench. Then it went into the aluminum housing and the phone could only see it from across the desk, or not at all. The antenna did not break. The enclosure changed what the antenna is.
This is one of the most common surprises on a first hardware product, and it is almost always discovered after the enclosure design is frozen. Here is what is happening, what your options really are, and the checks worth doing before anyone commits to tooling.
What metal does to a printed antenna
A PCB antenna, such as the meander trace on an nRF52840 reference design or the printed antenna on an ESP32 module, is tuned as a system. The trace, the ground plane under and beside it, the board substrate and everything within its near field all set the resonant frequency and the impedance the radio sees.
Put a conductor close by and that system changes. DigiKey’s antenna-matching article puts it plainly: the enclosure changes the antenna’s impedance, which is why an antenna must be tuned in its final enclosure. It names metal as the most damaging material, because conductive objects pick up current from the antenna’s fields and become unintended radiators. That hurts the impedance match and the radiation pattern at the same time. It also says the amount of shift depends on how close the material is, its electrical properties and its size, and that other PCBs, batteries, displays and brackets count too.
Two separate failures hide under “it doesn’t work”:
- Detuning. The antenna resonates somewhere other than 2.4 GHz, so less power leaves the radio and more reflects back. A matching network can often recover some of this.
- Shielding and pattern damage. A closed metal shell, or a metal plate close to the antenna, blocks or distorts radiation. No matching network fixes a Faraday cage. You can make the reflection look good on an analyzer and still have a device that cannot be heard.
The second is why “we’ll just retune it” is not a plan for a fully enclosed metal case.
Option 1: give the antenna a window
If the product needs a metal look or metal strength, the cleanest answer is to make part of the enclosure non-metallic where the antenna sits: a plastic or glass section, a molded end cap, or a cover that is a different material from the body. The antenna goes behind it with clear space around it.
Trade-offs:
- Industrial design has to agree. A plastic end cap on a machined housing is a cosmetic decision as well as an RF one.
- The antenna still sees the metal edges around the window. A window that is barely larger than the antenna is not much better than no window.
- Plastic is not free either. The same DigiKey article notes that a prototype enclosure of a different material can change the match, so the production plastic and any paint or coating on it belong in the test, not a stand-in. Even low-metal paints can matter.
If you are choosing a module for this, look at where its antenna sits relative to the board edge. Espressif’s hardware design guidelines say to place a module’s on-board PCB antenna outside the base board, or, when it cannot extend past the edge, to cut away the base board on both sides of and below the antenna. They also say to keep ground copper and dense ground vias on the base board near the antenna, and to consider the housing’s effect on the antenna during end-product design. They recommend generous clearance inside the housing; read their guide for the exact figure and the context it applies to rather than copying a number from a forum.
Option 2: move the antenna outside the metal
When the body has to be fully metal, put the radiating element outside it. The common forms:
- An external antenna on a connector. A small coaxial connector on the board, a cable through the wall, and an antenna mounted on the outside or in a plastic-capped boss. This gives the most predictable result, at the cost of a connector, a cable, a hole to seal, and a more complicated assembly.
- A module with a connector-ready RF pin. Many Bluetooth and Wi-Fi modules offer a version with an RF connector or pad instead of the onboard trace. That moves you away from a printed antenna entirely, and it changes the certification story, which is worth reading about in our note on choosing a BLE module or chip-down design.
- An antenna built into the enclosure. A slot or a metal-body feature can be made to radiate, but that is a custom RF design. It needs simulation and a network analyzer, and it is tuned for exactly one housing. We would not start there for a first product.
An external antenna does not remove the tuning job. It moves it: the antenna now sees the mounting surface, the cable and whatever you put it next to.
Option 3: keep the metal and prove it works anyway
Sometimes the housing is a metal frame with plastic faces, or a perforated or partly open case. Whether the antenna survives depends on geometry nobody can eyeball. Perforations that look generous to a person are not a guarantee, and an open edge close to a metal wall can still detune badly.
If you are going this way, treat it as an experiment with an exit:
- Measure the antenna with the real board in the real enclosure, closed up as it will ship.
- Compare against the same board on the bench, in free space, so you know how much the housing costs.
- Decide in advance what loss you can accept for your range requirement, and what you will do if you exceed it.
The exit matters. If the enclosure is already tooled, a fallback such as a pad for an RF connector on the board costs little in the first spin and saves a redesign later.
What a careful engineer checks before tooling
Antenna position in the enclosure model. Put the board in the CAD assembly and look at what is within a few centimeters of the antenna: screws, brackets, shielding cans, the battery, the display, a metal label. DigiKey’s article says objects several centimeters away can matter. In SolidWorks or FreeCAD the check takes minutes and finds most of the avoidable problems.
Placement of the matching network. The antenna-side matching components should be on the board. Espressif’s guide describes a CLC matching circuit at the chip’s RF pin and, for a PCB antenna, an additional matching circuit for antenna tuning placed as close to the antenna as possible. Leave those pads populated or populatable on the prototype, so tuning is a component change, not a re-spin. Espressif also says to validate with both simulation and real-world testing on a development board, and to test the final product for throughput and range.
Measured return loss in the final assembly. A vector network analyzer is the right tool. How you connect it matters. Ezurio’s antenna matching article lists proper connection to the PCB, and calibration and port extension on the analyzer, among the most important factors. A U.FL connector is typically only effective for tuning if the PCB was designed with specific component pads for it. The more common method is soldering a thin coaxial cable to the trace, and a stub left behind the solder point can reflect the signal and give false impedance readings. Get this wrong and you tune the cable, not the antenna.
Retuning when anything changes. DigiKey’s article says tuning must be repeated if anything in the enclosure changes. A new battery supplier, a thicker display, a different gasket or a change of paint is a change. Put a line in the release process so that RF is rechecked when the mechanical parts change.
Range test, not just a plot. A clean S11 curve means the radio is delivering power into the antenna. It does not tell you the signal escapes the housing. Test with the final firmware and a real receiver at the distance and orientation the product will see, with the device mounted the way a customer will mount it. A metal wall behind the product matters as much as the case does.
Compliance. Changing the antenna, its position, or the enclosure material after a module or product has been tested can affect the regulatory story. Which tests need repeating depends on the radio, the grant and the market, so decide that with your test lab before the change, not after.
How we approach it
We review the antenna position against the enclosure model while the housing is still editable, leave tuning pads on the first board, and measure in the closed assembly before anyone orders tooling. If you are choosing between a metal case and a plastic one, send us the enclosure CAD, the board outline, the radio part or module, and the range you need.
Sources: DigiKey, Antenna Matching Within an Enclosure: Theory and Principle; Espressif Hardware Design Guidelines, PCB layout; Ezurio, Antenna Matching within an Enclosure, Part II.
If your Bluetooth or Wi-Fi board is headed for a metal case, we would review the antenna placement and enclosure drawing together before tooling is ordered.
Tools for this topic
- PCB trace impedance Trace width for a target impedance, or the impedance of a width: microstrip and stripline, single or differential pair, with 4-layer stack-up presets.
- Voltage divider Vout from Vin and two resistors, or the best standard pairs for a target Vout — with tolerance range and load effect.
- Regulator feedback resistors Feedback pairs for any Vref, for feedback-pin parts and three-terminal adjustables, with the bias-current term, worst-case range and divider-current guidance.
Related notes
- Where to put ESD protection on a USB or connector port Where the TVS diode goes next to the connector, how to ground it with short stitched vias, and what to keep out of the path so a static zap at the connector…
- Why an NTC thermistor reads wrong on a microcontroller Why a thermistor on an ADC pin drifts, jumps or reads high: divider placement, the curve math, self-heating and leads. Checks to run before you blame the chip.
- Ordering PCBs before a tariff exclusion expires What the Section 301 exclusion deadline means for small bare-board orders, what to confirm with your broker, and what not to rush in the design.