Seeking advice on selecting an antenna for wireless modules

I have a project I’m working on that requires WIFI/BLE. I have found some wireless modules, like the ESP32 or some others from Laird. However I’m new to IoT and wireless design and I’m not sure how to select an antenna… some modules have built in PCB or chip antennas and other modules give some suggested u.fl antennas that are also certified for use with the module.

How does one know if the PCB or chip antenna is sufficient or if you need a u.fl type antenna? What selection criteria or analysis would you recommend to help decide which path to go down?

The circuit board will be sitting in a plastic enclosure. The only real metal in the product will be the circuit itself and some screws or what not for assembly.

This is an RF system design question.

The short and cryptic answer is the link budget tells you how much performance you need. The real answer is the continual subject of many masters and doctoral theses.

Like most engineering problems it’s a bag of jello - squeeze it one place and it squirts out somewhere else. Not really optimization but rather trade-offs. Better antenna performance gives you better range, or requires less transmit power so you get better battery life, or … Better antenna performance also leads to directions of poorer performance. Search on “Antenna Patterns” for more reading.

So, get advice, test to verify, and make sure you have lots of margin for the stuff you haven’t considered.

The TL:DR is that RF connections are described by a “link budget.” The link budget is transmit power plus all losses and gains, and the receiver sensitivity. If the total number is positive, things work. If it’s negative, they don’t. [Note to the pedants: I’m including any processing gain effects, so shut up about negative S/N.]

Simple, small antennas tend to be poor performers and show up as losses in the budget. Antennas with gain have patterns - some directions have gain, and others have (even higher) losses. If you can be sure your receiver and transmitter are in the area where the antenna has gain, you have the option of the higher gain antenna.

The distance between the receiver and transmitter is a loss factor all it’s own. It’s a square law relationship - double the distance and the loss increases by a factor of four (~6 dB) Search on “Free Space Path Loss” Wikipedia has a decent intro article. Note that few cases are actually “free space” so the path losses have a lot of other loss terms that I won’t bore you (even more) with other issues like fading, mutlipath, and a bazillion other considerations.

An ideal point source antenna that radiates in all directions is called an isotropic radiator. Antenna gains are often specified in dBi (dB relative to an isotropic radiator.) Antenna gains are also frequently described in dBd (dB referenced to a dipole.) A dipole is a simple, fairly fundamental and common antenna type with a gain in it’s main lobe of ~2.15 dBi. The gain off the end of a dipole is a null, so infinite loss. A tradeoff.

Antennas develop gain by squeezing signal energy in some direction. An isotropic radiator’s gain plot is a sphere - equally good (and poor) in all directions. A dipole’s antenna pattern is a torus. Better in a direction normal to the axis of the antenna, and (theoretically) zero off the ends along the axis. [Note to pedants, shut up about infinite Q and the infinitesimal dipole.]

You need to look at the specified gain of the antenna and your link budget. If you have gain to burn, a simpler antenna is generally better. If your budget is negative, you need a better receiver, more transmit power, a better antenna, or another trick up your sleeve.

All these things have limits. We’ll talk abut receiver noise limitations another day.



I’ve been using esp8266 and esp32 modules for a few years. The first batch of esp8266 modules had crap RF. The many variants on esp-12 modules and the esp32 modules seem to have about as good an RF design as you’re going to get unless you have specific needs and real RF design and test skills.

So for me the decision flow is something like:

  • If I’m not pushing the communication distance to the max and I don’t have a metal enclosure then pick a module with PCB trace antenna, alternatively chip antenna if size is critical
  • If I have a metal enclosure pick a u.fl module and buy an antenna I can mount to the outside
  • If I’m pushing the distance pick a u.fl module, use a pigtail to SMA, then look at high gain antennas and all that jazz

Thanks for the detailed response, seems like you are very knowledgeable in this area. I guess the issue I have is that this product is intended to connect to WIFI in a residential home… so I have no idea what WIFI router/receiver the product will connect to and therefore can’t really do a link budget calculation or some of the more detailed analysis.

Is there anyway one could get a sense if the PCB trace antenna on a module is good enough to work with a typical WIFI router/receiver in such a situation? Or do I basically have to built it and test to see?

Thank you for the information, this was very helpful. This product is intended to connect to WIFI in a residential home. The enclosure is to be made of plastic. Sounds like the PCB antenna on the ESP32 should be sufficient… would you agree, or am I missing something?

I dunno who this “pedants” person is but I’m pretty sure I’ve worked with them :laughing: :wink:

Using the internal (on board antenna) for the ESP32 is perfectly ok.

Is there anyway one could get a sense if the PCB trace antenna on a module is good enough to work with a typical WIFI router/receiver in such a situation? Or do I basically have to built it and test to see?

The short answer is: Yes, build it and try it out.

The longer answer is that a good PCB trace antenna implementation isn’t really inferior to your other antenna options. The only catch is that you need to carefully observe any implementation details and avoid detuning it with nearby components or enclosure walls. Most vendors will provide a reference design with some guidelines (PCB material, nearby ground plane requirements, keep-out areas around antenna). Always start with that.

The reality is that you can’t make an IoT device work in every possible user scenario. I prefer to set a reasonable benchmark against my phone. If I can stream YouTube on my phone over WiFi in a certain location, my low-bandwidth IoT device should also work there. Your phone has the advantage of a highly optimized, sensitive front-end, but your IoT device has the advantage of ultra-low bandwidth.

Users can generally understand that if their phone can’t get WiFi in a location, it’s unreasonable to expect any other device to work there. On the other hand, they’re not going to be happy if their phone works fine but your IoT device cannot.

Thanks Tom… that makes sense. Appreciate the feedback as I’m new to IoT and wireless design and wasn’t sure how to go about making such a decision. When would it be appropriate to use a u.fl/IPEX style antenna? If you have some crazy long distance requirement or if your in a metal enclosure? Seems to me like there is no real advantage to using these… but what the hell do I know?!?

When you have too many variables you don’t understand: “When in doubt, test it out.” and apply the old engineer’s adage: “when in doubt, build it stout, out of things, you know about” or in this case, over design a bit.

You might also consider populating the board with both options. Place the antenna you want on the board, and have an MCX there as well. There’s probably a DC blocking cap in line before the antenna. Place it so that it can feed either the antenna or the MCX.


OTOH, just to play Devil’s Advocate, there’s something to be said for the approach of building your proof-of-concepts shoddily - if it works ok then, it can only get better :slight_smile:

Offered in the same spirit: One of my favorite, and almost certainly apocryphal stories is about the guy who value engineered a product by removing parts until it stopped working - then added the last part removed back in and shipped.

My preferred mode is to overbuild and trim. Not quite the same thing, but sorta kinda. I’d like to get to functional and then see how much I can shoddy it up. :wink:

Customers always seem to want it good, fast AND cheap. Most will settle for good and fast, albeit often grudgingly. I’ve not met one yet that will settle for fast, cheap and non-functional. They may accept the risk, but rarely if ever accept the (non) results.


Really? That sounds like an urban legend to me… Take 3.3v to 5v level shifters, I’m sure you can take them out in 99% of projects and it will continue working. Question is for how long and what happens the day the 5v supply runs at max spec’d voltage. Or take ESD diodes, every circuit works great without. Fuse of any type: out. That doesn’t make much sense.

What makes a lot of sense to me is the concept of throwing everything you may need in and then once it’s working figuring out how to simplify. It often means that when one part of the circuit changes 'cause you didn’t really understand the datasheet/requirements/timing/whatnot then other parts don’t have to change 'cause they’re robust and self-contained. And then later once it’s all working you can see redundancies or defenses that are not needed and pull them out.

I never, ever want to ship something that only barely works, or is shoddy. But validating concepts by building the first test prototype(s) sloppily is a way of ensuring that there’s plenty of margin and that after the design is refined and built using good practices, it will be bulletproof. Using the best materials and best practices on the first go-round tells you nothing about margin - it may work only because you built it so carefully.

We’re in “violent agreement”

 a•poc•ry•phal ə-pŏk′rə-fəl

    adj.      Of questionable authorship or authenticity.
    adj.      Erroneous; fictitious.

Which is what I indicate is my preferred mode.


I think where we differ (and I suspect not really) is that I overbuild, test, and measure the margin to know how much I have to work with.

It’s a rare project I have much time to spare on, and any time reserve I do have to spare, I want to retain for dealing with “unkown unknowns.”

Of course I also build as many alternatives as I can reasonably get away with. One that I know will work and some that might work and offer other advantages like cost or size/weight/power.

Some of this is a reaction to working for a company a while ago that always picked one path for a project in the name of ‘efficiency.’ We had a lot of expensive do-overs and delays. I did not find that very efficient overall.


Sure, I design the heck out of something once I’ve decided on an approach. But my initial test is often a bodge of clip leads, substitution boxes, bits of boards from other projects, and junkbox components. If it feels too finicky I may look for another approach; if it works or I can easily see what’s needed to make it work, then on to proper design.


I believe you may be describing “Muntzing”. Building a “works well enough” product for the biggest audience of “80%” customers. A fascinating read which you can find and discussed all around the web.

If you’re using a module with an integrated antenna, the performance will likely be very poor. Often this is OK for BLE products. The reason is because simply mounting the module onto a PCB will detune the antenna. Plastic enclosure also detunes the antenna. In order to get datasheet performance, you need to do exactly as they did in the datasheet.

So use the u.FL or spin your own embedded antenna that’s external to the module, if performance is important at all.

Tuning the antenna will often matter more than the antenna design itself. Just recently I improved the sensitivity of a BLE device by 20dB, just be re-tuning to account for the plastic enclosure.