How to drive a DC motor fan with Arduino?

This guide covers how to control a DC motor fan (like a cooling fan) using an Arduino , including speed control with PWM, direction control with an H-bridge, and protection circuits . 1. Components Needed Component Purpose Arduino (Uno/Nano) Motor control logic DC Motor Fan (5V/12V) Example: 12V PC fan Transistor (TIP120, 2N2222) For small motors (≤500mA) MOSFET (IRF540N, IRLB8721) For high-current motors (≥1A) Diode (1N4007) Flyback protection Resistor (220Ω-1kΩ) Limits base/gate current Power Supply Must match motor voltage (e.g., 9V battery, 12V adapter) 2. Basic On/Off Control (No Speed Control) Circuit Diagram Arduino 5V → Motor (+) Arduino GND → Motor (-) ⚠️ Warning: Only works for very small motors (≤100mA). For larger motors, use a transistor/MOSFET. 3. Using a Transistor (TIP120) for Medium Loads Wiring (NPN Transistor) Arduino Pin 9 → Resistor (1kΩ) → TIP120 Base TIP120 Collector → Motor (+) TIP120 Emitter → GND Motor (-) ...