To successfully Arduino control motor DC circuits, you must use an external H-bridge or half-bridge motor driver (like the TB6612FNG or DRV8871). An Arduino Uno's ATmega328P microcontroller GPIO pins max out at 20mA per pin and 200mA total across the chip. A typical 12V hobby gearmotor draws 400mA continuously and spikes to 1.5A or more at stall. Connecting a motor directly to a GPIO pin will instantly and permanently destroy the microcontroller's output stage.
This guide breaks down exactly how to size your motor, select the right silicon, wire the terminals safely, and diagnose the most common failure modes on the bench.
Sizing a DC Motor for Your Arduino Project
The golden rule of thumb for DC motor sizing is: Size the motor's stall current to be at least 2x your continuous operating load, and ensure your driver's continuous current rating exceeds the motor's stall current. If you size the driver only for the continuous running current, the inrush current at startup will trip the driver's thermal shutdown or blow its internal MOSFETs.
1. Calculate required torque: Force = mass × gravity = 2kg × 9.81 m/s² = 19.62 N.
2. Torque = Force × radius = 19.62 N × 0.05m = 0.981 Nm (roughly 10 kg-cm).
3. Select a 12V 60RPM planetary gearmotor rated for 15 kg-cm continuous torque to provide a safety margin.
4. Check the datasheet: The motor draws 0.5A continuous, but has a 1.8A stall current.
5. Driver Selection: You must choose a driver rated for at least 2A continuous (like the TI DRV8871, rated for 3.6A) to handle the startup spike without overheating.
Which Motor Type Fits Your Load Profile?
Not all 'DC motors' behave the same way. Before you wire up an H-bridge, verify that a brushed DC motor is actually what your mechanical load demands. Here is how the common microcontroller-compatible motors compare.
| Motor Type | Torque Curve Profile | Control Needs | Typical Cost (Hobby) |
|---|---|---|---|
| Brushed DC | Maximum torque at stall (0 RPM), drops linearly as speed increases. | H-bridge for bidirectional; PWM for speed. Simple logic. | $3 - $15 |
| Brushless DC (BLDC) | Flat, high torque across the mid-range RPM band; requires spin-up. | 3-phase ESC (Electronic Speed Controller) or 3 half-bridges + Hall sensors. | $15 - $40 |
| Stepper | Massive holding torque at 0 RPM; torque drops rapidly above 300 RPM. | Stepper driver (A4988/TMC2209) with step/direction pulses. | $8 - $25 |
| RC Servo | High holding torque via internal gearbox; limited to ~180° rotation. | 50Hz PWM signal (1-2ms pulse width). No H-bridge needed. | $4 - $20 |
If you need continuous rotation with simple speed control and high starting torque to overcome static friction, the brushed DC gearmotor is the correct choice. For precise angular positioning without a feedback loop, use a stepper. Do not treat steppers and servos as interchangeable; steppers require constant current to hold position (generating heat), while servos use internal potentiometers and only draw current when actively fighting a load.
Choosing the Right Driver and Wiring Terminals
To Arduino control motor DC loads bidirectionally, you need an H-bridge. The market is flooded with legacy and modern options. According to the Texas Instruments motor driver guide, modern MOSFET-based drivers vastly outperform older bipolar designs.
| Driver IC | Architecture | Continuous Current | Voltage Drop | Verdict |
|---|---|---|---|---|
| L298N | Bipolar BJT | 2.0A | 2.0V - 3.0V | Obsolete. Wastes massive power as heat. Avoid for battery projects. |
| TB6612FNG | MOSFET | 1.2A (per channel) | ~0.5V | Excellent for dual 6V-12V micro gearmotors. Highly efficient. |
| DRV8871 | MOSFET Half-Bridge | 3.6A | ~0.6V | Best for single, high-torque 12V-24V motors. (Need two for bidirectional). |
Wiring and Terminal Identification (TB6612FNG)
When wiring a dual MOSFET driver like the TB6612FNG, terminal identification is critical to avoid logic faults:
- VM: Motor power supply positive (2.5V to 13.5V). Connect to your battery or bench supply.
- VCC: Logic power supply (2.7V to 5.5V). Connect to the Arduino's 5V pin.
- GND: Must be connected to BOTH the motor power supply ground AND the Arduino GND. A missing common ground is the #1 cause of erratic motor behavior.
- PWMA / PWMB: Connect to Arduino PWM-capable pins (e.g., pins 5, 6, 9, 10) for speed control.
- AIN1 / AIN2: Direction control. HIGH/LOW = Forward; LOW/HIGH = Reverse; LOW/LOW = Coast; HIGH/HIGH = Brake.
- AO1 / AO2: Motor output terminals. Polarity doesn't matter initially; swap wires if the motor spins the wrong way.
- STBY: Standby pin. Tie to VCC (HIGH) to keep the chip active.
Recognizing Failure Signatures: Hum, Overheat, and Stall
When your circuit fails, the motor and driver will give you physical feedback before they burn out. Here is how to read those signatures.
1. The Audible Hum or Whine
If the motor emits a high-pitched whine but doesn't spin, you are likely stalling. The PWM signal is energizing the coils, but the load exceeds the motor's starting torque. If the motor spins but whines loudly, your PWM frequency is too low. The default Arduino `analogWrite()` frequency is roughly 490Hz, which falls squarely in the human hearing range. (See the FAQ below for the fix).
2. Driver Overheat
If you are using an L298N driver and it is too hot to touch after 30 seconds of running a 1A load, you are experiencing the 2.5V junction voltage drop. At 1A, the chip is dissipating 2.5 Watts of pure heat. Switch to a MOSFET-based driver immediately to prevent thermal throttling.
3. The Brownout Stall (Arduino Resetting)
If the motor starts, the Arduino's power LED dims, and the board resets, you have a brownout. The motor's inrush current is dragging the shared 5V rail below the ATmega328P's minimum operating voltage (typically 2.7V). The fix: Never power a motor directly from the Arduino's 5V regulator. Use a separate battery pack or buck converter for the motor, and only share the GND connection.
Frequently Asked Questions
Can I Arduino control motor DC without a driver module?
You cannot control a motor bidirectionally without an H-bridge driver module. However, if you only need one-directional speed control, you can use a single logic-level N-channel MOSFET (like the IRLZ44N or IRLB8721). Wire the Arduino PWM pin to the MOSFET gate (via a 150Ω resistor), the source to GND, and the drain to the motor's negative terminal. You must place a flyback diode in reverse-parallel across the motor terminals to prevent the inductive kickback from punching through the MOSFET's drain-source junction.
Why does my Arduino reset when I start the DC motor?
This is caused by voltage sag and inductive noise. When a DC motor starts, it draws stall current (often 3x to 5x the running current). If your motor and Arduino share the same power supply without adequate decoupling, the voltage drops, triggering the Arduino's brownout detection (BOD). Additionally, brush arcing inside the DC motor generates high-frequency EMI that can couple into the Arduino's reset line. Fix this by using separate power supplies with a common ground, adding a 100µF electrolytic capacitor across the motor's power rails, and placing a 0.1µF ceramic capacitor directly across the motor's physical terminals to suppress brush noise.
What PWM frequency is best to Arduino control motor DC?
For silent operation, you want a PWM frequency above human hearing, typically 20kHz to 25kHz. The default Arduino Uno `analogWrite()` runs at ~490Hz, which causes an annoying mechanical whine. You can change the hardware timer prescalers to increase the frequency. For example, modifying Timer1 (pins 9 and 10) to run in Phase Correct PWM mode with a prescaler of 1 yields roughly 31kHz. Note that pushing the frequency too high (above 50kHz) increases switching losses in the motor driver's MOSFETs, causing the driver chip to run hotter. According to the Adafruit motor selection guide, 20kHz is the sweet spot for balancing acoustic noise and thermal efficiency in hobbyist H-bridges.






