To successfully execute motor control arduino projects, you must match the motor's torque curve to your mechanical load profile and use an intermediary driver capable of handling at least 1.5x the motor's peak current. The Arduino's ATmega328P or ESP32 GPIO pins can only source about 40mA—barely enough to light an LED, let alone overcome the back-EMF and stall currents of a physical motor. Selecting the wrong driver leads to fried microcontrollers, melted H-bridges, or stalled gantries.
The Motor Selection Matrix for Arduino Projects
The most common mistake in embedded motion control is picking a motor based on physical size rather than its torque curve. A high-speed DC motor will fail to hold a vertical Z-axis, while a high-torque stepper will lose steps if you demand 3000 RPM from it. Here is how to map your load profile to the correct motor and driver architecture.
| Motor Type | Torque Curve & Profile | Control Needs & Driver | Typical Cost (2026) |
|---|---|---|---|
| DC Brushed | Peak torque at 0 RPM, drops linearly as speed increases. Best for continuous rotation, wheels, and conveyors. | H-Bridge for direction/speed. Driver: TB6612FNG (low power) or BTS7960 (high power). | $3 - $15 |
| Stepper (NEMA) | Massive holding torque at 0 RPM, drops sharply past 1000 RPM. Best for 3D printers, CNCs, and linear actuators. | Chopper driver with step/dir pulses. Driver: TMC2209 (quiet/UART) or DRV8825. | $12 - $25 |
| RC Servo | High torque via internal gearbox, limited to 180° or 360° rotation. Best for robotic arms, pan/tilt, and valves. | Direct 50Hz PWM signal. Driver: None required (use PCA9685 for >4 servos). | $5 - $20 |
| BLDC (Outrunner) | High efficiency, high RPM, low holding torque. Best for drones, flywheels, and high-speed spindles. | 3-phase commutation via ESC or FOC driver. Driver: SimpleFOC shield or standard RC ESC. | $30 - $60+ |
Sizing Your Motor and Driver: A Worked Load Example
When sizing a driver, the golden rule of thumb is: The driver's continuous current rating must be ≥ 1.5x the motor's peak/stall current. Sizing purely on nominal running current ignores the massive inrush current that occurs during acceleration or mechanical stalling.
Worked Example: 5kg Linear Gantry
Suppose you are building a motorized camera slider moving a 5kg payload on a 2020 V-slot extrusion using a 2mm pitch lead screw. You calculate that you need roughly 0.2 Nm of holding torque to prevent the payload from back-driving the screw when powered off.
- Motor Selection: You choose a standard NEMA 17 stepper, such as the StepperOnline 17HS19-2004S. It provides 0.59 Nm of holding torque (plenty of safety margin) and is rated at 2.0A per phase.
- The Trap: The motor's rated current is 2.0A RMS. However, during rapid acceleration, current spikes. If you use a legacy TI DRV8833 driver (rated for 1.5A continuous), it will trigger its internal thermal shutdown mid-move.
- Correct Driver Selection: You select the BigTreeTech TMC2209. It handles 2.0A RMS and up to 2.8A peak. Applying our 1.5x rule to the 2.0A RMS requirement gives 3.0A. The TMC2209's 2.8A peak is slightly under this, but its ultra-low RDS(on) MOSFETs and StealthChop2 technology keep heat generation minimal, making it viable with a small heatsink. For absolute safety without cooling, you would step up to a TMC5160 (rated for higher external MOSFET currents).
Wiring, Terminals, and Failure Signatures
Correctly identifying terminals prevents instant component death. Below is the wiring spec sheet for the two most common Arduino motor drivers: the TB6612FNG (for DC brushed motors) and the TMC2209 (for steppers).
| Driver Pin | Function | Arduino / ESP32 Connection | Critical Notes |
|---|---|---|---|
| VM | Motor Power Supply | External PSU (e.g., 12V/24V) | Never connect motor power to the Arduino 5V pin. |
| VCC / VDD | Logic Level Power | Arduino 5V or 3.3V | Must match your MCU logic level for reliable step pulses. |
| GND | Common Ground | Arduino GND + PSU GND | MCU and PSU grounds MUST be bonded together. |
| STBY / EN | Standby / Enable | Arduino Digital Pin (or 5V) | TB6612FNG STBY must be pulled HIGH to operate. |
| 1A/1B/2A/2B | Stepper Coil Outputs | NEMA 17 Motor Wires | Use a multimeter to find coil pairs (continuity between A-A and B-B). |
Diagnosing Failure Signatures
When your code compiles but the hardware misbehaves, the physical symptoms will tell you exactly what is wrong:
- The 'Hum' (Stepper): If your stepper vibrates and hums but the shaft doesn't turn, your step pulse frequency is too high for the driver to process, or your coil pairs are wired backward (e.g., mixing Coil A and Coil B wires). It can also indicate the driver's current limit (VREF) is set too low to overcome the motor's detent torque.
- Overheat (Driver): If the driver IC becomes too hot to touch (>80°C) and eventually shuts down, you are exceeding its RMS current rating without adequate cooling. Legacy BJT-based drivers like the L298N drop up to 2V as heat; modern MOSFET drivers like the TB6612FNG or TMC2209 run vastly cooler but still require a 1oz copper pour or stick-on heatsink at currents above 1.2A.
- Stall (DC Motor): A DC motor emitting a high-pitched whine or clicking sound without rotating is mechanically stalled. The driver is attempting to push stall current (often 5x to 10x the running current) through the windings. If your driver lacks overcurrent protection, the H-bridge MOSFETs will melt. Always verify your mechanical load isn't binding before increasing PWM duty cycles.
Arduino Motor Control FAQ
Can I wire a small DC motor directly to Arduino digital pins?
No. An Arduino Uno's ATmega328P GPIO pins have an absolute maximum current rating of 40mA per pin, and a total VCC/GND limit of 200mA. Even a tiny 3V micro-motor will draw 150mA to 300mA on startup due to the lack of back-EMF at 0 RPM. Wiring it directly will permanently fry the microcontroller's internal silicon traces. Always use a logic-level MOSFET (like an IRLZ44N) or an H-bridge driver IC as an intermediary.
Why is my stepper motor vibrating but not moving?
This is almost always caused by incorrect coil pairing or an acceleration ramp that is too aggressive. Stepper motors have two distinct electromagnetic coils. If you wire one wire from Coil A and one from Coil B into the same driver output pair, the magnetic fields will fight each other, resulting in a violent vibration without rotation. Use a multimeter in continuity mode to identify the pairs: wires that show low resistance (typically 1 to 5 ohms) belong to the same coil.
How do I choose between an L298N and a TB6612FNG for DC motor control?
Always choose the TB6612FNG for battery-powered or low-voltage projects. The L298N uses older Bipolar Junction Transistor (BJT) technology, which introduces a voltage drop of 1.5V to 2.5V across the H-bridge. If you feed it 6V, your motor only sees ~4V, and the remaining 2V is wasted as heat. The TB6612FNG uses MOSFETs with an incredibly low RDS(on), resulting in a voltage drop of less than 0.5V. It runs cooler, is physically smaller, and supports higher PWM frequencies (up to 100kHz vs the L298N's ~25kHz limit).
Do I need a closed-loop servo instead of a stepper for precise positioning?
It depends on the consequences of a missed step. Steppers operate in open-loop; the Arduino sends 200 step pulses and assumes the motor moved exactly 360 degrees. If the mechanical load spikes and the motor skips a step, the Arduino has no way of knowing, and your positioning will be permanently offset. If you are building a CNC router or a 3D printer where a skipped step ruins the physical workpiece, you should use a closed-loop stepper (which adds an encoder to a standard stepper) or an AC/DC servo motor. For simple camera sliders or conveyor belts where a missed step is unnoticeable, a standard open-loop stepper is perfectly adequate and vastly cheaper to implement.






