Project Overview
The "Hand-Controlled ESPcopter" is an advanced modular drone project that leverages the ESP8266 WiFi SoC to create an interactive, programmable flight platform. Unlike closed-source consumer drones, the ESPcopter is designed for developers. By adding a Multi-ranger Shield, the drone gains a 360-degree awareness of its surroundings via four laser rangers. This project demonstrates how to implement a "virtual bumper" or "hand-follow" mode, allowing the pilot to push or navigate the drone simply by moving their hands near the aircraft, all while the onboard computer handles the complex stabilize-and-avoid flight logic.
Nowadays, we are seeing a lot of drones that has an obstacle avoidance and hand control feature, is a toy or video drone. In the background of these products, there are a lot of programming algorithms. But, we could not see or edit these algorithms. Unlikely drone market, ESP8266-Powered Mini Drone: ESPcopter is programmable with Arduino and also is a modular drone. Users can add new features by using expansion shields.
Technical Deep-Dive
- VL53L0X Time-of-Flight (ToF) Sensors: The multi-ranger shield utilizes four VL53L0X sensors. Unlike traditional infrared sensors that depend on signal intensity, ToF sensors measure the actual flight time of a laser pulse. This provides precise millimeter-level accuracy regardless of the color or reflectivity of the obstacle (up to 1000mm). The code uses
tcaselect()to manage an I2C multiplexer, allowing the ESP8266 to poll each sensor sequentially without address conflicts. - Sensor Fusion & Median Filtering: Raw sensor data from a drone is notoriously noisy due to motor vibrations and air currents. The firmware implements a Median Filter via a Bubble Sort algorithm. By taking 5 consecutive samples and selecting the middle value, the system effectively discards "spikes" and "outliers" that could otherwise cause erratic flight adjustments.
- Complementary Control Filter: After finding the median, a Complementary/Low-pass filter is applied (
calSensor). This math ensures that the drone moves smoothly rather than twitching. It gradually updates the currentDistancevalue towards thetargetvalue, using a configurablealphaconstant to balance responsiveness vs. stability. - Closed-Loop PID Integration: The smoothed distance values are fed directly into the ESPcopter's PID (Proportional-Integral-Derivative) control loops. For example, if the right sensor detects a hand at 100mm, the PID controller calculates a negative Roll error, commanding the motors to move the drone to the left until the equilibrium distance is restored.
Engineering & Modular Design
- Modular Architecture: The ESPcopter is built on an open-hardware philosophy. The expansion shields (Multi-ranger, BME280, etc.) plug directly into the main frame, and the ESPcopter SDK provides pre-compiled flight stability routines. This allows students to focus on "High-Level" logic—like air hockey algorithms or autonomous maze navigation—without needing to manually calculate quaternion rotations.
- Hardware Efficiency: The use of an ESP8266 allows for Over-the-Air (OTA) updates and smartphone telemetry. The small frame and high-power-to-weight ratio of the brushed motors make it safe for indoor laboratory use, providing a stable platform for testing collision-avoidance theories in a physical 3D space.