Skip to content

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ESP32-Drone

ESP32-Drone - Wi‑Fi quadcopter flight stack with browser UI

cifertech - ESP32-Drone stars - ESP32-Drone forks - ESP32-Drone Platform Arduino


 

🌟 About the Project

Welcome to ESP32-Drone, an open-source flight controller firmware for ESP32-based mini quads. It pairs MPU6050 attitude sensing with a Madgwick filter, attitude PID stabilization at 250 Hz, and a dark-themed web control panel served over Wi‑Fi. Joystick input, tuning, motor checks, and configuration all run in the browser via HTTP and WebSockets.

⚠️ Safety: Flying multirotors can cause injury or property damage. Use only where permitted, with propellers removed during bench testing when appropriate, and never arm unless you understand the controls. This project is for education and hobby use — you are responsible for compliance with local laws and safe operation.

Replace factory Wi‑Fi credentials in Firmware.ino (or save new ones in Settings) before deploying.

MVI_8465 00_05_06_05 Still029
 

🎯 Features

🎮 Flight & control

  • Virtual sticks — Roll, pitch, yaw, throttle over WebSocket (JOY:)
  • ARM / DISARM — Props enabled only when armed; instant ESTOP
  • IMU calibrateCALIBRATE over WebSocket (drone still on a level surface)
  • Angle mode — Sticks command target tilt (within configurable max tilt); optional direct mix when PID is off

🧠 Stabilization & sensors

  • MPU6050 on I2C (default SDA 21, SCL 22; NVS configurable)
  • Madgwick AHRS with adjustable beta
  • PID loop — Live Kp / Ki / Kd from the PID tab; enable/disable stabilization without reflash
  • Idle throttle % — Optional minimum throttle at zero stick when armed (0–40%)

📡 Connectivity & UI

  • Wi‑Fi STA — Connects using SSID/password from NVS or sketch defaults
  • Web UI (/) — Single-page app: Flight, Telemetry, PID, Motor Test, Settings
  • Telemetry — ~20 Hz JSON: attitude, motor PWM, arm state, PID gains, loop rate, link packet stats
  • Motor test — Per-motor PWM sliders when disarmed (with short hold after release)

⚙️ Configuration (NVS dronecfg)

  • Wi‑Fi SSID and password (optional clear password)
  • Motor GPIO pins, PWM frequency and resolution
  • I2C pins, Madgwick beta, max tilt degrees
  • /restart POST for reboot after pin changes
MVI_8465 00_05_30_09 Still031
 

🔧 Hardware Overview

⚠️ PCB / hardware risk: This board is a custom, experimental PCB — it may have layout or wiring issues and is not guaranteed for any use case. Check polarity, power, and grounds before applying voltage or flying. Firmware cannot fix bad hardware. No warranty — use at your own risk.

Typical build:

Block Notes
MCU ESP32 (Arduino-ESP32 core)
IMU MPU6050 @ 0x68, I2C
Motors Four brushed (or ESC) outputs — X quad mix: FL, FR, BL, BR
Wi‑Fi Antenna as per your module; set credentials for your network

Default GPIO pins in firmware (change in sketch or Settings + restart):

Motor Default pin
Front left 33
Front right 4
Back left 25
Back right 32
IMG_0341
 

🛠️ Software Requirements

  • Arduino IDE or Arduino CLI with esp32 board support

  • Libraries (install via Library Manager where possible):

    • WiFi, WebServer, WebSocketsServer (by Markus Sattler / links2004), Wire, Preferences — as used in Drone.ino
 

📥 Flashing

  1. Open Drone.ino in Arduino IDE (or add this folder as a sketch).
  2. Select your ESP32 board and correct COM port.
  3. Set DEF_WIFI_SSID / DEF_WIFI_PASS (or configure later in the web Settings tab).
  4. Upload the sketch.
  5. Open Serial Monitor @ 115200 — note the IP address after Wi‑Fi connects.
  6. On your phone or PC browser: http://<IP>/ — use Flight to connect WebSocket (port 81); the page handles this when served from the device.

Motor / I2C / PWM changes from Settings require Save then Restart when prompted.

 

⚠️ License

Distributed under the MIT License. See LICENSE.txt for more information.

🤝 Contact

▶ Support me on Patreon patreon.com/cifertech

CiferTech - @twitter - CiferTech@gmali.com

Project Link: https://github.com/cifertech/ESP32-DIV

💬 Support & Contributions

  • 💬 Found a bug or have a feature request? Open an Issue
  • ⭐ Like the project? Star the repo!
  • 🛠 Want to contribute? Fork it and submit a pull request.

About

Wi‑Fi quadcopter flight stack with browser UI

Topics

Resources

Stars

37 stars

Watchers

0 watching

Forks

Contributors

Languages