🚁 MODULE 3: DRONE TRACK • SESSION 09 / 12

Session 9: 8520 Coreless Drone Motors & AO3400A MOSFET (32kHz PWM)

Master drone propulsion aerodynamics! Learn how 4 high-speed 8520 coreless DC motors (50,000 RPM) paired with AO3400A logic-level N-MOSFETs generate balanced upward thrust using silent 32kHz ultrasonic PWM.

⚔ 4-Step Drone Propulsion Architecture

High-Frequency 32kHz PWM
Step 1 šŸŽ®
Throttle Demand
0% – 100% (Duty 0–1023)

Pilot stick command or PID balancer requests motor speed.

Step 2 🧠
ESP32-S3 LEDC PWM
GPIO 4, 5, 6, 7 @ 32kHz

Ultrasonic PWM switching frequency eliminates audible motor whine.

Step 3 ⚔
AO3400A N-MOSFET
Gate Drive + 1N5819 Diode

High-speed switching up to 5.7A safely isolates ESP32 from inductive spikes.

Step 4 šŸ›ø
8520 Motor Thrust
50,000 RPM • 55g Lift

CW and CCW props generate 220g total lift for stable flight hover!

1

🧰 Drone Hardware Components Tray

ESP32-S3 Dev Board
ESP32-S3 Dev Board
Dual-core 240MHz flight brain with hardware LEDC timers.
8520 Coreless Motors
4x 8520 Coreless Motors
2x CW (Red/Blue) + 2x CCW (White/Black) high-speed motors.
AO3400A MOSFET Board
4x AO3400A MOSFETs
30V 5.7A N-channel logic switch + flyback diode protection.
1S 3.7V LiPo Battery
1S 3.7V LiPo Battery
High discharge rate (25C–30C) flight battery with JST-PH connector.
2

šŸŽ® Interactive 8520 Quad-Motor Throttle & Aerodynamics Simulator

Live Drone Physics Slide throttle to test lift & attitude flight dynamics
ESP32-S3 32kHz PWM M1 ↻ CW 0% (Pin 4) M2 ↺ CCW 0% (Pin 5) M3 ↺ CCW 0% (Pin 6) M4 ↻ CW 0% (Pin 7)
šŸš€ Master Throttle (PWM Duty) 0% (0 / 1023)
Motor RPM
0 RPM
Max 52,000 RPM
Net Lift Thrust
0 g
šŸ›¬ On Ground
Gate Voltage
0.00 V
Logic High 3.3V
LiPo Current
0.00 A
1S 3.7V Battery
3

šŸ”Œ Color-Coded Drone Circuit & Wire Mapping

ESP32-S3 + AO3400A Drone Wiring Diagram ESP32-S3 Dev Board + 4x AO3400A MOSFETs + Flyback Diodes
M1 Front-Left (CW ↻)
Red (+) & Blue (-) Twisted Wire Pair
GPIO 4
M2 Front-Right (CCW ↺)
White (+) & Black (-) Twisted Wire Pair
GPIO 5
M3 Rear-Left (CCW ↺)
White (+) & Black (-) Twisted Wire Pair
GPIO 6
M4 Rear-Right (CW ↻)
Red (+) & Blue (-) Twisted Wire Pair
GPIO 7
MOSFET Gate Drive (PWM)
Yellow Jumper Wire from ESP32 to Gate Pin (G)
32kHz PWM
Common Ground (GND)
Black Jumper Wire connecting LiPo (-) to ESP32 GND
Common GND
āš ļø Safety Rule: REMOVE PROPELLERS FIRST! Never test motor code on the bench with propellers attached. High-speed 8520 props can spin up unexpectedly and cause cuts!
⚔ Why 32kHz Ultrasonic PWM? Standard 500Hz or 1kHz PWM produces an annoying high-pitched ringing noise. 32kHz is above human hearing range and ensures smooth current delivery!
šŸ›”ļø 1N5819 Flyback Protection When a motor stops, the spinning magnetic field produces a reverse voltage spike (30V+). The Schottky diode absorbs it safely!
4

⚔ Compile-Verified Drone Motor Sketches (1-Click Open in IDE)

step1_single_motor_32khz.ino ESP32-S3 30 lines
/*
 * Session 9 - Step 1: 8520 Coreless Drone Motor Silent 32kHz PWM Test
 * Wiring: AO3400A MOSFET Gate -> GPIO 4 (with 10k pull-down to GND)
 * SAFETY: Remove propellers during first bench test!
 */
#define MOTOR_M1 4
#define RGB_PIN  48
Preview (8 of 30 lines) — Click ⚔ Open in IDE to auto-load code & ESP32-S3 board!
āœ… Output: M1 smoothly ramps 0% āž” 45% āž” 0% with silent 32kHz PWM!
step2_quad_direction_test.ino ESP32-S3 33 lines
/*
 * Session 9 - Step 2: 4-Motor Sequential Spin & CW/CCW Direction Verifier
 * X-Frame Pins: M1(FL-CW)=4 | M2(FR-CCW)=5 | M3(RL-CCW)=6 | M4(RR-CW)=7
 */
const int MOTORS[4] = {4, 5, 6, 7};
const char* NAMES[4] = {"M1 Front-Left (CW)", "M2 Front-Right (CCW)", "M3 Rear-Left (CCW)", "M4 Rear-Right (CW)"};

void stopAll() {
Preview (8 of 33 lines) — Click ⚔ Open in IDE to auto-load code & ESP32-S3 board!
āœ… Output: Tests M1 āž” M2 āž” M3 āž” M4 sequentially at safe 31% speed to verify CW/CCW!
step3_arm_disarm_safety.ino ESP32-S3 36 lines
/*
 * Session 9 - Step 3: Drone Safe ARM / DISARM Toggle Button (Zero Accidental Spin!)
 * Wiring: Push Button -> GPIO 10 to GND (INPUT_PULLUP) | Motors -> GPIO 4,5,6,7
 */
#define ARM_BTN 10
#define RGB_PIN 48
const int MOTORS[4] = {4, 5, 6, 7};
bool isArmed = false;
Preview (8 of 36 lines) — Click ⚔ Open in IDE to auto-load code & ESP32-S3 board!
āœ… Output: Green RGB = Safe DISARMED | Tap GPIO 10 button āž” Red ARMED idle spin!
5

šŸ’” Drone Engineering Viva & Interview Questions

Q1: Why does a quadcopter need two CW and two CCW spinning propellers?

According to Newton's Third Law (every action has an equal and opposite reaction), a spinning motor exerts reaction torque on the drone frame in the opposite direction. By having two clockwise (CW) and two counter-clockwise (CCW) propellers, the reaction torques cancel each other out, keeping the drone perfectly straight without spinning!

Q2: Why can't we connect the 8520 motor directly to the ESP32-S3 GPIO pin?

An ESP32-S3 GPIO pin can only safely provide up to 40mA of current. An 8520 coreless motor draws between 800mA (0.8A) and 2000mA (2.0A) under full load! Connecting it directly would fry the ESP32 chip instantly. The AO3400A N-MOSFET acts as an electronic switch that allows a tiny 3.3V GPIO signal to control huge 5.7A battery current.

Q3: How does a quadcopter tilt forward (Pitch)?

To pitch forward, the rear motors (M3 and M4) increase their speed to produce more lift, while the front motors (M1 and M2) decrease speed. This tilts the drone frame forward, directing a portion of the lift backward to push the drone forward in horizontal flight.

šŸ“„ 33 Sketches (.ZIP) ← Previous: Session 08 (Jarvis Voice AI) Next: Session 10 (PID Seesaw Balance & Sensor Fusion) →