Real-time 24 GHz mmWave radar motion tracker for the ESP32-S3, HLK-LD2450 multi-target radar sensor, and SSD1306 128Γ64 OLED display β with both Arduino C++ and CircuitPython 9.x firmware plus a zero-install Web Serial live radar scope.
Try it in your browser: Launch the Live Web Serial Radar Scope β
Runs an interactive 3-target simulation out of the box, or click Connect ESP32 (Web Serial) in Chrome/Edge to plot live raw binary LD2450 frames or JSON telemetry from your board.
| Component | Pin | ESP32-S3 (ProS3) | Notes |
|---|---|---|---|
| HLK-LD2450 | VCC / GND |
5V / GND |
5 V regulated supply required |
| HLK-LD2450 | TX / RX |
GPIO 44 (RX) / GPIO 43 (TX) |
UART @ 256000 baud |
| SSD1306 OLED | VCC / GND |
3.3V / GND |
128Γ64 monochrome I2C |
| SSD1306 OLED | SDA / SCL |
GPIO 8 / GPIO 9 |
Auto-detects 0x3D or 0x3C |
- 3-Target Simultaneous Tracking: Proper HLK-LD2450 16-bit sign-magnitude decoding for X/Y coordinates, radial speed (cm/s), distance, and azimuth angle (Β±60Β°, up to 6 m), plus 500 ms stale-frame auto-clear.
- Unified CircuitPython Firmware (
circuitpython/code.py): Switch betweenalien,sweep,minimal, anddiagnosticdisplay themes with one variable, auto-fallback OLED I2C detection (0x3Dβ0x3C), NeoPixel proximity indicator, and JSON USB telemetry streaming. - Optimized Arduino C++ Firmware (
arduino/):HLK_LD2450.handRadarDisplay.hwith PlatformIO support (platformio.ini). - Live Browser Radar Scope (
docs/index.html): Zero-install Web Serial viewer with phosphor target trails, range rings, and live distance/speed cards. - Automated Protocol Tests: Both
arduino/HLK_LD2450.h(C++17) andcircuitpython/ld2450.py(Python) are unit-tested in GitHub Actions CI.
- Install CircuitPython 9.x on your ESP32-S3 and copy
adafruit_ssd1306(and optionalneopixel) intoCIRCUITPY/lib/. - Copy
circuitpython/code.pyandcircuitpython/ld2450.pyto the root of yourCIRCUITPYdrive (or runpython utils/deploy_circuitpython.py). - Edit
DISPLAY_MODE = "alien"("alien","sweep","minimal", or"diagnostic") at the top ofcode.py.
- Install Adafruit SSD1306 and Adafruit GFX Library (or run
pio run -t uploadinarduino/). - Open
arduino/ESP32_Radar_Tracker.ino, select ESP32-S3 Dev Module, and upload.
Open eric-rolph.github.io/esp32-radar-tracker in Chrome or Edge, select 115200 baud (ESP32 USB) (or 256000 baud for a direct USB-UART adapter on the LD2450), and click Connect ESP32 (Web Serial).
esp32-radar-tracker/
βββ arduino/ # Arduino C++ / PlatformIO firmware
β βββ ESP32_Radar_Tracker.ino
β βββ HLK_LD2450.h # Sign-magnitude frame parser + 500ms stale timeout
β βββ RadarDisplay.h # 128x64 OLED graphics renderer
β βββ platformio.ini
βββ circuitpython/
β βββ code.py # Unified tracker (alien / sweep / minimal / diagnostic)
β βββ ld2450.py # Reusable pure-Python HLK-LD2450 parser
β βββ diagnostics/ # I2C scanner, raw byte & protocol debug tools
β βββ legacy/ # Earlier standalone display experiments & notes
βββ docs/
β βββ index.html # Zero-install Web Serial Live Radar Scope (GitHub Pages)
β βββ wiring_diagram.svg # Pinout & wiring graphic
βββ tests/
β βββ test_ld2450.cpp # Native C++17 unit tests for HLK_LD2450.h
β βββ test_ld2450.py # Pytest suite for circuitpython/ld2450.py
βββ utils/ # Cross-platform serial monitor & deploy utilities
| Parameter | Value |
|---|---|
| Operating Frequency | 24 GHz FMCW mmWave |
| Detection Range | 0 β 6 meters |
| Azimuth Field of View | Β±60Β° |
| Max Simultaneous Targets | 3 |
| Serial Protocol | UART, 256000 baud, 8N1 (AA FF 03 00 β¦ 55 CC) |
| Refresh Rate | ~10 Hz |
# Python parser tests
pytest tests/test_ld2450.py -v
# C++ header tests
g++ -std=c++17 -I tests/mocks -I arduino tests/test_ld2450.cpp -o test_ld2450 && ./test_ld2450