How to Make a Tiny ESP32 Drone (Under 15$)

by EDISON SCIENCE CORNER in Circuits > Microcontrollers

38 Views, 2 Favorites, 0 Comments

How to Make a Tiny ESP32 Drone (Under 15$)

maxresdefault (1).jpg
1000657940.jpg
1000657937.jpg

Drones have become increasingly popular for hobbyists and professionals alike. With advancements in microcontrollers, building a drone at home has become more accessible. However, drone making can be expensive due to the cost of components such as flight controllers, dedicated transmitters, and high-end sensors. By using an ESP32 microcontroller and leveraging a smartphone as the transmitter, we can significantly reduce the total cost of building a drone without compromising on functionality. In this article, I am showing how you can build a simple drone for below 15$ or 1500 Rs.

Supplies

1000657897.jpg

These are the main components required to make this drone. All other complimentary components of the list can be found in the link below

  1. ESP32-WROOM-32 – The brain of the drone, responsible for communication and control.
  2. MPU-6050 IMU (Inertial Measurement Unit) Sensor – Provides real-time orientation data.
  3. Coreless Motors (4x) – Provide the necessary thrust for flight.
  4. SI2302DS MOSFET (4x) – To drive the four motors.
  5. Propellers (2x CW, 2x CCW) – Generate lift and stability.
  6. 3.7v -25c-Li-Po Battery – Powers all components.
  7. Custom Drone PCB

You can buy all the components from here

You can download the complete BOM file here

Tools required

  1. Soldering iron
  2. Hot plate for reflow
  3. wires


How I Started

1000657922.jpg
1000657915.jpg


After understanding the working principle of a quadcopter, I immediately tested it like this I have made a simple frame using a common PCB and connected four motors. Surprisingly, I am able to lift the drone. But without a controller and gyroscope, it is not possible to fly. So I added an ESP32 and mpu6050 module. MPU6050 can helps to stabilise the drone. But after adding that, I am not able to lift off the ground. Because the weight increased due to the extra modules. To overcome this either we need to either increase the thrust of the motor or decrease the weight. Our goal is to build the cheapest drone, so we can't change the motors. So to decrease the weight, we can remove the separate modules, and we can build a dedicated PCB for the drone. A dedicated PCB solves two issues: it will decrease the total weight, and we can align the motors in perfect orientation and which will increase the stability.


Circuit Diagram

CIRCUIT DIAGRAM

Download the circuit diagram from here

The given schematic includes power management, a microcontroller (ESP32-WROOM), a USB-to-serial interface, a gyro sensor (MPU6050), and MOSFET-based switching circuits. Each section of the schematic plays a critical role in ensuring the functionality of the drone.

The ESP32-WROOM module serves as the central processing unit of this circuit, providing computation, control, and communication capabilities. It operates on a 3.3v supply, which is derived from the MIC5219 voltage regulator. To ensure proper operation, the ESP32 includes several supporting components: the reset button (RST) is connected to the EN (Enable) pin, allowing the user to reset the microcontroller boot button is connected to GPIO0, enabling the ESP32 to enter boot mode when necessary, especially for flashing new firmware. Communication with external peripherals is established through various GPIO pins. Some of the key connections include:

  1. I2C Interface (GPIO21 for SDA and GPIO22 for SCL) is used to communicate with the MPU6050 motion sensor.
  2. UART Interface (TXD and RXD), which connects to the CH340C USB-to-serial converter, allows serial communication with a computer.

The circuit includes a CH340C USB-to-serial converter to facilitate communication between the ESP32 and an external computer. This interface is essential for programming and debugging the microcontroller. The CH340C receives power from the 3.3v rail, ensuring compatibility with the ESP32. The TXD (transmit data) pin of the CH340C is connected to the RXD (receive data) pin of the ESP32, while the RXD pin of the CH340C is connected to the TXD pin of the ESP32. This allows bidirectional serial communication. To support autoreset functionality, the RTS (Request to Send) pin of the CH340C is connected to the ESP32’s EN pin, which allows the system to automatically reset the microcontroller when flashing new firmware. Additionally, a power switch IC (DDC114TU) is incorporated to manage power flow to the USB-to-serial interface.

The schematic also includes an MPU6050 inertial measurement unit (IMU) sensor, which provides accelerometer and gyroscope data. This data is crucial for the stability of the drone. The MPU6050 operates on a 3.3v power supply, which it receives from the voltage regulator. It communicates with the ESP32 via the I2C protocol, using:

  1. SDA (Serial Data Line) → ESP32 GPIO21
  2. SCL (Serial Clock Line) → ESP32 GPIO22

In addition to the standard data lines, the circuit incorporates pull-up resistors to ensure proper signal integrity and decoupling capacitors (C13, C14) to stabilise the power supply, minimising noise and fluctuations.

The power management section is responsible for providing a stable power supply to the entire circuit. The circuit utilises a USB input (J1), which serves as the primary power source. The USB’s 5v output is first directed through a Schottky diode (D2-SS34) to prevent reverse current flow, ensuring the protection of upstream components. To regulate the voltage for low-power components, the circuit employs a MIC5219-3.3V voltage regulator (U5). This regulator steps down the USB’s 5v input to a stable 3.3v, which powers critical components such as the ESP32 microcontroller and the MPU6050 sensor.

In addition to direct power regulation, the system includes a TP4056 battery charging IC (U6) to facilitate the charging of a Li-ion battery. The TP4056 module takes input from the USB’s 5v supply and manages the battery’s charging process efficiently. Several resistors (R31, R34, R36) and LEDS (LED2, LED3) are included in the design to indicate charging status, with one LED lighting up when the battery is charging and the other when it is fully charged.

To reduce the total cost, we are not using any electronic speed controllers here. The schematic includes four SI2302DS-T1 MOSFETS (T1, T2, T3, T4), which act as electronic switches for controlling four motors.

Additionally, 1n4148 diodes (D2, D3, D4, D5) are placed across each MOSFET to protect against voltage spikes.



Downloads

PCB Designing


This time, I used the EasyEDA Pro version to build the circuit diagram. Easyeda pro version is powerful than the standard version, and it is completely free. After designing the circuit diagram. I converted the circuit into a PCB.

Above is the PCB outline; the outline is important here. All 4 legs are symmetrical, which will hold each motor. The four extra parts will act as the landing support for the motors, and we can separate these legs from the drone by breaking them. I placed the MPU6050 at the exact centre of the PCB, which will give more stability for the drone. Then I arranged all the other components.

After designing the PCB, our PCB looks like this.

PCB Fabrication

PCB Fabrication from JLCPCB

After completing the PCB design, we need to send the Gerber data to Jlcpcb.com for PCB samples.

For PCB fabrication, I went to JLCPCB.com. I always prefer jlcpcb for PCB manufacturing because there Quality and low pricing. You can get 5 PCBS for just 2$ Also their other services, like assembly and 3D printing, are also very cheap.

To order our PCBS just click on order now. Select the Gerber file. After uploading the Gerber file, we can select quantity, colour, thickness, etc. Here, I selected the thickness of the PCB as 1.6mm, because the PCB acts as our frame, so it should be rigid. Also, I placed an order for SMT stencil here, because our PCB consists of lots of SMD components, so the stencil helps with assembly easily. After that, we can select the shipping method and address. Then we can place the order.

After placing the order, I received the PCBS and stencil in 10 days

Assembling the Drone

Assembling the ESP Drone

After receiving the PCB and stencil from Jlcpcb.com, I grabbed all the components and started to assemble the PCB. Assembling the PCB is very easy here because of the stencil.

  1. Applying solder paste to each component pad is the initial step in the assembly. In this case, I am using 63/37 Sn/Pb solder paste with a 183-degree melting point
  2. Next, I pick and place each component in its proper place by hand. After placing all the SMD components in the exact positions, we can reflow the PCB.
  3. Here I am using the miniware MHP50 hotplate for the reflow soldering.

After the reflow, our PCB looks like this. You can use 200 degrees Celsius on the hotplate for reflow soldering.

Now I have separated the legs from pcb. Now let's place the motors on the PCB. I am using 720-type brushed motors for this. To properly mount the motors, I used some rubber grommets. So first, I placed the rubber grommets on the PCB bracket, then placed the four motors. After placing all the motors, I connected the motors to the PCB. Then I added the separated legs to the PCBS like this. The final step is to add the propellers. I have tested different-shaped, different propellers, and I got good results with 55mm propellers. So I added the propellers to the motor. You have to care about the propeller direction. You can follow the image below for that.

So that's it, our completed drone looks like this. Now, about the battery, we can use a 3.7 or 3.8 li polymer battery for this drone. But. Make sure the weight is very and the discharge capacity should be a minimum of 25C. The discharge capacity is very crucial; if it is not enough, the drone will not work.

Programming the ESP32


There are different ways to upload code to ESP32. But I prefer to use the ESP launchpad because of its simplicity. ESP Launchpad helps you to flash the selected firmware image onto your device. Now connect the drone by pressing the BOOT button.

To upload code to ESP32, ensure you have connected your device to the serial USB port. Click on the 'Connect' button in the top menu option to connect to your attached device.

Note: Once you flash your device, any earlier firmware will be overwritten.

Now, you can see the device is connected. Go to DIY and set the flash address to zero(this is very important). Then select the file from your computer. Click on Flash. It will take 30-40 seconds to flash the code. After flashing the code to the ESP32, press the reset button on the drone and reset it. Then, you can see the success message on the console. That's it.

Download the flash file from here

You can download the complete code from here


Controller Application


Now, place the drone on a flat surface and turn it on the drone. The drone automatically calibrates. In the drone, there are 3 LEDS. The middle one will turn on if the battery is low or if any other sensory errors occur. The first one blinks while connecting to the application. And the third one blinks after connecting to the wifi.

Download the app from here. Now open the wif and connect to the drone's wifi. The default password is 12345678. Disconnect the phone from the internet and turn on location services. Now open the app and click on the top right icon. Now you can see the connected message on your. Application. Now you can see the drone is responding with the controller. To manually adjust and calibrate, you can go to the settings menu and you can adjust the roll and pitch.




TESTING

How to Make a Cheap ESP32 Drone | ESP32 Drone | JLCPCB


The above video shows the complete tutorial and flying. It flies well. You need to adjust the settings according to the drone to fly well. But you can master it once you get the idea. So that's it. If you have any questions, you can comment, or you can use my socials to connect. Now we are working on height hold and camera support for this drone. If it works, you will get a new updation video. Stay tuned for that. So that's it for today, hope you enjoyed and learned something from my tutorial. Thank you