2025年4月23日 星期三

MicroPython 學習筆記 : PCB 天線與 IPEX 天線訊號強度比較

去年 11 月初為了用具有 SPI RAM 的開發板做測試, 第一次買 ESP32 WROVER, 它有兩種款式, 一是使用 PCB 天線的 ESP32-WROVER-E, 另一款是使用外接 IPEX 天線的 ESP32-WROVER-IE, 當時先各買一片, 想說比較看看訊號到底差別多大, 但一直沒動手, 趁這兩天拿板子出來測試推播訊息到 Telegram, 順便做訊號強度測試. 




測試方法是利用 esptools 模組的 scan_ssid() 函式, 它會掃描周邊的 WiFi 熱點, 傳回它們的 SSID, MAC, 以及信號強度, 兩塊板子均位於相同位置進行測試. 

首先測試外接 IPEX 天線的 ESP32-WROVER-IE 開發板, 將 config.py 與 esptools.py 上傳開發板, 呼叫 connect_wifi() 連線最近的基地台後呼叫 scan_ssid() : 

>>> import config  
>>> import esptools  
>>> ssid=config.SSID   
>>> password=config.PASSWORD   
>>> ip=esptools.connect_wifi(ssid, password)  
network config: ('192.168.50.199', '255.255.255.0', '192.168.50.1', '192.168.50.1')
>>> esptools.scan_ssid() 
ASUS_RT_AC52-Plus 5c:27:d4:f3:82:22 -52dBm
>>> esptools.scan_ssid()  
ASUS_RT_AC52-Plus 5c:27:d4:f3:82:22 -51dBm
>>> esptools.scan_ssid()
ASUS_RT_AC52-Plus 5c:27:d4:f3:82:22 -51dBm
>>> esptools.scan_ssid()  
ASUS_RT_AC52-Plus 5c:27:d4:f3:82:22 -49dBm

掃描 4 次發現其信號強度約 -49 至 -52 dBm 左右. 

接下來測試 ESP32-WROVER-E 開發板 :

>>> import config  
>>> import esptools  
>>> ssid=config.SSID   
>>> password=config.PASSWORD   
>>> ip=esptools.connect_wifi(ssid, password)  
network config: ('192.168.50.199', '255.255.255.0', '192.168.50.1', '192.168.50.1')
>>> esptools.scan_ssid() 
ASUS_RT_AC52-Plus 5c:27:d4:f3:82:22 -78dBm
>>> esptools.scan_ssid()  
ASUS_RT_AC52-Plus 5c:27:d4:f3:82:22 -78dBm
>>> esptools.scan_ssid()
ASUS_RT_AC52-Plus 5c:27:d4:f3:82:22 -78dBm
>>> esptools.scan_ssid()  
ASUS_RT_AC52-Plus 5c:27:d4:f3:82:22 -78dBm

可見 PCB 天線偵測到的 WiFi 信號強度確實比 IPEX 弱, 大約低了 20dBm 左右. 如果開發板離 WiFi 基地台較遠, 可以改用外接天線的 ESP32-WROVER-IE 開發板, 板子價格差不多, 只是要多一支 IPEX 天線的成本 (約 30 元左右). 

參考 :


沒有留言 :