Motor Power and Drivers: the short answer
A microcontroller GPIO pin cannot directly power a motor. Select a driver and supply appropriate to startup, stall, noise and protection requirements.
- Level
- Intermediate
- Time
- About 5 min
- Topic
- Sensors and actuators
Choose a motor driver and power supply that handle start-up and stall current.
Before this: Transistors & MOSFET Switching
A microcontroller GPIO pin cannot directly power a motor. Select a driver and supply appropriate to startup, stall, noise and protection requirements.
Motors are inductive loads whose inrush and stall behavior can exceed ordinary operating current. Drivers provide appropriate switching paths; protecting the controller requires electrical, thermal and sometimes mechanical precautions.
Prepare a driver-selection table with supply voltage, stall current, reverse-polarity protection, control thresholds and fault signaling. Keep outputs stopped until a qualified review approves any powered experiment.
Start-up and stall are the real loads
A motor's label shows its running current. At the instant it starts, and any time its shaft is held, it draws several times more, limited only by the winding resistance. A small brushed motor rated 0.5 A running can pull 3 to 5 A when stalled. Choose the driver and supply for the stall current, or add current limiting that stops a stall from lasting.
You can estimate stall current from the coil: stall current ≈ supply voltage ÷ winding resistance. Measure the resistance with a multimeter on the motor with the shaft still.
Picking a driver
A single MOSFET with a flyback diode switches one direction and works for a fan or a pump. An H-bridge such as the L298N, TB6612 or DRV8833 also reverses the motor. The L298N is old and wasteful, dropping around 2 V across itself, which is a lot on a 6 V motor; the TB6612 and DRV8833 drop much less and run cooler. Stepper motors use their own drivers (A4988, DRV8825, TMC series) with a current limit you set to the motor's rating.
Check four numbers in the driver's datasheet: supply voltage range, continuous current and peak current, logic voltage (3.3 V or 5 V), and whether it has thermal and over-current protection.
Protecting the controller
Brushes and coils make electrical noise that resets microcontrollers. Fit a 100 nF ceramic capacitor across the motor terminals, close to the motor, and a larger capacitor (100 to 470 µF) across the driver's supply. Keep motor wires away from signal wires, and join grounds at a single point. If resets continue, power the motor from a separate supply from the logic, with only the grounds joined.
Never connect a motor directly to a GPIO pin, and never remove a flyback diode because the circuit seemed to work without it. It can fail later, in a way that damages the pin or the board.
Safe bring-up
Test with the motor unloaded and the supply current-limited, if you have a bench supply, at a low voltage first. Watch the current on the supply's display and stop at once if it climbs or the driver smells hot. Have a way to cut power quickly. Keep fingers, hair and loose clothing away from anything that can spin or pinch.
Write down a stop rule in code: if no command arrives for a second, stop the motor. A crash in your program should leave the motor off, not running.
- Sizing the supply for the running current instead of the stall current.
- Sharing one thin ground wire between motor and logic.
- Using a driver that drops 2 V on a 6 V motor and wondering why it is weak and hot.
Practise this lesson with Maker
The explanation above is free for everyone. The practice for Intermediate lessons in every domain are part of the Maker plan at ₹499 a month, and Pro includes them too.
With Maker you also get: a worked example, a hands-on task, a 3-question check.
