songge8/CF-Drone

ESP32无人机飞控固件

What it solves

This is flight-control firmware for hobby drones built around ESP32 microcontrollers. It handles the essentials of flying: reading attitude from a 6500/9250 sensor, driving motors with PWM, keeping the battery safe, and letting you pilot from a web browser instead of a dedicated radio handset. It also protects the hardware — the drone refuses to arm when voltage is low, auto-locks and auto-lands, and shuts down motors if the drone sits upside down for too long.

How it works

Firmware runs on ESP32-family boards (ESP32, ESP32-S3, and later ESP32-C3) paired with specific attitude sensors (6500/9250). Motor pins, WiFi credentials, and throttle limits (MOT_THR_MIN and MOT_THR_MAX) are configurable through a debug console, so the same code adapts to different builds. A built-in web server serves a control page over WiFi; the firmware sends commands at 20Hz by default for performance, and signal quality is measured in the browser rather than the server because it proved more accurate. A status LED communicates state: slow flashing when armed, fast flashing for warnings like low battery or lost connection. An inverted-detection check stops the motors if the drone remains flipped over for an extended time, preventing further damage.

Who it’s for

Hobbyists and makers who build or fly small ESP32-based drones, especially those using the Chenguang E1 series frames (E1_MINI and E1_Nano), whose schematics are published on the JLC open-source hardware platform. It’s also useful for anyone wanting a WiFi/web-controlled quadcopter firmware they can tune via a console without re-flashing.

Highlights

  • Supports ESP32, ESP32-S3, and ESP32-C3 boards with 6500/9250 attitude sensors
  • Web-browser remote control over WiFi, no dedicated radio needed
  • Battery protections: voltage-detection accuracy improvements, low-battery arming block, auto-lock, and auto-landing
  • Configurable throttle thrust bounds (MOT_THR_MIN and MOT_THR_MAX) for tuneable control
  • Motor pin and WiFi username/password are parameterized and settable from a debug console
  • LED status indicator: slow flash = armed, fast flash = low battery or lost link
  • Inverted-protection logic shuts the drone down if flipped over for too long
  • Official hardware designs for the E1_MINI and E1_Nano are open-sourced on the JLCPCB open-hardware platform

Related

  • Project
  • Project
  • Project
  • Project