DIY Brushless Motor Speed Controller Schematic and Wiring Guide

Begin with an H-bridge configuration optimized for low-voltage applications, typically 12–24V. Use complementary N-channel and P-channel MOSFETs–IRFZ44N and IRF9Z34N pair reliably for currents up to 20A. Gate drivers like the IR2104 isolate high-side switching and prevent shoot-through, operating efficiently at 50–100kHz PWM frequencies. Ensure snubber capacitors (0.1µF ceramic) across each MOSFET to suppress voltage spikes exceeding 50V.
Microcontroller choices determine precision: an STM32F103 delivers 1µs resolution timing, while an ATmega328P suffices for 8-bit systems. Program trapezoidal commutation with six-step sequencing–measure back-EMF zero-crossing via a resistor divider (10kΩ/1kΩ) into an ADC input, filtering transients with a 10µs delay before sampling. Hall sensors (Allegro A114X) simplify startup, providing 120° phase alignment at 1kHz rotation speeds.
Power supply stability dictates performance: a 12V buck converter (LM2596) regulates input ripple below 50mV. Ground planes separate analog sensing from high-current traces–keep traces under 20mm wide for 20A paths, using 2oz copper for thermal dissipation. Test prototypes with a 48V/5A load; measure rise times under 200ns to confirm gate driver efficacy. Failures often trace to inadequate heat sinks–install TO-220 packages on 3mm thick aluminum plates for 10W dissipation.
For sensorless operation, implement a PLL tracking BEMF transitions within ±5% phase error. Avoid proprietary firmware; customize open-source SimonK or BLHeli* forks to disable regenerative braking if battery longevity is critical. Log rotational data via UART at 115200 baud for tuning PID constants: Kp=0.5, Ki=0.1, and Kd=0.01 typically stabilize 4000KV motors under 0.5Nm loads.
Building a Basic Electronic Speed Controller Layout

Start with a microcontroller like ATmega328P to handle commutation logic. Pair it with three N-channel MOSFETs (IRFZ44N recommended) for switching phases–each capable of handling 50A continuous current. Avoid using P-channel MOSFETs due to inefficiency in high-side switching. Include a gate driver IC (e.g., IR2104) to ensure rapid switching and prevent shoot-through conditions.
- Power input: 2-6S LiPo battery (7.4V–22.2V)
- Current sensing: 10mΩ shunt resistor with an op-amp (LM358) for measurement
- Bootstrap capacitors: 0.1µF ceramic for each high-side gate driver
- Freewheeling diodes: Schottky (1N5822) across each MOSFET
Connect the microcontroller’s PWM outputs to the gate drivers at 8–20kHz for smooth operation. Program the logic to sequence phases correctly–Hall sensors or back-EMF sensing can determine rotor position. If using sensorless mode, add low-pass filters on phase voltage signals to eliminate noise during zero-crossing detection.
Thermal management: Mount MOSFETs on a heatsink (aluminum, 10°C/W or better) and apply thermal paste. Keep traces for high-current paths (input, phases, ground) at least 3mm wide for every 10A. Avoid vias under MOSFETs to prevent heat buildup in PCB layers.
For firmware, use open-source code (e.g., SimonK or BLHeli) as a base, but adjust dead-time (typically 1–3µs) to match your components. Test with a 100W dummy load before attaching a propeller. Voltage spikes above 30V require additional snubber circuits or TVS diodes (P6KE24A) across the power input.
Core Elements Needed for a Speed Controller Assembly
Begin with a three-phase inverter bridge built from N-channel MOSFETs or IGBTs–preferably IRFB3077 for 60V/210A applications or IPP075N10N3 for tighter layouts. Pair each switch with a fast recovery diode (e.g., STTH200L), mounted antiparallel to handle freewheeling current during switching events. Avoid body diodes in MOSFETs; they introduce parasitic losses above 50 kHz.
Select a microcontroller with dedicated motor-control peripherals–STM32F3xx or dsPIC33CK series offer 6-channel PWM outputs (150 MHz, 5 ns resolution) and integrated op-amps for current sensing. Program gate drivers to toggle at 40–80 kHz; lower frequencies risk audible whine, while higher values demand heatsinks on switching elements. Ensure dead-time insertion between high-side and low-side gates–200–500 ns prevents shoot-through and consequent thermal runaway.
Critical Passive Components

| Component | Typical Value | Key Considerations |
|---|---|---|
| Input Capacitor (bulk) | 100–470 µF/50V | Low ESR ( |
| Gate Resistor | 10–47 Ω | Balances rise/fall times–lower values speed switching but increase EMI. |
| Current Shunt | 0.001–0.005 Ω | Kelvin connection mandatory; Manganin or Constantan alloys minimize thermal drift. |
| Bootstrap Capacitor | 0.1–1 µF | Must recharge within 5 µs; X5R/X7R ceramics preferred. |
| Snubber Capacitor | 100–1000 pF | Placed directly across MOSFET drain-source to dampen parasitic oscillations. |
Isolate gate drive circuits with optocouplers (e.g., HCPL-316J) or isolated DC-DC converters (e.g., MEJ1S0505SC–5V/1W, 3 kV isolation). For field-oriented control, include a Hall-effect sensor (e.g., DRV5053) or back-EMF detection via comparator (e.g., LM393) if sensorless operation is desired. Place a varistor (e.g., SIOV-S14K275) across the DC input to clamp transients exceeding 300V.
Thermal management dictates reliability–copper-clad PCB traces (2 oz/ft²) for high-current paths (>30A) or direct soldering of MOSFETs to heatsinks with thermal compound (e.g., Arctic MX-6). Use temperature sensors (e.g., NTC MF72-103) on heat-generating components; throttle PWM if temperature exceeds 85°C to prevent silicon degradation.
Regulate auxiliary power with a buck converter (e.g., LM2596-5.0)–3A output sufficient for MCU, sensors, and gate drivers. Avoid linear regulators; they dissipate excessive heat in high-current setups. For battery-fed designs, include a reverse-polarity protection diode (e.g., STPS30L40CT) or P-channel MOSFET (e.g., AO3401A) to prevent catastrophic shorts.
Implement firmware safeguards: overcurrent protection (trip at 1.2× nominal current), undervoltage lockout (disable below 2.5V per cell for LiPo), and active braking via synchronous rectification. Use dedicated pins for fault signals–pull low to disable gate drivers instantly. For Hall-based commutation, calibrate phase alignment during startup with a look-up table to avoid cogging.
EMI suppression requires ferrite beads (e.g., BLM21PG221SN1) on power lines and small-value capacitors (100 pF–1 nF) across motor leads to filter high-frequency noise. Route high-current traces perpendicular to signal paths; maintain >2 mm clearance for traces carrying >10A. For PCB layouts, prioritize star grounding–separate analog, digital, and power grounds, tying them at a single point near the bulk capacitor.
Test prototypes with an oscilloscope–verify PWM waveforms for clean edges (rise/fall times current probe (e.g., Tektronix TCP0030) to monitor phase currents; imbalance >10% indicates driver skew or unbalanced winding resistance. Benchmark efficiency at 80–90% for well-designed controllers; losses division should skew toward conduction (70%) over switching (30%).
Precision Assembly of Power Transistors and Microcontroller Integration
Begin by selecting logic-level N-channel MOSFETs with a gate threshold below 2V, such as IRLZ44N or AOD4184, to ensure direct compatibility with 3.3V or 5V microcontroller outputs. Verify their continuous drain current rating exceeds the motor’s peak draw by at least 20%–for example, choose 60A-rated devices for a 50A load. Position each transistor on a heatsink with thermal compound applied, securing them with non-conductive screws to prevent short circuits to the chassis. Route high-current paths away from signal lines, using 2oz copper PCB traces or 12AWG stranded wire for motor leads.
- Connect the microcontroller’s PWM output to the MOSFET gate through a 100Ω–220Ω resistor to limit inrush current and prevent ringing.
- Install a 10kΩ pull-down resistor between the gate and source to ensure the transistor remains off during boot-up or reset states.
- Place a flyback diode (e.g., UF4007) across the motor terminals, cathode to the positive rail, to clamp inductive voltage spikes.
- Add a 100nF ceramic capacitor between the gate and source for high-frequency noise suppression.
Program the microcontroller to output PWM signals at 20kHz–40kHz frequency, with dead-time inserted between complementary signals to prevent shoot-through (typically 1µs–3µs). For a three-phase setup, assign one PWM channel per half-bridge or use a dedicated controller like an STM32 with integrated complementary outputs. Verify signal integrity with an oscilloscope–gate waveforms should rise and fall in under 50ns without overshoot to avoid false triggering. Test each phase sequentially at 10% duty cycle before advancing to higher loads to confirm proper timing.
Power sequencing requires the control logic to initialize first, followed by the gate driver supply (isolated if using optocouplers) and finally the main power rail. Use a soft-start routine to ramp PWM from 0% to target duty cycle over 100ms to limit inrush current. For fault protection, monitor drain-source voltage via a voltage divider (10kΩ/1kΩ) connected to an ADC input; shut down all gates if voltage exceeds 0.5V (indicating an open-load condition). Log errors via UART or SPI for post-mortem analysis, and incorporate a hardware watchdog timer to reset the system if the main loop stalls.