Lora SA(Spectrum Analyzer)
RF Spectrum Analyzer using Lora Radio
Based on RadioLib SX126x Spectrum Scan.
Perform a spectrum power scan using SX126x. The output is in the form of scan lines; each line has 33 power bins. The first power bin corresponds to -11 dBm, the second to -15 dBm, and so on. The higher number of samples in a bin corresponds to more power received at that level.
N in Bin / dBm
1 -11
2 -15
3 -19
4 -23
5 -27
6 -31
7 -35
8 -39
9 -43
10 -47
11 -51
12 -55
13 -59
14 -63
15 -67
16 -71
17 -75
18 -79
19 -83
20 -87
21 -91
22 -95
23 -99
24 -103
25 -107
26 -111
27 -115
28 -119
29 -123
30 -127
31 -131
32 -135
33 -139
Example:
step-13 Frequancy:816.25
Power Bins: 0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0400, 0000,0000,0000,0000,0000,0000,0006,001B,000E,0005,0006,0002,0000
The spectrum analyzer performs power measurements in the configured bandwidth.
The X-axis represents frequency in MHz, and the Y-axis displays actually received power. In the example above, the frequency span goes from 850 MHz to 950 MHz (that is a 100MHz range), and the visual amplitude goes from -11 dBm to -110(-139) according to the datasheet(High sensitivity: down to -148dBm) dBm.
To show the results in a plot, run the Python script RadioLib/extras/SX126x_Spectrum_Scan/SpectrumScan.py
Features
Multiple Ranges Scan
Disabled By Default
// Feature to scan diapazones. Other frequency settings will be ignored.
int SCAN_DIAPAZONES[] = {};
//int SCAN_DIAPAZONES[] = {850890, 920950};
To Enable Add/ uncomment an array of the frequencies
int SCAN_DIAPAZONES[] = {850890, 920950};
where 850890 stands for 950-890Mhz range 920950 - 920-890Mhz Other settings will be ignored if Multiple Ranges Scan is enabled.
Waterfall
Waterfall showed only on One Page Scan to disable - un comment this line
#define WATERFALL_ENABLED true
Waterfall shows the last N = SCREAN_HEIGHT (64) - WATERFALL_START(37) - 8 (part of the STATUS_TEXT_TOP) = 19 signal detection that excited set signal level
RSSI Method of scan
by default we are using spectralScan method of the RadioLib Library this method works only with Sx1262 modules. we are implemented scan using getRSSI method which has more flexibility and supports sx1276 modules. using this method we also receiving dB values of the signal not just O-33 number... to enable this method set value of the RSSI_METHOD to true.
Multi Screen Scan
Single screen scan for now has RANGE / 128 resolution. Multi-page scan can be adjusted to how many MHz per page you wanna scan
// frequency range in MHz to scan
#define FREQ_BEGIN 850
// TODO: if % RANGE_PER_PAGE != 0
#define FREQ_END 950
// Feature to scan diapazones. Other frequency settings will be ignored.
int SCAN_DIAPAZONES[] = {};
// int SCAN_DIAPAZONES[] = {850890, 920950};
// MHZ per page
//To put everething into one page set RANGE_PER_PAGE = FREQ_END - 800
unsigned int RANGE_PER_PAGE = FREQ_END - FREQ_BEGIN; // FREQ_END - FREQ_BEGIN
//To Enable Multi Screen scan
// unsigned int RANGE_PER_PAGE = 50;
// Default Range on Menu Button Switch
#define DEFAULT_RANGE_PER_PAGE = 50;
To enable Multi-page by default set RANGE_PER_PAGE less than FREQ_END - FREQ_BEGIN; Switch to multi-page during regular One Screen application run. Restart the ESP32 on screen after the logo press the P button.
Mute Autio Notifications
Restart ESP32, and on the logo display, press the P button.
Pause Execution
Press P for more than 2 seconds. Execution will pause, and the scan's current Mhz position will be shown on the display. If less, ESP32 will turn off. Fast pressing(less than 0.5 second) P button changes the notification level
VSCode Platform.IO development env installation
- Install VSCode
- install Platfor.IO extension
- Connect ESP32 to USB. Install USB drivers for Windows
- Clone this Git Repo or download zip of the sources
git clone https://github.com/Genaker/LoraSA.git
NOTE: in you case name will be Just LoraSA. I have LoraSA2 because I already have LoraSA folder
6. Open the Project with the VS code Platform.IO
-
Select ESP32 USB Device to program
Note: It is theoretically possible to program via WiFi and BTH.
-
Wait until you are done with the compilation and upload. Usually takes 1 minute. The first run is slower. It needs to compile all libraries.
You will have the UCOG SA logo and spectrum analyzing scanning screen when done.
Hardware
Heltec ESP32 Lora V3: https://www.amazon.com/Heltec-Development-863-870MHz-ESP32-S3FN8-902-928MHz/dp/B0D1H1FN9Y/ https://heltec.org/project/wifi-lora-32-v3/ https://www.aliexpress.us/item/3256807037422978.html
Battery with Wire JT connector : https://www.amazon.com/EEMB-2000mAh-Battery-Rechargeable-Connector/dp/B08214DJLJ
3D printed case
https://www.printables.com/model/118750-heltec-lora-32-case-for-meshtastic
https://www.thingiverse.com/thing:3125854
https://thangs.com/designer/Snake0017/3d-model/Heltec%20LoRa%2032%20Desktop%20%26%20Vehicle%20Enclosure-40844
or buy :
https://www.amazon.com/DIYmalls-ESP32-OLED-WiFi-Type-C/dp/B0BR3MQ9BG
https://www.thingiverse.com/thing:6522462
Heltec ESP32 Lora v3 Pin Map
We are using pin 41 as a Buzzer trigger. Connect buzzer + leg with pin 41 and - leg with the ground (GND). You can change the buzzer pin in the code.