🎉 75% of content is free forever — Unlock Premium from $10/mo →
CW
NEWSLIVESearch All Content
💼 Servicesℹ️ About✉️ ContactView Pricing Plansfrom $10

Drone Hardware Components

🟢 Free Lesson

Advertisement

Drone Hardware Components

Understanding the hardware is essential before building AI systems on top. This lesson dissects every component inside a real drone and shows exactly how they connect.

Flight Controller PCB Layout

Sponsored

This is a realistic top-view of a modern F4 flight controller board, showing every IC, connector, and signal path:

Flight Controller PCB — Top ViewMatek F405-SE or equivalentSTM32F405ARM Cortex-M4168MHz / 1MB FlashFPU + DSPMPU60506-Axis IMUAccel + GyroI2C SDAI2C SCLBMP388Barometer±0.5m altitudeI2C SDAI2C SCLHMC5883LMagnetometerW25Q12816MB FlashBlackbox LogSPI MOSI/MISOAT7456EOSD OverlayLM1117-5V5V 800mA RegME62113.3V 500mABATT7-26VUART1 GPSTX RX 5V GNDUART2 RXSBUS InputUART3 VTXSmartAudioSPI EXTSCK MISO MOSI CSI2C EXTSDA SCL 3.3VPWM Outputs (to ESCs)PWM1 M1PWM2 M2PWM3 M3PWM4 M4PWM5 LEDPWM6 BUZVBATGND5V3.3V8MHzXTAL100nF100nF100nFUSB-CConfig PortD+D-PWRACTERRCommunication ProtocolsI2C (400kHz)SPI (10MHz)PWM (8kHz)UART (115200)

Component Specifications

ComponentModelInterfaceData RatePurpose
MCUSTM32F405RGT6—168MHzMain processor, PID loop
IMUMPU6050I2C400kHz6-axis motion (accel+gyro)
BarometerBMP388I2C400kHzAltitude ±0.5m
MagnetometerHMC5883LI2C400kHzHeading (compass)
OSDAT7456ESPI10MHzOn-screen display overlay
FlashW25Q128SPI10MHzBlackbox flight log
GPSNEO-M8NUART115200Satellite navigation
ReceiverR9SLUART100000SBUS RC input
VTXTBS UnifyUART9600SmartAudio control

Motor and ESC System

Brushless DC motors are the muscles of a drone. The ESC converts digital PWM signals into the 3-phase AC needed to spin the motor:

python
# Motor configuration for a quadcopter
MOTOR_CONFIG = {
    'M1': {'position': 'front-left',  'rotation': 'CW',  'esc_pin': 'PWM1', 'kv': 2300},
    'M2': {'position': 'front-right', 'rotation': 'CCW', 'esc_pin': 'PWM2', 'kv': 2300},
    'M3': {'position': 'rear-left',   'rotation': 'CCW', 'esc_pin': 'PWM3', 'kv': 2300},
    'M4': {'position': 'rear-right',  'rotation': 'CW',  'esc_pin': 'PWM4', 'kv': 2300},
}

# Motor mixing formula (how FC translates pilot input to motor speeds)
def motor_mix(roll, pitch, yaw, throttle):
    """Compute motor speeds from attitude commands"""
    m1 = throttle + roll - pitch + yaw  # Front-left
    m2 = throttle - roll - pitch - yaw  # Front-right
    m3 = throttle + roll + pitch - yaw  # Rear-left
    m4 = throttle - roll + pitch + yaw  # Rear-right
    return [clamp(m1), clamp(m2), clamp(m3), clamp(m4)]

def clamp(value, min_val=1000, max_val=2000):
    return max(min_val, min(max_val, int(value)))

Power Distribution

Advertisement
Power Distribution SystemLiPo 4S14.8V 1500mAhPDB (Power Distribution Board)ESC 1ESC 2ESC 3ESC 4M1M2M3M4BEC 5VFlight CtrlIMUBaroRXVTX 5.8GCamera

Sensor Data Flow

Sensor Data Flow PipelineIMU 1000HzBaro 100HzGPS 10HzCamera 30fpsLiDAR 10HzSensor FusionKalman FilterComplementaryMadgwick AHRSPID Controller8000 Hz loopKp=1.2 Ki=0.05Kd=0.3ESC Output4x PWM → MotorsAI ProcessingObject DetectionPath PlanningObstacle Avoidance

Hands-On Project: Read Sensor Data

python
import smbus2
import time

class MPU6050:
    """Read accelerometer and gyroscope from MPU6050"""
    def __init__(self, bus=1, addr=0x68):
        self.bus = smbus2.SMBus(bus)
        self.addr = addr
        # Wake up sensor
        self.bus.write_byte_data(self.addr, 0x6B, 0x00)
        # Set accelerometer range to ±4g
        self.bus.write_byte_data(self.addr, 0x1C, 0x08)
        # Set gyro range to ±500°/s
        self.bus.write_byte_data(self.addr, 0x1B, 0x08)

    def read_raw(self, reg):
        high = self.bus.read_byte_data(self.addr, reg)
        low = self.bus.read_byte_data(self.addr, reg + 1)
        val = (high << 8) | low
        return val - 65536 if val > 32767 else val

    def read_all(self):
        return {
            'ax': self.read_raw(0x3B) / 8192.0,
            'ay': self.read_raw(0x3D) / 8192.0,
            'az': self.read_raw(0x3F) / 8192.0,
            'gx': self.read_raw(0x43) / 65.5,
            'gy': self.read_raw(0x45) / 65.5,
            'gz': self.read_raw(0x47) / 65.5,
        }

# Usage
imu = MPU6050()
while True:
    data = imu.read_all()
    print(f"Accel: {data['ax']:.2f}, {data['ay']:.2f}, {data['az']:.2f} g")
    print(f"Gyro:  {data['gx']:.1f}, {data['gy']:.1f}, {data['gz']:.1f} °/s")
    time.sleep(0.01)

Next lesson: Flight dynamics and aerodynamics →

—
☆☆☆☆☆
0 ratings

Rate & Feedback

Need Expert Drone AI Help?

Get personalized tutoring, project support, or professional consulting.

Advertisement