The Direct Answer: Sizing Your DC Motor and Driver
For a standard 12V to 24V robotics or automation project requiring variable speed control, pair a brushed DC gearmotor with a 3.3V-logic-native H-bridge driver like the Cytron MD10C. If your continuous load is under 1.2A, use a TB6612FNG. The golden rule of thumb for PWM motor DC sizing is twofold: size the driver’s peak current rating for 2x the motor’s stall current, and size the motor’s continuous torque rating to 2x your steady-state load requirement to prevent thermal runaway and efficiency drop-off.
- Motor Sizing: You need a motor rated for at least 8A continuous (to stay cool and efficient). A standard RS-775 12V DC motor fits this, with a continuous rating around 8A-10A.
- Stall Current Calculation: DC motors typically draw 5x to 7x their continuous current when stalled. 8A continuous × 6 = 48A stall current.
- Driver Sizing: 48A stall × 1.5 safety margin = 72A peak driver requirement. You would select a high-power driver like the ODrive S1 or a dual-BTS7960 setup, rather than a standard 10A hobby ESC.
- Wire Sizing: For the 4A continuous load, 16 AWG is sufficient for ampacity, but to prevent voltage drop during the 48A stall spike over a 2-foot run, bump up to 12 AWG THHN for the motor leads.
Motor Topology Comparison: Which Type Fits Your Load?
Not all motors accept simple PWM duty cycles directly. Before wiring up a microcontroller, you must match the motor topology to your mechanical load profile. Steppers and servos are fundamentally different beasts from standard DC motors and require entirely different control schemes.
| Motor Type | Torque Curve Profile | Control Needs | Relative Cost | Best Load Profile |
|---|---|---|---|---|
| Brushed DC (Gearmotor) | Max torque at 0 RPM (stall), drops linearly as speed increases. | Simple PWM duty cycle via H-Bridge for speed/direction. | $ (Low) | Conveyors, winches, traction drives, high starting torque loads. |
| Stepper (e.g., NEMA 23) | High holding torque at 0 RPM, drops off sharply at high RPM. | Step/Dir pulses via dedicated chopper driver (e.g., TB6600). | $$ (Medium) | Open-loop precise positioning, 3D printer axes, CNC routers. |
| BLDC (Outrunner/Inrunner) | Flat torque curve across a wide RPM band, high efficiency. | 3-phase commutation via FOC or trapezoidal ESC (not simple PWM). | $$$ (High) | Drones, high-speed spindles, continuous-duty high-efficiency pumps. |
If your application simply requires "spin this shaft at 60% speed under a heavy load," the brushed DC gearmotor is your default pick. It demands the least from your microcontroller and provides the highest starting torque to break static friction.
Wiring and Terminal Identification for 3.3V PWM Control
When driving a PWM motor DC load with an ESP32 or Raspberry Pi Pico, you face a critical hardware trap: logic level mismatch. The ubiquitous IBT-2 (BTS7960-based) H-bridge is marketed as "Arduino compatible." Arduino uses 5V logic. The ESP32 uses 3.3V logic. While the BTS7960 will trigger at 3.3V, the MOSFET gates are not fully enhanced, resulting in a higher RDS(on) and massive heat generation at high currents.
For 3.3V microcontrollers, use a 3.3V-native driver like the Cytron MD10C (up to 13A continuous) or the Pololu TB6612FNG (up to 1.2A continuous). Here is the terminal identification and ESP32 wiring for the Cytron MD10C, which is the workhorse for mid-range 12V DC loads.
| MD10C Terminal | Function | ESP32 Pin / Connection | Notes & Best Practices |
|---|---|---|---|
| B+ | Motor Power Supply Positive | 12V PSU Positive | Add a 2200µF electrolytic capacitor across B+ and B- near the terminals to absorb back-EMF spikes. |
| B- | Motor Power Supply Ground | 12V PSU Negative | Must share a common ground with the ESP32 GND pin. |
| MA / MB | Motor Output Terminals | DC Motor Leads | Polarity dictates direction. Swap wires to reverse default rotation. |
| DIR | Direction Logic Input | ESP32 GPIO 16 | HIGH = Forward, LOW = Reverse. Internal pull-down keeps it safe on boot. |
| PWM | Speed Control Input | ESP32 GPIO 18 | Use ESP32 LEDC peripheral. Set frequency to 2kHz - 5kHz to avoid acoustic whine. |
| GND | Logic Ground | ESP32 GND | Critical: Do not rely on USB ground. Wire directly to the PSU ground bus. |
For the PWM signal generation, utilize the ESP32’s LEDC (LED Control) peripheral via the Espressif LEDC API. It handles hardware-level PWM generation, freeing the CPU from timing interrupts and ensuring a clean duty cycle even when WiFi or BLE stacks are active.
Failure Signatures: Decoding Hum, Overheat, and Stall
When a PWM motor DC circuit fails, the physical symptoms tell you exactly where the design broke down. Do not just swap parts; read the signatures.
1. Acoustic Hum or Whine at Low Speeds
The Symptom: The motor emits a loud, high-pitched whine or a low-frequency hum when operating at low PWM duty cycles (10% - 30%).
The Cause: Your PWM frequency is set within the human hearing range (typically 50Hz to 1kHz). The motor windings and laminations act as a speaker cone, vibrating at the switching frequency.
The Fix: Increase the PWM frequency to 4kHz or 8kHz. This pushes the switching noise above human hearing and results in smoother current delivery due to the winding inductance filtering the higher frequency.
2. Driver Overheat and Thermal Shutdown
The Symptom: The motor runs fine for 30 seconds, then stops. The H-bridge IC is too hot to touch (>85°C), and it resumes after cooling down.
The Cause: You are exceeding the continuous current rating of the driver, or you are using a 5V-logic driver (like the BTS7960) with a 3.3V ESP32, causing incomplete MOSFET gate enhancement and excessive I²R heating.
The Fix: Check the datasheet for the driver's continuous current rating (not the "peak" marketing number). If using an ESP32, ensure the driver's logic threshold (VIH) and full enhancement voltage (VGS) are rated for 3.3V. If you must use a 5V driver, insert a 74HCT245 logic level shifter between the ESP32 and the driver.
3. Hard Stall and Magic Smoke
The Symptom: The mechanical load jams. The motor stops, draws massive current, and the H-bridge MOSFETs short out, releasing smoke.
The Cause: When a DC motor stalls, back-EMF drops to zero. The only thing limiting current is the DC resistance of the windings (often < 1 ohm). A 12V motor with 0.4 ohms resistance will pull 30A instantly. If the driver lacks Overcurrent Protection (OCP), the silicon melts.
The Fix: Implement software current limiting. Use a driver with an analog current sense output (like the ISEN pin on the TB6612FNG). Wire this to an ESP32 ADC pin (e.g., GPIO 34). Read the ADC value in your main loop; if the voltage corresponds to a current spike exceeding 1.5x your continuous rating for more than 100ms, set the PWM duty cycle to 0 immediately.
The Decision Tree: Picking Your Exact Motor and Driver Combo
Stop guessing. Follow this decision path to select the exact hardware for your next build. This framework terminates in concrete part numbers based on your load profile and microcontroller logic levels.
Step 1: What is your continuous current draw?
- If < 1.2A (Small robots, pan/tilt cameras, light conveyors):
- Driver Pick: Pololu TB6612FNG Dual Motor Driver (~$10). It natively supports 2.7V to 5.5V logic, making it perfect for ESP32 and Pi Pico without level shifters.
- Motor Pick: Pololu 50:1 Metal Gearmotor 37Dx57L (12V, ~300 RPM, 1.2A continuous).
- If 1.2A to 13A (Winches, traction drives, linear actuators):
- Driver Pick: Cytron MD10C (~$25). It handles up to 13A continuous, accepts 3.3V logic natively, and features onboard opto-isolation to protect your ESP32 from ground loops and back-EMF spikes.
- Motor Pick: RS-775 12V DC Motor with a matched planetary gearbox (typically $15-$25 on Amazon/AliExpress). Provides massive starting torque for heavy mechanical loads.
- If > 13A or requires precise velocity/torque closed-loop control:
- Driver Pick: ODrive S1 (~$150). This is an industrial-grade FOC (Field Oriented Control) controller. It requires moving away from simple PWM motor DC control to CAN bus or UART serial commands.
- Motor Pick: BLDC Outrunner Motor (e.g., QS3608 or similar gimbal/drone motors with hall sensors). Stepper motors are not recommended here due to their poor high-speed torque and efficiency.
Step 2: Verify your power supply headroom
Once you have your pick, ensure your 12V/24V power supply can deliver the stall current of the motor, not just the continuous current. If your RS-775 motor stalls at 40A, your 12V PSU must be capable of delivering 40A (480W) without tripping its internal overcurrent protection or browning out the 5V buck converter feeding your ESP32. Always isolate the microcontroller's 5V rail from the motor's 12V rail using separate buck converters or isolated DC-DC modules.
By matching the motor topology to the mechanical load, respecting the 3.3V logic limitations of modern microcontrollers, and sizing for stall conditions rather than continuous ideals, you will build a PWM motor DC drive system that survives the jobsite and the workbench alike. For deeper architectural guidance on motor driver topologies, refer to the Texas Instruments Motor Driver Overview and always cross-reference your specific motor's torque curve on the manufacturer's spec sheets before finalizing your BOM.






