logo elektroda
logo elektroda
X
logo elektroda

How to connect an external antenna to the ESP32? IPEX connector and jumpers - better WiFi coverage

p.kaczmarek2 
.
ESP32 modules often offer the possibility to connect an external WiFi antenna, which can significantly improve signal quality and range - especially in projects operating at a greater distance from the router or in difficult conditions (obstacles, interference). Many modules (e.g. ESP32-WROOM-32U) and boards (e.g. LilyGO T-CAN485) have a specially designed IPEX (U.FL) connector for this, which allows a quick and convenient connection of an external antenna. However, in order for the antenna to work properly, it may be necessary to reposition a jumper or solder a resistor, which in the factory configuration leads to the antenna located on the PCB.

I will try to demonstrate this in this topic.

First, let's consider the case of the module itself - compare the ESP32-WROOM-32U and the ESP32-WROOM-32D.
.
Here the issue is simple. One module has a built-in antenna (on the PCB), it is intended for an external antenna - we simply have a connector, plug it in and we are done.
.
.
The matter becomes more complicated when it comes to boards that support two types of antenna. For example, the LilyGO T-CAN485.
.
Here we have the antenna located on the PCB and additionally, optionally, the IPEX connector:
.
The active antenna is selected using a jumper - a resistor with negligible resistance.
The easiest way to do this is using hot air, although a suitable soldering iron tip will also do the job. My method is to apply a little flux, choose a low blow and a relatively low temperature and heat the board, while gently trying to remove the resistor with tweezers.
.
Caution - such a resistor is easy to lose as well as to blow off, I recommend trying on the electrical junk beforehand. Only once you have become proficient can you operate on the board with the ESP.
Resistor removed:
.
I also place the resistor in its new place using hot air. I only add flux, sometimes I also whiten the pads, although here it wasn't even necessary. I didn't even change the binder to lead.
.
Then a short test with a multimeter:
.
Then there's the question of what kind of antenna - in fact, something from an old router might even fit, but I bought a 2.4GHz WiFi antenna with 3 dBi gain offering an SMA connector with a U.FL connector adapter in the form of a cable. Less than £10 a piece.
.
Of course, the choice of antenna is quite a separate matter, it depends on the conditions and the intended use, we also have directional antennas available, among other things, but this I may try to explore in a separate topic.

We could end here, but probably many readers would also like to see some kind of test or comparison of coverage with and without an antenna....
I find it quite difficult to reliably compare this in home conditions, especially as there are quite a lot of WiFi networks in my area, practically every flat already has a router, and in addition the conditions "in the ether" change dynamically, people walk around with phones in their pockets, open videos, routers switch channels, etc.... but well, let's try to compare something.

First - a scan of the WiFi network. Software:
Code: C / C++
Log in, to see the code
.
I uploaded and tested it in four configurations:
- without antenna (I don't recommend testing this, we might risk damaging the ESP?).
- with antenna on PCB
- with external antenna
- with a piece of wire on the IPEX connector
As for the whole test, I have two comments:
- the results of successive scans were slightly different, moreover, the orientation of the antenna also matters, I only tried to select "average" readings, this is no scientific test, just a short demonstration
- the names of the WiFi networks are as I have taken the liberty of anonymising them

ESP32 Lilygo built-in antenna:
10 networks found:
1: NetBoxyz123 (-44dBm) Encrypted
2: MojeWiFi (-54dBm) Encrypted
3: Cokolwiek123 (-85dBm) Encrypted
4: SiecWiFi (-85dBm) Encrypted
5: SiecWiFi_EXT (-87dBm) Encrypted
6: Internety123 (-89dBm) Encrypted
7: Connectivity123 (-90dBm) Encrypted
8: Globalny555 (-92dBm) Encrypted
9: RouterWiFiABC (-92dBm) Encrypted
10: NetBox-BBAACC (-94dBm) Encrypted
.

ESP32 Lilygo without antenna:
1: NetBoxyz123 (-66dBm) Encrypted
2: MojeWiFi (-68dBm) Encrypted
.

ESP32 Lilygo piece of wire:
15 networks found:
1: NetBoxyz123 (-55dBm) Encrypted
2: MojeWiFi (-63dBm) Encrypted
3: Internety123 (-84dBm) Encrypted
4: Cokolwiek123 (-88dBm) Encrypted
5: RouterWiFiABC (-88dBm) Encrypted
6: SiecWiFi_EXT (-90dBm) Encrypted
7: Globalny555 (-91dBm) Encrypted
8: WiFiFast123 (-91dBm) Encrypted
9: CosSwiatlowod (-92dBm) Encrypted
10: OtworzSiec (-93dBm) Encrypted
11: DomBaDaTa (-94dBm) Encrypted
12: NetoLINK_Online (-94dBm) Encrypted
13: LinkXY12 (-94dBm) Encrypted
14: SiecWiFi (-95dBm) Encrypted
15: JeszczeCos789 (-96dBm) Encrypted
.

ESP32 Lilygo external antenna:
1: NetBoxyz123 (-41dBm) Encrypted
2: MojeWiFi (-44dBm) Encrypted
3: Cokolwiek123 (-79dBm) Encrypted
4: Internety123 (-82dBm) Encrypted
5: SiecWiFi (-86dBm) Encrypted
6: OtworzSiec (-88dBm) Encrypted
7: LinkXY12 (-89dBm) Encrypted
8: CosSwiatlowod (-89dBm) Encrypted
9: SiecWiFi_EXT (-89dBm) Encrypted
10: RouterWiFiABC (-89dBm) Encrypted
11: NetBox-BBAACC (-90dBm) Encrypted
12: Globalny555 (-91dBm) Encrypted
13: InnaSiec542 (-91dBm) Encrypted
14: JeszczeCos789 (-92dBm) Encrypted
15: WiFiFast123 (-94dBm) Encrypted
.
Signal strength is expressed in dBm. The smaller the absolute value (i.e. closer to zero), the better the signal.

Without an antenna, the results are abysmal, so if you solder something wrong, you will find out quickly. With a built-in antenna it's not too bad, but an external one is able to find more networks, and also provides a slightly better signal for those nearby networks too. Surprisingly a piece of wire also picks up quite well, I have also seen similar experiments on the web.

My side note is that the numbers of detected networks oscillated a bit anyway, so perhaps in a separate topic I will try to do some more extensive testing along with automatic collection and processing of the results.

Ok, but that's just network visibility. What about the ping?
I've set up two Lilygo's at the other end of the flat - it's behind three walls to be exact (against the fourth wall). I tested a similar configuration before (without an external antenna) and for both ESPs I still saw lost pings, will anything change now?
Antenna placed on the table:
.
Antenna vertical:
.
.
.
It wasn't a big revelation in my case, but it did indeed help with package loss. The page loads a bit faster and there aren't those annoying 'hangs' as much as before, although the results still spontaneously change over time.

In summary , the range of the ESP32 can potentially be easily increased by adding an external antenna, but with many boards, however, you have to solder this resistor, which can be a problem for beginners. It may be better to pick up an antenna-ready board straight away without soldering, but this is not always an option.... in addition, the fun showed that maybe the DIY version of the antenna also makes sense, still as if the length was properly chosen, but that's for another time.
And what experiences do you have with this - what antennas have you used for ESP and to what extent have they improved your range? .

PS: Related topic about directional antenna from @techekspert YAGI PCB 2.4GHz Wi-Fi antenna for ESP-NOW

About Author
p.kaczmarek2
p.kaczmarek2 wrote 11780 posts with rating 9909 , helped 563 times. Been with us since 2014 year.

Comments

Add a comment
TechEkspert 29 May 2025 10:47

Virtually any working external antenna worked better than a PCB antenna. A PCB antenna is often sufficient and compact. I was under the impression that ceramic antennas soldered onto PCBs worked better... [Read more]

p.kaczmarek2 29 May 2025 11:27

Of course, here we have the typical compromise between size and functionality. An external antenna means more range, but on a small prototype board it wouldn't be handy, for which reason there is usually... [Read more]

dktr 29 May 2025 16:48

. An antenna is a passive element and has no gain, but if there is more than a half-wave dipole placed in vertical polarisation in the antenna design then it may already have energy gain and also directionality,... [Read more]

__Maciek__ 29 May 2025 19:49

I think that in some cases an external antenna is a "must have" ... if esp01 was still doing quite well ... then esp32c3 super mini is already a total bummer and without an external antenna the range is... [Read more]

bsw 30 May 2025 14:04

. Exactly right - I recommend this solution: https://obrazki.elektroda.pl/3690227300_1748606538_thumb.jpg . Just cut the antenna paths and solder in with a cable bought with the antenna for less... [Read more]

djbpm 30 May 2025 17:31

You have completely messed up the impedance matching with such a connection. This is 2.4 GHz! Unless you are already using a plug, this should be soldered with as short a stripped wire as possible. These... [Read more]