Why Arduino Cannot Drive a Motor Directly: MOSFETs for Beginners
Series navigation: Episode 1: The Roadmap · Episode 2: Digital Multimeter and LED Circuit · Episode 3: Voltage Divider Under Load · Episode 4: What an Oscilloscope Shows · Episode 5: How Arduino Reads Sensor Voltage · Episode 6
What you will learn: Why a GPIO pin can send a command but should not supply a motor's power.
What problem it solves: A motor may fail to start, reset the board, overheat an output pin, or damage the controller when connected directly.
What you will be able to do: Explain a low-side N-channel MOSFET circuit, choose parts from their important ratings, and identify where motor current flows when switching on and off.

AI-generated instructional image of a typical low-voltage workbench. It is not a wiring reference or a photograph of a circuit tested for this article; use the schematic below for connections.
Reader guide
| Indicator | Details |
|---|---|
| Article type | Power-interface concept and design checklist |
| Reading time | About 12 minutes |
| Difficulty | 2.5/5 — Beginner |
| Hands-on work | Optional; understand the circuit before building it |
| Example load | Small two-wire brushed DC motor with a separate low-voltage supply |
| Prerequisites | Voltage, current, ground, GPIO, and PWM basics |
| Safety level | Extra-low-voltage DC only; no mains-powered loads |
| Reader outcome | Separate the control path from the load-power path |
The LED worked, so I tried a motor
An Arduino pin could turn an LED on and off. The next idea seemed obvious: replace the LED with a small motor and use the same code.
The result can be confusing. The motor may twitch instead of starting. The Arduino may restart as soon as the motor turns. The USB connection may disconnect. In a worse case, the output pin becomes permanently damaged.
This looks like a software problem because the failure happens when digitalWrite() runs. But the missing idea is electrical:
A GPIO pin is a control output, not a general-purpose power supply.
The Arduino Uno R3 pinout specifies 20 mA as the maximum current per I/O pin. A motor can require far more than that, especially during startup or when its shaft is stalled. The pin can state what should happen, but another device must handle the load current.
That device can be a MOSFET.
Why do projects need motors?
Sensors let a microcontroller observe the physical world. Motors let it change the physical world.
A motor converts electrical energy into mechanical motion. That motion can spin a fan, move a robot wheel, open a valve, position a camera, feed paper through a printer, or turn a pump. This is why motors appear so quickly after LEDs and sensors in Arduino projects: an LED communicates, but a motor performs physical work.
The word motor, however, covers several devices that require different control circuits.
| Motor type | What makes it move | Typical uses | What the controller needs |
|---|---|---|---|
| Brushed DC motor | Mechanical brushes switch current inside the motor | Toys, small fans, pumps, wheels and simple mechanisms | One MOSFET for one-direction speed control; an H-bridge for reversing |
| BLDC motor | Electronics switch current through multiple windings in sequence | Computer fans, drones, power tools, appliances and efficient pumps | A BLDC controller or electronic speed controller; usually a multi-phase power stage |
| Stepper motor | Windings are energized in a controlled step sequence | 3D printers, CNC machines, sliders and indexing mechanisms | A stepper driver that controls winding current and step order |
| Servo motor | A motor, gearbox, position sensor and controller form a position system | Robot joints, steering, camera mechanisms and small actuators | Usually a power supply plus a command signal; interface depends on the servo type |
“General motor” usually means a brushed DC motor here
The small cylindrical motor with two wires that appears in many starter kits is normally a brushed DC motor. Applying DC voltage makes it rotate. Reversing the polarity reverses its direction, and PWM can adjust its average power. Its internal brushes perform the electrical commutation, which is why the external one-MOSFET circuit can be simple.
This is the motor used for the circuit in this article.
A BLDC motor is not a two-wire DC motor without brushes
A BLDC motor replaces mechanical brushes with electronic commutation. Its controller must energize the motor phases in the correct sequence and at the correct time. Many BLDC motors have three phase wires; some products, such as complete computer fans, contain the controller internally and expose a simpler power or command interface.
Do not connect an unknown BLDC motor to the one-MOSFET circuit shown below. Use a driver or electronic speed controller designed for that motor's voltage, phase current, sensors, and control method.
Position-control motors need a different goal
A stepper motor is useful when motion should advance in known increments. A servo system is useful when the important result is a requested position, speed, or torque with feedback. Both still use transistors internally or in their drivers, but the software commands and power stages are more involved than simply switching one motor lead.
The practical lesson is:
Identify the motor type before choosing the driver circuit.
Counting the wires can provide a clue, but it is not enough to identify every motor. Look for a part number, datasheet, rated voltage, winding or phase information, current requirements, and whether a controller is already built in.
What can a MOSFET let a microcontroller control?
A MOSFET is an electronically controlled switch. A small signal at its gate can control a much larger current through its drain and source, within the device's ratings.
That makes it useful when a project needs to control:
- a DC motor or fan;
- a relay or solenoid;
- an LED strip;
- a small pump or valve;
- a heater or other resistive load.
Those loads are not interchangeable. A motor or relay is inductive and needs a path for stored magnetic energy. A large LED load may need current regulation. A heater requires careful power and temperature design. The MOSFET is only one part of the interface.
For a software analogy, the GPIO is an API request and the MOSFET is the worker with access to the power resource. The request does not carry the motor's energy.
The two current paths
In a common beginner circuit, an N-channel MOSFET is placed between the load and ground. This is called low-side switching.
There are two paths to understand.
Control path
Arduino output → gate resistor → MOSFET gate
MOSFET gate → pull-down resistor → ground
The series gate resistor limits the brief current pulse used to charge or discharge the gate and can reduce ringing. The pull-down resistor keeps the gate LOW while the microcontroller is resetting, disconnected, or still configuring its pin.
Typical beginner examples may use roughly 100–220 Ω in series and 10 kΩ from gate to source, but these are starting values rather than universal rules. Switching frequency, gate charge, controller limits, and electromagnetic interference all affect the design.
Power path
motor supply positive → motor → MOSFET drain → MOSFET source → ground
The motor current comes from the motor supply. It does not travel through the Arduino output pin.
The motor supply ground and Arduino ground are connected in this non-isolated example. Without that shared reference, the MOSFET gate voltage is undefined relative to its source. Sharing ground does not mean feeding the motor from the Arduino's 5 V pin.
What the gate signal does
When the Arduino output is LOW, the gate-to-source voltage is near 0 V and the MOSFET should be off.
When the output is HIGH, the gate voltage rises relative to the source and a suitable N-channel MOSFET turns on. Current flows through the motor and the motor runs.
PWM can repeatedly turn the MOSFET on and off to control average motor power. The Arduino pin still drives only the gate; the MOSFET switches the load current.
This is where the phrase logic-level MOSFET matters. The device must achieve acceptably low on-resistance at the gate voltage the microcontroller can actually produce—perhaps 5 V or 3.3 V. A datasheet threshold voltage, VGS(th), only describes where the device begins to conduct a small test current. It does not prove that the MOSFET is fully enhanced for a motor load.
Look for an RDS(on) specification at or below the available gate voltage. If a datasheet only specifies low resistance at 10 V gate drive, do not assume a 3.3 V controller will switch it efficiently.
Why the diode is placed across the motor
A motor winding is an inductor. While current flows, it stores energy in a magnetic field. When the MOSFET suddenly turns off, the inductor tries to keep the current moving. Without a safe path, the drain voltage can rise high enough to damage the MOSFET or disturb the controller.
The diode across the motor is commonly called a flyback, freewheel, or recirculation diode.
During normal ON operation, it is reverse-biased and does not carry the motor current. When the MOSFET turns off, the motor's stored energy makes the diode conduct around the motor-diode loop until the current decays.
For the low-side circuit shown:
- diode cathode connects to motor-supply positive;
- diode anode connects to the motor/MOSFET-drain side.
Reversing that diode creates a near short circuit when power is applied. Confirm the symbol and the physical diode's polarity mark before connecting power.
The diode must be selected for the load current, reverse voltage, switching speed, and energy. One familiar part number is not automatically correct for every motor or PWM frequency.
The motor's normal current is not the worst case
A motor data sheet may list a no-load current and a stall current. The no-load value is measured while the shaft spins freely. At startup, the shaft is not yet moving, so the initial current can approach the stall condition.
Designing only around the running current can therefore fail at the exact moment the motor starts.
Before choosing the switch and supply, find or measure safely:
- rated motor voltage;
- no-load current;
- expected working current;
- startup or stall current;
- how long a stall can last;
- PWM frequency and duty-cycle range;
- supply capability and wiring limits.
A bench supply with an appropriate current limit is useful for controlled investigation. Do not deliberately stall an unknown motor for an extended time; the motor, MOSFET, wires, or supply can overheat.
MOSFET ratings that actually matter
Choosing a MOSFET by current rating alone is a common mistake.
| Datasheet item | Question it answers |
|---|---|
VDS rating |
Can it withstand the supply plus switching transients? |
RDS(on) at stated VGS |
How much conduction loss occurs at the real gate voltage? |
| Continuous and pulsed drain current | Is the current allowed under the specified thermal conditions? |
| Safe operating area | Can it survive the simultaneous voltage, current, and duration? |
| Gate charge | Can the controller switch it quickly enough at the chosen PWM frequency? |
| Package thermal resistance | How easily can heat leave the silicon? |
Maximum VGS |
Can the gate survive the applied drive and transients? |
The large current printed on a product page may assume an ideal heat sink and case temperature. Breadboard leads, thin jumper wires, connectors, PCB copper, and ambient temperature can become the real limits first.
Why the MOSFET becomes warm
When on, a real MOSFET has resistance. A first estimate of conduction loss is:
Pconduction ≈ I² × RDS(on) × duty cycle
Suppose a properly driven MOSFET has 0.05 Ω on-resistance and carries 1 A continuously:
P ≈ 1² × 0.05 = 0.05 W
At 3 A:
P ≈ 3² × 0.05 = 0.45 W
Tripling the current increased this loss by nine times. There are also switching losses while the MOSFET moves between off and on, diode losses, and resistance that usually rises with junction temperature.
These calculations are illustrative, not results from a physical experiment. A real thermal design must use the chosen part's datasheet curves, actual gate drive, PWM conditions, PCB copper, enclosure, ambient temperature, and worst-case load.
A safe design sequence
This article is enough to understand the topology; building it is optional. Before applying power:
- Identify the motor's rated, startup, and stall current.
- Choose a supply that matches the motor voltage and has a safe current limit.
- Choose a logic-level N-channel MOSFET with margin in voltage, current, safe operating area, and thermal performance.
- Verify
RDS(on)at the real GPIO voltage—not only at 10 V. - Choose a flyback diode for the current, reverse voltage, energy, and PWM conditions.
- Add the gate resistor and gate-to-source pull-down.
- Add local supply decoupling appropriate to the motor and wiring.
- Connect the controller and motor-supply grounds in the non-isolated circuit.
- Check the MOSFET pinout; gate, drain, and source order varies by device and package.
- Inspect diode polarity and all supply connections with power removed.
- Start with a current-limited supply and a short test.
- Measure supply voltage, motor current, and component temperature before increasing load or duty cycle.
Do not use a solderless breadboard for current beyond its known connector and contact ratings. Do not switch mains voltage with this beginner circuit.
Minimal Arduino control code
Once the electrical interface is correct, the software is intentionally simple:
const int motorPin = 9; // PWM-capable pin on an Uno R3
void setup() {
pinMode(motorPin, OUTPUT);
digitalWrite(motorPin, LOW);
}
void loop() {
analogWrite(motorPin, 128); // approximately 50% duty cycle
delay(2000);
analogWrite(motorPin, 0); // off
delay(2000);
}
analogWrite(128) does not guarantee half the motor speed. It requests roughly 50% PWM duty cycle on this board and pin. Motor speed also depends on load, supply, friction, driver loss, PWM frequency, and motor characteristics. Some motors may not start at a low duty cycle even though they continue running after being started at a higher value.
Common beginner symptoms
| Symptom | Likely cause | First safe check |
|---|---|---|
| Motor never starts | Wrong MOSFET pinout, no common ground, weak supply, or insufficient gate voltage | Remove power and verify datasheet pinout and ground path |
| Motor is always on | Gate floating, MOSFET damaged, or drain/source connection wrong | Confirm gate pull-down and pin orientation |
| Arduino resets | Supply dip, motor noise, poor grounding, or shared power path | Check supply voltage during startup and separate load wiring |
| MOSFET becomes hot | High current, inadequate gate drive, high RDS(on), slow switching, or poor cooling |
Turn off power and recalculate worst-case loss |
| MOSFET fails when switching off | Missing, reversed, slow, or underrated flyback path | Verify diode placement and transient rating |
| Motor runs but PWM control is erratic | Wiring inductance, noise, unsuitable PWM frequency, or weak gate drive | Inspect supply decoupling, ground layout, and waveforms |
A reset is useful evidence: the motor's electrical event is reaching the controller. Adding random delays to the program rarely fixes that path.
What this simple circuit cannot do
One low-side MOSFET controls one direction. It does not reverse the motor. Reversing a motor generally requires an H-bridge or a suitable motor-driver IC.
A dedicated driver may also be the better choice when the project needs current limiting, thermal shutdown, fault reporting, controlled switching, braking, reverse-polarity protection, or multiple motors. Learning the discrete MOSFET circuit is still valuable because it makes those driver features understandable.
Completion checklist
- [ ] I can explain why a GPIO pin should command a motor rather than power it.
- [ ] I can trace the gate-control path separately from the motor-current path.
- [ ] I understand why the controller and supply share ground in this non-isolated example.
- [ ] I know that
VGS(th)is not the fully-on gate voltage. - [ ] I check
RDS(on)at the gate voltage my board actually provides. - [ ] I include a correctly oriented flyback path for an inductive load.
- [ ] I design for startup or stall current, not only no-load current.
- [ ] I can estimate conduction loss with
I²Rand recognize its limitations. - [ ] I check the exact MOSFET pinout before applying power.
- [ ] I know when a motor-driver IC or H-bridge is more appropriate.
Next experiment
A MOSFET data sheet contains everything needed to decide whether this circuit is safe—but only if I can find the conditions hidden beside each number. Next, I will learn how to read a microcontroller or component data sheet without treating the front-page specifications as guarantees.
References
- Arduino UNO R3 hardware documentation
- Arduino UNO R3 full pinout
- Microchip ATmega328P product page and datasheet
- Texas Instruments: Basics of Power Switches
- Texas Instruments: Switching Inductive Loads
- Texas Instruments: Motor-driver types and learning resources
- Microchip: Brushed DC, BLDC, and stepper control algorithms
Comments
Post a Comment