Did an antenna mod on an esp-32. What a difference!

I followed this guide (just don’t power it on without an antenna like he did!) to solder an SMA socket onto an esphome that had a poor signal where it was located, not expecting much. I used a harvested antenna from an old router and what a difference! Went from around -67dB signal strength to -40dB.

Just posting this as a reference in case others want to try it. It was a really simple mod (maybe around 30mins, assuming parts are around) with a lot of ROI.

Boosted send and receive? 27dB - that sort of antenna gain is huuuge! 3dB is double - 27 is outlandish (it’s logarithmic). Was it in exactly the same location, distance and orientation that you made both measurements? How long is the new antenna? It may put your device outside FCC specifications and cause interference to other devices too, or swamp other signals. Check how it has affected other devices close by.

NASA called. Their Pioneer 1&2 folks want a word with you. Their signals are a tad faint too… :wink:

I’m not sure whether send and receive. This is the number esphome reports when I start logging.

Everything is exactly the same except for the esp32. One with antenna and one without. The antenna was from an asus router I recycled. I’ll probably get flamed for this :grin:, but I used a breadboard so I simply popped off the old esp32 and put on the modded one.

OLD:
WiFi:
[15:35:15.944][C][wifi:1531]:   Local MAC: XX
[15:35:15.944][C][wifi:1531]:   Connected: YES
[15:35:15.985][C][wifi:1237]:   IP Address: 10.X
[15:35:15.985][C][wifi:1248]:   SSID: 'X-iot'
[15:35:15.985][C][wifi:1248]:   BSSID: XX
[15:35:15.985][C][wifi:1248]:   Hostname: 'garage'
[15:35:15.985][C][wifi:1248]:   Signal strength: -67 dB ▂▄▆█
[15:35:15.985][C][wifi:1248]:   Channel: 11
[15:35:15.985][C][wifi:1248]:   Subnet: 255.255.255.0
[15:35:15.985][C][wifi:1248]:   Gateway: 10.X
[15:35:15.985][C][wifi:1248]:   DNS1: 10.X
[15:35:15.985][C][wifi:1248]:   DNS2: 0.0.0.0



NEW:
WiFi:
[19:16:48.530][C][wifi:1556]:   Local MAC: XX
[19:16:48.530][C][wifi:1556]:   Connected: YES
[19:16:48.537][C][wifi:1259]:   IP Address: 10.X
[19:16:48.566][C][wifi:1270]:   SSID: 'X-iot'
[19:16:48.566][C][wifi:1270]:   BSSID: XX
[19:16:48.566][C][wifi:1270]:   Hostname: 'garage'
[19:16:48.566][C][wifi:1270]:   Signal strength: -40 dB ▂▄▆█
[19:16:48.566][C][wifi:1270]:   Channel: 11
[19:16:48.566][C][wifi:1270]:   Subnet: 255.255.255.0
[19:16:48.566][C][wifi:1270]:   Gateway: 10.X
[19:16:48.566][C][wifi:1270]:   DNS1: 10.X
[19:16:48.566][C][wifi:1270]:   DNS2: 0.0.0.0


You should know that there is no need to obscure local ip addresses. They can not be routed on the internet and used against you.

There is no way that simple 1/4 wave dipole can give 27dB gain. It would give 4dBi at most in the best case scenario (e.g. an excellent ground plane, which you do not have).

I’m surprised the before signal was as good as it was considering that the PCB antenna is flat against a whole bunch of metal contact strips in the breadboard. That would account for some of the improvement as your antenna is now not affected by this.

=== Sidebar conversation here ===
Could you help elaborate a bit on what this setup can do…? Would this in the end attached to the ceiling of a garage?

I asked because I’m interested :slight_smile:

Yep, it’s in my garage. Originally I had a D1mini (with antenna) that only controlled the door, but I ‘improved’ it with this one. It controls the door (dry contact relay), checks garage and entrance door status (2 door sensors), checks if the cars are present (2 ultrasonic sensors), and reports temperature, humidity, and motion (pir).

Maybe I just happened to catch the initial log at a particularly terrible time :laughing:. No empirical evidence, but it certainly feels snappier when viewing logs and so far no dropouts (unavailable in home assistant) like the previous one.

Firstly, a dipole is 1/2 wave, not 1/4 wave. The new antenna might have a gain of around 2dB relative to a 1/4 wave monopole, which is the standard reference (0 dB) for antenna gain numbers.

It is however quite likely that the measured improvement is genuinely much more than that if the original antenna had negative gain due to poor design, interference from adjacent metal and/or sub-optimal positioning.

27dB is a lot, but I’ve certainly seen well over 10dB improvement when replacing a PCB antenna with an external one.

Indeed. That should have been “monopole”.

I mentioned that. The PCB antenna was way too close to the breadboard.

Have you noted any real world improvement in performance, range or data reliability with the new antenna? The signal strength number can vary a lot at any given moment due to innumerable environmental factors.

A massive improvement in reliability. Here’s the history before I did the mod:
before

And after, I haven’t had a dropout yet.

Edit: The device wasn’t moved, so I didn’t check anything related to range, and it’s also pretty low bandwidth. I was mostly looking to avoid the network dropoffs.

If you look at the PCB antenna, you see that ground plane is cut off from antenna area. Inserting it to breadboard likely invalidates partially the antenna design.

Edit:
..like already mentioned few times above..

I certainly have. I’ve got several boards that would regularly drop connections, I added external antennas (cut antenna traces, solder coax directly to board) and it completely transformed their stability.

One of them is 200m from the access point and low to the ground (inside a gate controller). With the board antenna it just didn’t work, adding the external antenna fixed that - reported signal strength is still low-ish but it’s rock-solid.

There’s also this topic I wrote around the same time that video was posted: How to add an external antenna to an ESP board