ESP-NOW Dual Controller v2.0

Ground Proximity Warning System

An advanced dual-ESP32 wireless flight safety system featuring precision VL53L1X Laser ToF distance sensing, progressive multi-sensory warnings, 2.42" OLED telemetry UI, live web configuration, and dual DC motor flight controls.

GPWS Hardware System Overview
2× ESP32
Dual Wireless Controllers
4.0 m
Laser ToF Precision
2.42"
OLED Telemetry UI
6× Tracks
Voice & Sound Alerts
50 Hz
ESP-NOW Sync Rate
Key Capabilities

Built for Precision & Flight Safety

Integrated modular architecture providing real-time terrain evaluation and progressive warning triggers.

Dual VL53L1X ToF Sensors

High-accuracy laser Time-of-Flight sensors measuring ground clearance (Altitude) and forward terrain (Obstacle) up to 4 meters away with mm accuracy.

ESP-NOW Low Latency

Peer-to-peer 2.4 GHz wireless protocol ensures sub-10ms latency telemetry transfer between MAIN sensor rig and SUB telemetry display unit.

Progressive Multi-Sensory Alert

Synchronized RGB LED, adaptive active buzzer frequency, alternating DFPlayer audio warnings, and OLED inverted display flashing.

Live Web Configuration

On-board WiFi AP dashboard (GPWS-Gateway) allowing dynamic threshold tuning for altitude, obstacle distance, and voice audio volume saved to NVS flash.

Flight Joystick Motor Control

Dual dual-axis joysticks with center-deadzone mapping driving L298N dual DC motors via 8-bit PWM speed control.

Latched Power Management

Smart 1.5-second long-press power toggle via Joystick 1 switch with single-event detection, startup and shutdown voice confirmation.

Wireless Topology

System Architecture

Distributed dual-ESP32 architecture communicating seamlessly over ESP-NOW wireless links.

GPWS Dual-ESP32 Architecture Diagram
ESP32 MAIN (Sensor & Drive Unit)
  • Dual VL53L1X Laser ToF: Altitude & Obstacle
  • L298N Dual Motor Driver: 2× DC Motors with PWM Speed Scaling
  • Role: Measures distance telemetry, transmits to SUB, executes joystick motor commands
ESP32 SUB (Telemetry & Alert Hub)
  • 2.42" OLED Display: 128×64 resolution driven by U8g2lib
  • Multi-Sensory Alerts: Common Cathode RGB LED + Active Buzzer + DFPlayer Mini MP3
  • Web Portal AP: Hosts `GPWS-Gateway` configuration web server at `192.168.4.1`
  • Dual Analog Joysticks: Motor control inputs & Power Toggle switch
Safety Logic

Progressive Alert System & Live Simulator

Dynamic warning escalation based on proximity thresholds with interactive OLED telemetry test.

GPWS Alert Levels Visualization
2.42" OLED (128x64)
GPWS MODE: ACTIVE
ALT: 45.0cm [OK]
OBS: 60.0cm [OK]
STATUS: SAFE

Live Telemetry Simulator

Alert Level Altitude Boundary Obstacle Boundary RGB LED Active Buzzer OLED Display Text
Safe ≥ 30.0 cm ≥ 50.0 cm Solid Green Off STATUS: SAFE
Warning 15.0 – 30.0 cm 25.0 – 50.0 cm Blinking Yellow Synced Beep (150–500ms) WARNING: LOW ALT / OBSTACLE
Critical < 15.0 cm < 25.0 cm Fast Blinking Red Fast Beep (50–150ms) DANGER: LOW ALT! / OBSTACLE!
Dual-Sensor Alert Mode: When both altitude and obstacle sensors breach warning levels simultaneously, the OLED status highlights ALT+OBS! and audio alerts automatically alternate between both warning tracks each 3-second cycle.
Voice Guidance

DFPlayer Audio Alerts Matrix

Dedicated MP3 voice tracks providing instant auditory pilot warnings.

01
0001.mp3
System Ready (Startup / Power ON)
Startup
02
0002.mp3
Low Altitude Warning (15–30 cm)
Warning
03
0003.mp3
Low Altitude Critical (< 15 cm)
Critical
04
0004.mp3
Obstacle Warning (25–50 cm)
Warning
05
0005.mp3
Obstacle Critical (< 25 cm)
Critical
06
0006.mp3
Shutdown Signal (Power OFF)
Shutdown
MicroSD Card Formatting Rule: Format SD card as FAT32. Copy MP3 files into root directory one by one strictly in sequence order (0001.mp3 → 0006.mp3) to ensure correct FAT index allocation by DFPlayer hardware.
Pin Mapping

Hardware Wiring Specifications

Pinout configurations for both ESP32 units.

ESP32 MAIN Pinout Table

Component Pin ESP32 GPIO Operating Notes
VL53L1X #1 (Altitude) SDA / SCL GPIO 21 / GPIO 22 Shared I2C Bus
VL53L1X #1 (Altitude) XSHUT GPIO 13 Address dynamically changed to 0x30
VL53L1X #2 (Obstacle) SDA / SCL GPIO 21 / GPIO 22 Shared I2C Bus
VL53L1X #2 (Obstacle) XSHUT GPIO 26 Keeps default I2C address 0x29
L298N Motor Driver A IN1 / IN2 / ENA GPIO 32 / 33 / 18 Motor A Direction & PWM Speed (8-bit)
L298N Motor Driver B IN3 / IN4 / ENB GPIO 25 / 4 / 19 Motor B Direction & PWM Speed (8-bit)

ESP32 SUB Pinout Table

Component Pin ESP32 GPIO Operating Notes
2.42" OLED Display SDA / SCL / VCC GPIO 21 / 22 / 5V (VIN) I2C Address 0x3C. Requires 5V supply for 2.42" SSD1306/SSD1309 panels.
Joystick 1 (Motor A Control) VRx / VRy / SW GPIO 34 / 35 / 32 SW Switch long-press (1.5s) triggers System Power Toggle
Joystick 2 (Motor B Control) VRx / VRy / SW GPIO 33 / 36 / 26 Analog read on ADC1 channel (WiFi compatible)
RGB LED (Common Cathode) R / G / B GPIO 16 / 17 / 18 Visual indicator (Green/Yellow/Red)
Active Buzzer Signal GPIO 19 Auditory alert generator
DFPlayer Mini Module TX (pin 3) / RX (pin 2) GPIO 23 / 4 RX connected via 1kΩ inline resistor to mitigate noise.
Web Interface

WiFi Configuration Dashboard

The ESP32 SUB unit creates a standalone Access Point allowing real-time calibration of distance safety thresholds and volume levels straight from any mobile browser or computer.

AP SSID: GPWS-Gateway
AP Password: GPWS@2026Secure
Dashboard URL: http://192.168.4.1
Parameter Default Description
altSafe 30.0 cm Altitude Safe boundary
altWarn 15.0 cm Altitude Warning/Critical threshold
obsSafe 50.0 cm Obstacle Safe boundary
obsWarn 25.0 cm Obstacle Warning/Critical threshold
volume 25 (0–30) DFPlayer speaker volume level