Motors bring your projects to life—robots move, gates open, wheels spin. But you cannot connect a motor directly to an Arduino pin (it draws too much current and can damage the board). You need a motor driver circuit.
| Motor Type | Motion | Control | Common Models | |-----------|--------|---------|---------------| | DC Motor | Continuous rotation | Speed (PWM) + direction | BO motor, N20 gear motor | | Servo Motor | Precise angle (0–180°) | Angle via PWM signal | SG90 (micro), MG996R (metal gear) | | Stepper Motor | Precise steps | Step + direction signals | 28BYJ-48, NEMA 17 |
Arduino pins output maximum 40 mA at 5V. A small DC motor draws 200–500 mA at 6–12V. You need an H-bridge motor driver to handle the higher voltage and current.
The L298N is the most popular motor driver for student projects. It can drive two DC motors simultaneously.
| L298N Pin | Connect To | |-----------|----------| | IN1, IN2 | Arduino digital pins (direction) | | ENA | Arduino PWM pin (speed) | | Motor A terminals | DC motor wires | | 12V input | External power supply | | GND | Common ground with Arduino |
Use analogWrite() to set motor speed (0 = stop, 255 = full speed). Direction is set by toggling IN1 and IN2: one HIGH and the other LOW for forward, reverse the combination for backward.
Servo motors rotate to a specific angle and hold position. They are used for robotic arms, pan-tilt camera mounts, and door locks.
The Arduino Servo library makes control simple. Use servo.write(angle) where angle is 0–180 degrees. The servo moves to that angle and holds.
Stepper motors rotate in precise steps (e.g., 1.8° per step = 200 steps per revolution for NEMA 17). They are used in 3D printers, CNC machines, and precision positioning.
This is the cheapest stepper motor setup for beginners. The ULN2003 driver board connects directly to 4 Arduino pins.
For serious projects (3D printers, CNC). The A4988 supports microstepping (1/2, 1/4, 1/8, 1/16 steps) for smoother motion.
| Parameter | 28BYJ-48 | NEMA 17 | |-----------|----------|---------| | Step angle | 5.625° (64 steps/rev) | 1.8° (200 steps/rev) | | Voltage | 5V | 12V | | Torque | Low | High | | Driver | ULN2003 | A4988 / DRV8825 | | Cost | ₹100 | ₹500+ |
Browse our Robotics Project Kits for complete motor control projects.
Explore our collection of DIY kits and components. All project components mentioned in this guide are available in our store.
Browse All Projects