Portable Dual Band WiFi Analyzer
This instrucatables show how to use a Tic Tac mint box, a ESP32-C5 dev board, a display and a Lipo battery to build a portable dual band WiFi analyzer.
Supplies
- Tic Tac mint box
- Waveshare ESP32-C5 dev board (standard version, not pre-soldered header)
- 2.0 inches IPS color screen module 240x320
- 751640 Lipo battery (any size not bigger than 7.5mm x 16mm x 40mm should be ok)
Dual Band WiFi Analyzer
This is a portable version of my previous project, ESP32-C5 Dual Band WiFi Analyzer.
ESP32-C5 is the first dual band WiFi capable chip in ESP32 family, so this is the first time we can use ESP32 chip build a Dual Band WiFi Analyzer. The Waveshare ESP32-C5 dev board have onboard battery recharge management module, so it is very easy to make it portable.
Software Preparation
Arduino IDE
Download and install Arduino IDE latest version if not yet:
https://www.arduino.cc/en/software
Arduino-ESP32
Follow installation steps to add Arduino-ESP32 support if not yet:
https://docs.espressif.com/projects/arduino-esp32/en/latest/installing.html
Arduino_GFX Library
Open Arduino IDE Library Manager by selecting "Tools" menu -> "Manager Libraries...". Search "GFX for various displays" and press "install" button.
You may refer my previous instructables for more information about Arduino_GFX.
U8g2 Library
Open Arduino IDE Library Manager by selecting "Tools" menu -> "Manager Libraries...". Search "U8g2" and press "install" button.
Note:
You may refer to Arduino Documentation for the details on how to install/import library to Arduino IDE.
Deep Sleep Power Consumption
If the display board direct connect to the dev board 3.3 V power supply, the display continuous draw around 37 mA even ESP32 entered deep sleep. You can add a MOS trigger switch in the middle to cut the power easily. But since this small display only draw 37 mA, I would like to skip this extra component. According to ESP32-C5 data sheet, each GPIO suggest not draw over 12 mA. So combine 4 GPIO should able provide 48 mA current. After that, the deep sleep power consumption can cut to around 1 mA, then the portable device can standby over 10 days.
Remove Power LED
Around 1 mA power consumption is good enough, but around 0.5 mA is just consumed by the Power LED. But desoldering the LED is not easy, if you have soldering hot plate, you can remove it without mess up other components. Someone on the web suggested simply use cutter or plier to remove it, this action is a little bit risky but I also tried it works before.
Arduino_GFX Example Program
The WiFi Analyzer is one of the Arduino_GFX example program, you can open it in Arduino IDE File menu -> Examples -> GFX Library for Arduino -> WiFiAnalyzer -> ESP32C5WiFiAnalyzer.
Another example, ESP32C5WiFiAnalyzerUTF8, are using U8g2 format UTF8 font, so it can show the AP name that are not using English characters.
Quick Initial Response Design
WiFi scan is a time consuming task. The total scan time depends on the scan time per channel and the number of channels to scan. So the first scan is set only scan 2.4G channels and scan 30 ms for each channel so it requires around 13 x 30 ms ~= 390 ms; the second scan is set scan both 2.4G and 5G channels and 30 ms each; then the subsequent scan is set scan both 2.4G and 5G channels and 300 ms each. Therefore, you can get a quick initial response, followed by more access points.
Power Saving Program Logic
The example not enabled power saving feature by default. You can enable it by uncomment related code at around line 7:
According to the above settings, the display powered by GPIO 0-3. The program with scan 5 times for every 3000 milliseconds interval delay. Then it enter deep sleep to save power.
Upload Program
Before connect component, it is recommended upload the program first. So you can check the connection once soldering finished. Simply select ESP32-C5 Board and Huge App Partition Scheme then press upload button. Wait some time to compile and upload the program. You can check any abnormal message by Serial Monitor to ensure the upload the program run without error.
Cleanup Tic Tac Box
Remove the sticker from the Tic Tac box.
Desoldering Display Pin Headers
The display is pre-soldered by default, but the Tic Tac box cannot fit the pin header, so it is required to desolder it first.
Soldering GPIO 0-3 Together
GPIO 0-3 combined to provide power for the display, soldering it together first.
Soldering Work
Here are the connection summary:
Connect Lipo Battery
Now you can connect the Lipo battery to check all works well.
Patch Tic Tac Box
All components can just fit in the Tic Tac box, but the white cover needs some patch.
Drill Holes
After ESP32-C5 entered deep sleep, you can simply press the reset button to wake it up again. But it is hard to press the tiny button inside the Tic Tac box. The simplest way is screw a hole just on the reset button, then screw a screw on it to extend the button. The distance between the box and the button is around 8 mm, you can use any similar size screw in hand to do the job.
Another 2 bigger holes are for hang on the keychain.
Assembly
Finally, squeeze all together.
Time to Showoff!
Now you can bring this portable Dual band WiFi Analyzer along with you!