Building a Low-Cost DIY Drone with ESP32

The Circuit Digest team has designed a low-cost DIY drone controlled by an ESP32 module, based on a custom PCB and off-the-shelf parts, with a manufacturing cost of about $11.

The DIY ESP32 drone is designed to be a palm-sized WiFi drone that is controlled via WiFi using a smartphone. It does not include any 3D printed parts, as the PCB forms the chassis of the device.

Building a Low-Cost DIY Drone with ESP32

Github Address

https://github.com/Circuit-Digest/ESP-Drone/

Hardware design files (PDF schematic + BoM + Gerber files) and firmware code based on the Espressif ESP32-WROOM-32 can be found on GitHub. This drone is designed to be controlled by a smartphone running an open-source Android or iOS application developed by Espressif.

DIY WiFi Controlled Drone Schematic

Building a Low-Cost DIY Drone with ESP32

A TYPE-C USB port is used for charging and programming purposes. The power from the USB port connects to the power path controller circuit built around the P-channel MOSFET U2 and diode D1. When USB power is available, the device will run from the USB power and also charge the internal battery; when the USB power is cut off, the device will automatically switch to battery power. For voltage regulation, we used Microchip’s MIC5219 3.3V LDO, which can provide up to 500mA of current and a very low dropout of 500mV at full load. A sliding switch with a pull-up resistor is connected to the enable pin of the MIC5219. This switch is used to turn the thermal imager on and off. When this pin is pulled to ground, the LDO will be turned off, thus turning off the other parts of the device, except for the battery charging part. To charge the internal battery, we used the TP4056 charging controller, which has a maximum charging current of 1A. For battery voltage detection, we used a classic voltage divider to bring the battery voltage down to a safe level for measurement.

Building a Low-Cost DIY Drone with ESP32

The programming circuit consists of a CP2102 USB to UART controller and a dual N-channel MOSFET from ON Semiconductor, the 2N7002DW. We used the CP2102 with a QFN28 package. The micro dual MOSFET will serve as an automatic reset circuit for the ESP32, eliminating the need for a manual reset or boot selection circuit, thereby reducing the size of the PCB and BOM costs. The circuit around the ESP32 is standard, just bypass capacitors and pull-up resistors. The MPU6050 PMU is used for flight stabilization and motion control. It connects to the ESP32 SoC using standard I2C pins GPIO21 and GPIO22.

Building a Low-Cost DIY Drone with ESP32

Each motor driver circuit consists of an SI2302 N-channel MOSFET along with a flyback diode and a pull-down resistor. Each motor has 4 such circuits. When a high signal is applied to the gate of the driver MOSFET, it will turn on and drive the motor. We will use PWM signals to control the motor speed. Flyback diodes and capacitors are in place to protect the circuit from any back EMF or voltage spikes.

Building a Low-Cost DIY Drone with ESP32

In addition to the power and charging indicator LEDs, we also added three LEDs for debugging. During the sensor calibration process, the blue LED will blink slowly, and quickly blink to indicate that the system is ready for takeoff. When a UDP connection is detected from the controller app, the green LED will start blinking. The red LED indicates a low battery status, and it will stay on if the battery voltage is low.

Building a Low-Cost DIY Drone with ESP32

PCB for DIY WiFi Controlled Drone

For this project, we decided to make a custom PCB. This will ensure that the final product is as compact as possible and easy to assemble and use. We also designed the PCB so that the drone’s legs are also included in the PCB and can be easily detached from the main PCB. This is the top and bottom layers of the PCB.

Building a Low-Cost DIY Drone with ESP32

This is the PCB.

Building a Low-Cost DIY Drone with ESP32

Building a Low-Cost DIY Drone with ESP32

This is a 3D rendering of the fully assembled drone.

Building a Low-Cost DIY Drone with ESP32

This is the fully assembled drone.

Building a Low-Cost DIY Drone with ESP32Components Required to Build a DIY WiFi Controlled Drone
  • ESP32 Wroom Module – x1
  • CP2102N USB – UART Controller – x1

  • MPU6050 IMU – x1

  • TP4056 Li-ion Charger IC – x1

  • MIC5219-3.3YM5 3.3v LDO – x1

  • AO3401 P – MOSFET – x1

  • 2N7002DW Dual N – MOSFET – x1

  • SI2302 N – MOSFET – x4

  • SS34 Diode – x1

  • 1N4148 Diode – x4

  • SD Card Reader – x1

  • C Type USB Connector 16Pin – x1

  • Lithium Polymer Battery 1300mAh 30C – x1

  • 720 Coreless Motor – x4

  • 55mm Propeller A (CW) – x2

  • 55mm Propeller B (CCW) – x2

  • 7mm Rubber Washers – x4

  • SMD Resistors and Capacitors

  • Surface Mount LED

  • SDM Sliding Switch

  • Connectors

  • Custom PCB

  • 3D Printed Enclosure and Mounting Screws

  • Other Tools and Supplies.

Features of the DIY WiFi Controlled Drone

  • WiFi Control: This can be controlled using a smartphone.

  • MPU6050 IMU for stability control.

  • Multi-functional PCB: No need for any 3D printed parts, etc.

  • Easy to Upgrade: External modules can be used to add additional features like position hold or altitude hold.

  • Compact size and lightweight.

  • Built-in battery charger.

  • Built-in USB interface for programming and debugging.

  • Android and iOS applications.

  • Open Source

Using the Drone

Place the drone on a flat surface and turn it on. Once powered on, the flight controller will create a WiFi hotspot. Connect to it using the password 12345678 and open the app. For iOS, the app can be downloaded from the App Store by simply searching for ESP-Drone APP. For Android, you can download the app from the link ESP-Drone (pgyer.com). Please remember that the app is created and hosted by a third party. Therefore, install them at your own risk. The app interface will look like this.

Building a Low-Cost DIY Drone with ESP32

Click the connect button to start communicating with the drone. Once your drone successfully establishes a connection with the app, the LED on the drone will flash green. The turn lock button can be used to lock the left controller for only up and down or up, left, and right turns. Use the left joystick to pin or land the drone. Use the right joystick to control the actions. If the drone disconnects from the app, or if the drone itself restarts while trying to take off, it means the battery cannot provide enough power. We used a 1300mAh 30C battery. Therefore, ensure to use a battery with a higher discharge rate.

Pre-Flight Check

  • Position the drone with the head facing forward and the tail (i.e., antenna part) facing backward.

  • Place the drone on a level surface and power it on while it is stationary.

  • Once communication is established, check if the LED at the tail of the drone is blinking green rapidly.

  • A blinking red LED indicates low battery status; if this occurs, please charge the battery.

  • Gently push the trust controller forward to check if the drone responds to commands.

  • Use the correct controller to check if the direction control is functioning properly.

Building a Low-Cost DIY Drone with ESP32

Follow the public account “Embedded Talk” for more interesting embedded project information. Thank you for your likes, and for watching~

Leave a Comment

Your email address will not be published. Required fields are marked *