In recent years, the integration of bionics into unmanned aerial vehicle (UAV) design has opened new frontiers in robotics, particularly for applications requiring agility, stealth, and energy efficiency. Among these, the flying butterfly drone—a biomimetic UAV inspired by the flight mechanics of butterflies—has garnered significant attention due to its potential in surveillance, environmental monitoring, and recreational uses. As a researcher in this field, I have focused on developing a robust flight control system that leverages Bluetooth communication for remote operation, aiming to enhance the stability, controllability, and real-time responsiveness of such drones. This article details my comprehensive approach to designing and implementing this system, from hardware selection and circuit design to software development and experimental validation. Throughout the process, I prioritized the use of lightweight components, low-power communication protocols, and advanced control algorithms to create a functional flying butterfly drone that mimics natural flight patterns while offering practical usability.
The core objective of this project was to create a flying butterfly drone capable of stable flight and precise control via a mobile application, using Bluetooth as the primary communication medium. Bluetooth technology, with its low energy consumption, cost-effectiveness, and ease of integration, presents an ideal solution for short-range wireless control in micro-UAVs. By employing an STC8H1K08 microcontroller as the central processing unit and an HLK-B40 Bluetooth module for data transmission, I engineered a system that seamlessly connects with a custom Android app built using MIT App Inventor. This setup allows users to command the flying butterfly drone with intuitive gestures, such as directing it to ascend, descend, turn left or right, or switch between autonomous and manual modes. The integration of sensors like a barometer and gyroscope enables real-time feedback for flight stabilization, while PID and fuzzy control algorithms ensure adaptive responses to environmental disturbances. In the following sections, I will elaborate on the system architecture, hardware and software components, communication protocols, and performance tests, emphasizing how each element contributes to the overall functionality of the flying butterfly drone.
The system architecture of the flying butterfly drone is divided into hardware and software subsystems, which work in tandem to achieve coordinated flight. As illustrated in the conceptual diagram, the hardware comprises a core controller, Bluetooth module, sensors, actuators, and a power source, all interconnected on a compact flight control board. The software side includes the microcontroller firmware, mobile application, and communication protocols that govern data exchange. The core controller acts as the brain, processing inputs from the mobile app via Bluetooth and sensor data to generate control signals for the actuators. Specifically, the flying butterfly drone utilizes a lightweight mechanical structure with wings fabricated from PET film and carbon fiber, driven by a micro DC motor for flapping motion and a servo for center-of-gravity adjustment. This design mimics the natural kinematics of butterflies, allowing for lifelike flight maneuvers. To support this, I developed a detailed communication protocol based on Bluetooth 5.0, ensuring reliable data transmission with minimal latency. The entire system is powered by a lithium-ion battery, with power management circuits regulating voltage levels for different components. By optimizing each layer of this architecture, I aimed to create a flying butterfly drone that balances performance, durability, and user accessibility.

The flight control circuit design is critical to the operation of the flying butterfly drone, as it integrates all electronic components into a cohesive unit. I selected hardware based on factors such as power consumption, size, weight, and compatibility, ensuring that the flying butterfly drone remains agile and efficient. Below is a table summarizing the key hardware components and their specifications:
| Component | Model/Specifications | Function in Flying Butterfly Drone |
|---|---|---|
| Core Controller | STC8H1K08-36I-TSSOP20 microcontroller | Processes control algorithms and manages I/O interfaces |
| Bluetooth Module | HLK-B40 (Bluetooth 5.0, up to 921600 bps) | Enables wireless communication with mobile app |
| Barometer | SPL06-001 | Measures altitude via pressure and temperature data |
| Gyroscope | MPU-6050 | Provides 3-axis acceleration and angular velocity for attitude calculation |
| Actuator: Motor | Micro DC motor (6mm diameter, 1.59g weight) | Drives wing flapping at adjustable frequencies |
| Actuator: Servo | Micro servo (13.5×6.2×20.1mm, 1.7g weight) | Adjusts center of gravity for directional control |
| Power Source | Lithium-ion battery (3.7V nominal) | Supplies energy to all components; managed by AMS1117-3.3 regulator |
The circuit schematic, which I designed using EDA tools, includes a power management section where the AMS1117-3.3 voltage regulator converts the battery output to 3.3V for low-power components, while the motor and servo draw power directly from the battery to ensure sufficient torque. Sensors are connected via I²C bus, with unique addresses allowing the microcontroller to poll data sequentially. The Bluetooth module interfaces through UART, facilitating serial communication at configurable baud rates. To minimize noise and interference, I incorporated decoupling capacitors and proper grounding techniques. The overall power consumption of the flying butterfly drone can be estimated using the formula for total current draw:
$$P_{\text{total}} = V_{\text{battery}} \times (I_{\text{micro}} + I_{\text{sensors}} + I_{\text{Bluetooth}} + I_{\text{actuators}})$$
where $I_{\text{micro}}$ is the current for the microcontroller (typically 10-20 mA under load), $I_{\text{sensors}}$ for the barometer and gyroscope (about 5 mA combined), $I_{\text{Bluetooth}}$ for the HLK-B40 module (ranging from 5 to 15 mA depending on mode), and $I_{\text{actuators}}$ for the motor and servo (peak currents up to 200 mA during flapping). With a 500 mAh battery, the flying butterfly drone can achieve flight durations of approximately 15-20 minutes under typical operating conditions, though this varies with control intensity. The compact PCB layout, measuring 30 mm × 40 mm, ensures minimal weight addition, crucial for the aerodynamics of the flying butterfly drone.
Mechanical structure design plays a pivotal role in emulating the flight characteristics of real butterflies. The flying butterfly drone features a wingspan of 0.3 meters, constructed from PET film reinforced with carbon fiber ribs to provide lift while maintaining flexibility. The body frame is 3D-printed using polylactic acid (PLA) polymer, chosen for its low density (1.24 g/cm³) and adequate strength. The gear reduction system, which connects the micro motor to the wings, converts high-speed rotation into low-frequency, high-torque flapping motions. The flapping frequency $f_{\text{flap}}$ can be controlled by adjusting the motor’s PWM duty cycle, related by the equation:
$$f_{\text{flap}} = \frac{N_{\text{motor}} \times \eta}{G_{\text{ratio}}}$$
where $N_{\text{motor}}$ is the motor speed in revolutions per second, $\eta$ is the mechanical efficiency (approximately 0.85), and $G_{\text{ratio}}$ is the gear ratio (set to 50:1 in this design). This allows the flying butterfly drone to achieve flapping frequencies between 5 and 15 Hz, mimicking natural butterfly wingbeats. The servo-mounted weight shifts the center of gravity along the longitudinal axis, inducing pitch and roll movements for directional changes. The overall mass of the flying butterfly drone, including electronics, is kept under 20 grams to ensure sufficient lift-to-weight ratio. Aerodynamic forces can be approximated using the lift equation:
$$L = \frac{1}{2} \rho v^2 S C_L$$
where $\rho$ is air density (1.225 kg/m³ at sea level), $v$ is the airspeed (around 0.5 m/s for the flying butterfly drone), $S$ is the wing area (0.05 m²), and $C_L$ is the lift coefficient (estimated at 1.2 based on wing morphology). This yields a lift force of approximately 0.02 N, enough to sustain flight given the drone’s weight. Through iterative prototyping, I optimized the structure to reduce drag and enhance stability, ensuring that the flying butterfly drone can perform smooth maneuvers even in mild turbulence.
Communication protocol design is essential for reliable control of the flying butterfly drone. I developed a custom Bluetooth protocol based on the HLK-B40 module, which supports low-energy modes to conserve power when idle. The connection flowchart involves initialization, advertising, pairing, and data transmission phases. Upon power-up, the flying butterfly drone’s Bluetooth module enters a low-power advertising state, broadcasting its device name to nearby hosts. Once a connection is established with a mobile device, the module switches to full-speed mode for data透传 (transparent transmission). The protocol defines specific frame formats to ensure data integrity, as summarized in the table below:
| Field | Size (Bytes) | Description | Example Values for Flying Butterfly Drone |
|---|---|---|---|
| Frame Header | 2 | Identifies start of frame (0xAF 0xAF) | Fixed for all frames |
| Frame Counter | 1 | Cycles from 0x00 to 0xFF to prevent duplicates | Incremented per transmission |
| Payload Header | 1 | Indicates frame type (ACK, CMD, DATA, RST) | 0x01 for ACK, 0x02 for CMD |
| Payload Data | Variable | Contains command or sensor data | e.g., 0x03 for “turn left” command |
| CRC Checksum | 2 | Modbus CRC-16 for error detection | Calculated over payload |
Data exchange follows a request-response pattern: the mobile app sends CMD frames with instructions like ascend (0x01) or read sensor data (0xFF), and the flying butterfly drone replies with ACK frames upon receipt or DATA frames containing sensor readings. The reliability is enhanced by retransmission mechanisms; if an acknowledgment isn’t received within 1 second, the frame is resent up to three times. The effective data rate $R$ can be expressed as:
$$R = \frac{B_{\text{payload}}}{T_{\text{round-trip}}} \times (1 – \text{BER})$$
where $B_{\text{payload}}$ is the payload size in bits, $T_{\text{round-trip}}$ is the round-trip time (typically 10-20 ms for Bluetooth 5.0), and BER is the bit error rate (below 10⁻⁴ in open environments). For the flying butterfly drone, this translates to sustainable rates above 500 kbps, sufficient for real-time control. To manage power, the protocol includes timeouts; if no command is received for 10 seconds, the flying butterfly drone autonomously initiates a landing sequence. This robust protocol ensures that the flying butterfly drone maintains stable communication even at distances up to 30 meters in open areas.
Software development for the flying butterfly drone encompasses both microcontroller firmware and mobile application design. The firmware, written in C for the STC8H1K08, implements a main loop that continuously reads sensor data, computes flight attitudes, and executes control algorithms. The attitude estimation uses data from the MPU-6050 gyroscope and SPL06-001 barometer, fused via a complementary filter to yield roll ($\phi$), pitch ($\theta$), and yaw ($\psi$) angles. The filter equations are:
$$\phi_{\text{est}} = \alpha (\phi_{\text{gyro}} + \omega_x \Delta t) + (1 – \alpha) \phi_{\text{accel}}$$
$$\theta_{\text{est}} = \alpha (\theta_{\text{gyro}} + \omega_y \Delta t) + (1 – \alpha) \theta_{\text{accel}}$$
where $\phi_{\text{gyro}}$ and $\theta_{\text{gyro}}$ are gyroscope-based angles, $\phi_{\text{accel}}$ and $\theta_{\text{accel}}$ are accelerometer-derived angles, $\omega_x$ and $\omega_y$ are angular rates, $\Delta t$ is the sampling interval (5 ms), and $\alpha$ is a weighting factor (set to 0.98 for gyroscope bias reduction). For control, I employed a PID algorithm to adjust actuator outputs based on error signals. The PID output $u(t)$ for motor speed control is given by:
$$u(t) = K_p e(t) + K_i \int_0^t e(\tau) d\tau + K_d \frac{de(t)}{dt}$$
with $e(t)$ being the error between desired and actual flapping frequency, and tuned gains $K_p = 2.5$, $K_i = 0.1$, $K_d = 0.05$ via experimental Ziegler-Nichols method. Additionally, a fuzzy logic controller handles uncertainties in sensor data, using membership functions for inputs like “altitude error” and “attitude deviation” to output corrective actions for the servo. This dual approach enhances the adaptability of the flying butterfly drone in varying conditions.
The mobile application, built with MIT App Inventor, provides a user-friendly interface for controlling the flying butterfly drone. It includes buttons for directional commands, sliders for parameter adjustment, and a display for real-time sensor data. The app logic manages Bluetooth pairing, data packaging, and response parsing. Below is a table outlining the key app components and their functions:
| Component | Type | Function in Flying Butterfly Drone Control |
|---|---|---|
| Bluetooth Client | Non-visible component | Handles connection and data transmission to drone |
| Directional Buttons | Button widgets | Send CMD frames for up, down, left, right movements |
| Mode Switch | Toggle button | Alternates between manual and autonomous flight |
| Data Display | Label widgets | Show altitude, attitude, and battery status from DATA frames |
| Connect/Disconnect | Button | Initiates or terminates Bluetooth link with flying butterfly drone |
The app communicates at 115200 baud rate, ensuring compatibility with the HLK-B40 module. Through testing, I refined the interface to minimize latency, with button presses triggering immediate command transmission. This software ecosystem allows even novice users to operate the flying butterfly drone effectively, making it accessible for educational and recreational purposes.
Experimental validation involved rigorous testing of both communication reliability and flight performance for the flying butterfly drone. For communication tests, I conducted outdoor experiments in an open field, measuring data packet loss rates at varying distances and payload sizes. The setup included the flying butterfly drone fixed at 1.5 meters height, with a mobile device sending data packets of different lengths. Results are compiled in the table below:
| Packet Size (Bytes) | Transmission Rate (packets/sec) | Test Duration (seconds) | Packet Loss Count | Success Rate for Flying Butterfly Drone |
|---|---|---|---|---|
| 10 | 1000 | 60 | 0 | 100% |
| 100 | 500 | 60 | 1 | 99.83% |
| 500 | 100 | 60 | 3 | 99.50% |
The data shows that the flying butterfly drone maintains high reliability, with success rates exceeding 99.5% even for larger packets, confirming the robustness of the Bluetooth protocol. The effective range extended to 30 meters without significant degradation, suitable for most short-range applications. Flight performance tests assessed stability, controllability, and energy efficiency. In windless conditions, the flying butterfly drone achieved a forward speed of 0.5 m/s, with response times under 1 second for directional changes. The power consumption $P_{\text{avg}}$ was calculated as:
$$P_{\text{avg}} = \frac{E_{\text{battery}}}{t_{\text{flight}}} = 0.56 \text{ W}$$
where $E_{\text{battery}}$ is the battery energy (3.7 V × 0.5 Ah = 1.85 Wh) and $t_{\text{flight}}$ is the average flight time (0.55 hours). Maneuverability was quantified by measuring turn radius $r$ using the formula:
$$r = \frac{v^2}{g \tan \phi}$$
where $v$ is speed (0.5 m/s), $g$ is gravity (9.81 m/s²), and $\phi$ is the roll angle (up to 30°). This yielded a minimum turn radius of 0.15 meters, demonstrating the agility of the flying butterfly drone. These tests validate that the flying butterfly drone meets design specifications, though areas like flight duration and wind resistance warrant further improvement.
In conclusion, I have successfully designed and implemented a Bluetooth-based flight control system for a flying butterfly drone, integrating hardware, software, and communication protocols to achieve stable, remotely controllable flight. The flying butterfly drone leverages biomimetic principles for efficient aerodynamics, with a lightweight structure and precise actuator control. Key innovations include the use of an STC8H1K08 microcontroller for real-time processing, a custom Bluetooth protocol for low-latency data exchange, and PID-fuzzy hybrid algorithms for adaptive stabilization. Experimental results confirm that the flying butterfly drone operates reliably with minimal packet loss and responsive maneuverability, making it suitable for applications in research, education, and light-duty surveillance. However, limitations persist, such as limited battery life and susceptibility to strong winds. Future work will focus on optimizing power management through energy-harvesting techniques, enhancing control algorithms with machine learning for autonomous navigation, and exploring swarm coordination for multiple flying butterfly drones. By continuing to refine this technology, I aim to push the boundaries of bio-inspired robotics, offering new insights into the fusion of nature and engineering for advanced UAV systems.
