ESP32-WROOM Layout: Antenna, Keep-Out, and Module Placement

The ESP32-WROOM is probably the most common ESP32 module in the world. It is cheap, well-documented, and appears in thousands of products. It is also, in our experience, one of the most frequently mis-laid-out parts — because people treat it as a component to be placed wherever it fits, rather than as a radio that needs specific conditions around it.

This article is about getting the esp32 wroom pcb layout right: where to place it, what keep-out it needs, and how to ground it. Most of what follows applies whether you are designing an esp32 wroom 32 pcb or using one of the newer WROOM variants, because the physics of the antenna does not change with the part number.

Understand what the module contains

The WROOM integrates the ESP32 chip, flash, the crystal, and the RF matching network, and it presents an antenna at one end. That antenna is the part that matters. Everything else in the module is taken care of; the antenna's environment is not.

Two versions matter here:

  • WROOM with a PCB antenna — the antenna is a printed structure on the module itself, and it needs the area around it to be clear.
  • WROOM with an external antenna connector (often the "U" version) — the module provides a U.FL or similar connector, and you supply the antenna. This is the esp32 wroom with antenna option that many designers reach for when the enclosure is metal.

Which one you have determines the keep-out you must respect.

The keep-out: where the antenna lives

For a WROOM with a PCB antenna, the antenna is at one end of the module, and the module datasheet specifies a keep-out region: an area where you must not place copper, traces, or components.

The rules, in practice:

  • No copper in the keep-out, on any layer.
  • No components in the keep-out, on either side of the board.
  • No ground pour extending into the keep-out.
  • No metal (batteries, screws, shields) in or near the keep-out, and none in the enclosure directly over the antenna.
  • Place the module at the board edge, so the antenna faces open space rather than sitting in the middle of the board.

The most common failure is a ground pour that was drawn before the module was placed, extending quietly into the antenna region. It looks fine on screen and kills the range in the field. If your EDA tool supports a copper keep-out rule, set it up once and let it protect you through every reroute.

Placement: edge, always

The single most important placement rule is to put the antenna at the edge of the board, facing outward. A module buried in the middle of the board radiates into its own ground plane and enclosure, and the range suffers.

Practical guidance:

  • Place the module so the antenna end is flush with (or overhanging) the board edge.
  • Keep the antenna away from the enclosure wall; if the enclosure is metal or coated, that is a serious problem.
  • Keep the antenna away from the battery, the display, and any connector.
  • Orient the antenna so it is not shadowed by large components.

If your mechanical design puts the antenna against a metal surface, no amount of layout skill will fix it. That is an enclosure conversation, and it is better to have it before the enclosure is tooled. A common cheap fix is to leave a plastic window in a metal enclosure directly over the antenna, or to switch to the external-antenna module.

Grounding around the module

The WROOM needs a solid ground reference. The rules:

  • Keep a continuous ground plane under the module body (not the antenna region).
  • Stitch the ground generously around the module's ground pads.
  • Do not route signals under the module where they can couple into the RF section.
  • Keep the ground under the module's digital section and the ground around the board connected by many vias.

A module whose ground pads are connected by thin, sparse traces will underperform a properly grounded one, even with identical placement. If in doubt, count the vias around the module's ground pads and compare that number to the number of ground pads; a ratio well below one-to-one is a red flag.

Power and decoupling

The WROOM has its own decoupling, but the board still has to supply clean power.

  • Place a bulk capacitor near the module's power pin, per the datasheet.
  • Keep the power trace to the module short and reasonably wide.
  • Keep switching supplies away from the module, especially away from the antenna end.
  • Follow the module's reference for any additional decoupling.

The transmit burst of an ESP32 is what stresses the supply, not the average current. If the 3.3 V rail sags during transmission, you get resets or dropped packets that look like software bugs and are actually layout bugs. A scope on the rail, triggered on transmit, tells you in seconds whether the supply is the problem.

If you use the external-antenna version

The "U" version moves the antenna off the module, which changes the layout:

  • The RF path goes from the module's connector to your antenna, typically through a coax pigtail.
  • Keep the connector accessible and strain-relieved.
  • The antenna itself goes wherever it can perform — often outside the enclosure.
  • The keep-out rules around the module relax, but the antenna placement now matters even more.

External antennas are the right answer for products where the enclosure is metal or the range requirement is high. They also let you position the antenna away from noisy circuitry, which is often the single biggest range improvement available to a small product.

A WROOM layout checklist

  1. Antenna version identified (PCB antenna vs external connector).
  2. Module placed at the board edge, antenna facing outward.
  3. Keep-out clear of copper, components, and ground pour on all layers.
  4. No metal (battery, screws, enclosure) near the antenna.
  5. Continuous ground under the module body, stitched generously.
  6. No sensitive signals routed under the module.
  7. Bulk decoupling near the module power pin.
  8. Switching supplies kept away from the module, especially the antenna end.
  9. Enclosure material checked for antenna impact.
  10. RF performance tested in the real enclosure.
  11. Module ground-pad via count checked against pad count.

Reading the module datasheet for the keep-out

The keep-out is not a suggestion; it is a dimension with a tolerance, and it appears in the module's hardware design documentation. When you read it:

  • Note which dimension is which. The keep-out zone usually has both a length and a width, and the width often has to extend past the module's edge.
  • Check whether it applies on the antenna side only. Most keep-outs cover the antenna end and a margin around it, not the whole module.
  • Confirm whether it applies to all layers. For a PCB antenna, it does — copper on any layer beneath the antenna disturbs it.
  • Check the note about the module edge overhanging the carrier, which is the recommended placement for many modules.

The single most common datasheet misread is treating the keep-out as covering only the top layer, then filling the bottom layer with ground under the antenna. The copper is on the wrong side of the board, and it still detunes the antenna.

What happens when the board is too small

Small ESP32 products are where the antenna rules get tested hardest, and the physics does not negotiate. When the board is too small, three things happen:

  • The ground plane gets small, so the antenna has less of a reference to work against and its efficiency drops.
  • The keep-out overlaps other circuitry, so either you break the keep-out or you crowd the components.
  • The enclosure gets small too, so the antenna ends up close to the product's own metal.

The result is a board that passes a bench test at short range and fails in the field at realistic distance. The fix is usually not a layout trick but a product decision: a slightly larger board, a module with an external antenna connector, or an antenna designed into the product's plastic.

Measuring the antenna, not guessing

You cannot see an antenna problem on a schematic, and you often cannot see it on a layout review. The only reliable test is measurement. Two accessible methods:

  • Conducted measurement of the feed point with a network analyser, which shows the resonance and the match without a test chamber. This catches detuning early.
  • Range or throughput testing with the antenna in the real enclosure, which catches the interaction between the antenna, the product, and the environment.

A product that has had neither test has an antenna that is assumed to work rather than known to work, and the difference shows up as a support problem after shipping.

The cost of getting the antenna wrong

It is worth being blunt about the economics. A layout that gets the antenna wrong produces one of the most expensive failure modes in hardware: the product works in the lab, passes basic functional testing, ships, and then fails in the field in a way that is intermittent and hard to attribute. Fixing it means a respin, a re-test, and often a re-certification, plus the cost of the returns and the reputation.

Against that, the cost of getting it right is a keep-out rule, an edge placement, and a measured antenna. There is no cheaper insurance in hardware design.

Grounding: the difference between working and working well

Two WROOM boards can place the module identically and perform differently, and the difference is usually the ground. The module's ground pads need a low-impedance path to the board's ground plane, and that path is made of vias and copper:

  • Stitch around the module's ground pads densely, so the return current has many short paths.
  • Keep the ground plane under the module continuous, with no slots or splits that force current around an obstacle.
  • Connect the ground regions near the module broadly, not through a single narrow neck.
  • Avoid routing signals that cross the module's ground region, since their returns will compete with the RF return.

The rule of thumb is that if a ground connection looks like a single bottleneck, it is one. The antenna and the radio care about the impedance of their return path, and a thin ground link is a resistor you did not intend to add.

Testing the WROOM design before you build volume

Before committing to a production run, a short test programme catches the most expensive mistakes:

  1. Conducted feed-point measurement to check the antenna is matched and not detuned.
  2. Range or throughput testing with the module in the real enclosure.
  3. Power rail check under transmit, to catch supply sag.
  4. Thermal check for the regulator and the module.
  5. A sample in the actual product housing, mounted as the customer will mount it.

None of these require a full test lab, and together they cover the failure modes that a WROOM layout can have despite looking correct on screen.

The WROOM in a metal enclosure

A metal enclosure is the hardest environment for a WROOM with a printed antenna, and it is common in industrial and outdoor products. Options, in order of increasing effort:

  • Use the external-antenna version and route the antenna outside the metal, which is usually the cleanest fix.
  • Leave an opening or a plastic window in the metal directly over the antenna, which can work if the antenna can also radiate outward.
  • Relocate the module so the antenna faces the opening, even if the rest of the board is inside.

What does not work is putting a printed antenna facing a solid metal wall and expecting range. The antenna will be detuned and shielded, and the product will underperform no matter how good the layout is. This is why the enclosure belongs in the design conversation from the start.

Placing the WROOM with the rest of the board in mind

The antenna has the strongest claim on placement, but it is not the only consideration. Once the module is placed at the edge with its keep-out respected, the rest of the board has to work around the constraints it creates:

  • The power section should stay away from the antenna end, and the switching loop should be tight.
  • The crystal and its capacitors should be close to the module and well grounded.
  • Interfaces and connectors should be arranged so their cables do not run past the antenna.
  • The ground under the module's digital section should be continuous, even as other signals route nearby.

Laying the board out around the module — rather than squeezing the module into a board that was laid out for something else — is the difference between a WROOM design that works and one that only appears to.

When the WROOM is the right answer

It is worth remembering why the WROOM remains so common despite newer parts. It is cheap, it is available in volume, it is documented to a fault, and its integration is well understood by contract manufacturers. For a product that needs reliable Wi-Fi, a proven module, and a fast path to production, the WROOM is often the lowest-risk choice. The layout discipline it demands is the price of that reliability, and it is a price worth paying deliberately.

If the WROOM is going into a product that will be mounted in different orientations, test the antenna in the worst one, not the best. A device that works lying flat and fails when mounted vertically has an antenna problem that a bench test in the wrong position will hide. Test as the customer will install it.

Finally: if the WROOM board passes range testing in the lab but disappoints in the field, suspect the enclosure and the mounting before the layout. The module is usually doing exactly what it was designed to do; the environment around it is what changed.

Where we fit

We lay out WROOM-based boards constantly, and getting the antenna right is routine work for us. If your product uses a WROOM and the range matters: pcb-layout. For full design from schematic to Gerbers, see pcb-design. Manufacturing and assembly run through PCB PCBA order online.

Send us your board outline and enclosure constraints, and we will tell you where the WROOM should go.

The ESP32-WROOM's antenna is easy to ruin. Place the module at the board edge with the antenna facing outward, and keep the keep-out clear of copper, components, and ground pour on every layer. No metal — battery, screws, or enclosure — should sit near the antenna. Keep a continuous, well-stitched ground under the module body, keep switching supplies away, and test the antenna in the real enclosure.

If your enclosure is metal or your range requirement is high, use the external-antenna version instead.

Related Posts
Start typing to see products you are looking for.
Shopping cart
Sign in

No account yet?

Shop
Wishlist
0 items Cart
My account