Skip to content

About

Dual-radio 2.4GHz spectrum analyzer - ESP32 + 2x NRF24L01+ (receive-only, legal RF diagnostic tool)

Resources

Stars

4 stars

Watchers

0 watching

Forks

Latest commit

ย 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ“ก NRF24-Spectrum-Scanner

A dual-radio 2.4 GHz band analyzer โ€” ESP32 + 2ร— NRF24L01+

See the invisible. Legally.

A receive-only RF diagnostic tool that paints a live picture of everything happening in the 2.4 GHz ISM band around you โ€” WiFi, Bluetooth, Zigbee, microwave ovens, RC links โ€” on an OLED and in your browser.


Platform Radios Framework Build License Mode


โš–๏ธ 100% legal. The NRF24 modules are used purely as energy detectors โ€” they never transmit. This is a passive spectrum analyzer, not a jammer.


โœจ Features

๐Ÿš€ Dual-radio parallel sweep Radio A covers ch 0โ€“62, Radio B covers ch 63โ€“125 โ†’ ~2ร— sweep speed
๐ŸŒˆ Full 2.4 GHz coverage All 126 NRF24 channels (2.400โ€“2.525 GHz), ~20 sweeps/sec
๐Ÿ“บ OLED live display Two pages: spectrum bar graph with peak-hold, and peak stats
๐ŸŒ Browser web UI Color-coded chart with band overlays (WiFi / BLE / Zigbee / microwave)
๐Ÿ“Š CSV serial logging Full spectrum dump every 5s for offline analysis
๐Ÿ›ก๏ธ Graceful degradation Unplug one radio? The other half keeps sweeping
๐Ÿ”Œ Hot-plug friendly Radios detected at boot, status shown live

๐Ÿ—๏ธ Architecture

graph TD
    A[Radio A - NRF24L01+] -->|VSPI| E[ESP32]
    B[Radio B - NRF24L01+] -->|HSPI| E
    E -->|I2C| O[SSD1306 OLED]
    E -->|WiFi AP| W[Browser Web UI]
    E -->|Serial| C[CSV Log]
    subgraph 2.4 GHz Band
    A
    B
    end
Loading

Each radio walks half the band. The firmware merges both halves into one 126-channel spectrum every cycle, then renders it to the OLED, the web UI, and the serial CSV log.

2.400 GHz                                        2.525 GHz
    |โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Radio A (VSPI) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€|โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Radio B (HSPI) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€|
    ch 0                              ch 62  ch 63                         ch 125

๐Ÿงฐ Hardware

Component Qty Notes
ESP32-WROOM-32 dev board 1 Any variant with the pins below free
NRF24L01+ module 2 Add a 10 ยตF cap across VCC/GND on each โ€” they're picky about power
SSD1306 OLED 128ร—64 1 I2C, address 0x3C
10 ยตF electrolytic capacitor 2 One per radio โ€” not optional
Breadboard + jumpers ~20 Female-to-male fit the NRF24 header

๐Ÿ”Œ Wiring (quick reference)

NRF24 Pin Radio A (VSPI) Radio B (HSPI)
CE GPIO 22 GPIO 16
CSN GPIO 21 GPIO 15
SCK GPIO 18 GPIO 14
MOSI GPIO 23 GPIO 13
MISO GPIO 19 GPIO 12
VCC 3.3V 3.3V
GND GND GND

OLED: SDA โ†’ GPIO 4 ยท SCL โ†’ GPIO 5 ยท VCC โ†’ 3.3V ยท GND โ†’ GND

โš ๏ธ NRF24 modules run on 3.3V only. Never connect VCC to 5V โ€” it will kill the radio.

๐Ÿ“– Full step-by-step guide with circuit diagrams: docs/wiring.md


๐Ÿš€ Quick Start

1. Flash it

pio run -t upload
pio device monitor

Or open the folder in VS Code with the PlatformIO extension and hit Upload.

2. Watch the OLED

Within ~2 seconds you'll see A+ B+ and live spectrum bars.

3. Open the web UI

Connect to the ESP32's WiFi AP and open the dashboard:

๐Ÿ“ถ SSID NRF24-Scope
๐Ÿ”‘ Password spectrum24
๐ŸŒ URL http://192.168.4.1

๐ŸŒ Web UI

The browser shows a full-resolution spectrum chart with:

  • ๐ŸŽจ Color-coded bars โ€” green (quiet) โ†’ yellow โ†’ red (busy)
  • ๐Ÿ—บ๏ธ Band overlays โ€” semi-transparent markers for known 2.4 GHz bands
  • ๐Ÿ“ˆ Live stats โ€” radio health, sweep counter, peak channel + frequency + level
  • ๐Ÿท๏ธ Legend โ€” all marked bands with colors

Band overlays

Band NRF24 ch Color Typical source
WiFi 1 1โ€“5 ๐Ÿ”ต Blue WiFi channel 1 (2412 MHz)
WiFi 6 4โ€“8 ๐Ÿ”ต Blue WiFi channel 6 (2437 MHz)
WiFi 11 9โ€“13 ๐Ÿ”ต Blue WiFi channel 11 (2462 MHz)
BLE adv 0โ€“2 ๐ŸŸข Green BLE advertising (ch 37/38/39)
Zigbee 11โ€“26 ๐ŸŸ  Orange Zigbee / Thread channels
Microwave 40โ€“70 ๐Ÿ”ด Red Oven leakage (~2.45 GHz)

API endpoints

URL Purpose
/ Main web UI
/data JSON โ€” full spectrum + stats
/toggle Switch OLED page (spectrum โ†” peak stats)

๐Ÿ“บ OLED Pages

Page 1 โ€” Spectrum (default)

A+ B+ #1234
[live bar graph with peak-hold dots]

Page 2 โ€” Peak stats

PEAK STATS
Ch: 6 (2406 MHz)
Level: 87%
Sweeps: 1234
Radio A: OK
Radio B: OK

Toggle via http://192.168.4.1/toggle.


๐Ÿ“Š CSV Logging

The firmware dumps a CSV line every 5 seconds to serial:

CSV,timestamp_ms,ch0,ch1,ch2,...,ch125

Capture it:

pio device monitor > spectrum_log.csv

Then analyze offline โ€” see docs/usage.md for a ready-to-run Python/pandas example.


๐Ÿ” Reading the Spectrum

What you see What it is
Tall bars at ch 1โ€“5 / 4โ€“8 / 9โ€“13 ๐Ÿ“ถ WiFi channels 1 / 6 / 11
Hopping spikes across ch 0โ€“79 ๐ŸŽง Bluetooth classic
Persistent spikes at ch 0โ€“2 ๐Ÿ“ณ BLE advertising
Broad hump at ch 40โ€“70 ๐Ÿฟ Microwave oven (when running)
Periodic narrow spikes at ch 11โ€“26 ๐Ÿ Zigbee / Thread
Fixed repeating narrow spikes ๐ŸŽฎ RC links, wireless keyboards/mice

๐Ÿ“š Documentation

  • ๐Ÿ”ง docs/wiring.md โ€” step-by-step wiring, circuit diagrams, troubleshooting
  • ๐Ÿ“– docs/usage.md โ€” web UI, OLED, CSV logging, signal interpretation, performance notes

โš™๏ธ Performance

Metric Value
Sweep rate ~20 full-band sweeps/sec (50 ms/sweep)
Sensitivity ~โˆ’64 dBm (NRF24 carrier-detect threshold)
Resolution 1 MHz per channel (126 channels / 126 MHz)
Web UI latency 300 ms refresh
OLED latency 50 ms refresh

This is a poor-man's spectrum analyzer โ€” energy presence only, no demodulation. That's exactly what makes it legal and safe. For protocol-level decoding you'd need an SDR or dedicated sniffer.


๐Ÿ“„ License

MIT โ€” see LICENSE. Built from scratch, yours to use and modify.


โš–๏ธ Legal

This device is receive-only and does not transmit, interfere with, or disrupt any radio communications. It is a passive diagnostic tool suitable for education, hobby use, and site surveys. Always follow your local regulations regarding radio equipment.

About

Dual-radio 2.4GHz spectrum analyzer - ESP32 + 2x NRF24L01+ (receive-only, legal RF diagnostic tool)

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages