Skip to content
Web app (opens in a new tab)Get the kit
Web app (opens in a new tab)Get the kit

Motors, Relays & Outputs

Servo vs Stepper Motor vs DC Motor: Which Motor for Your Project?

A servo turns to an angle and holds it, a stepper moves in counted steps, and a DC motor simply spins. Here is how each works, how they compare, and which one fits your project.

Three small motors side by side: a DC motor with an arrow circling all the way round, a blue SG90 servo with its amber arm pointing at an angle on a 0° to 180° dial, and a square stepper motor with arrows hopping from tick to tick
Three small motors side by side: a DC motor with an arrow circling all the way round, a blue SG90 servo with its amber arm pointing at an angle on a 0° to 180° dial, and a square stepper motor with arrows hopping from tick to tick

Servo vs stepper motor vs DC motor comes down to one question: what should the shaft do? A DC motor spins for as long as it has power, so it suits wheels, fans and pumps. A servo turns to the angle you ask for and holds it, so it suits gates, flaps and pointers. A stepper motor turns in small, equal steps that a controller counts, so it suits jobs that need many exact turns, like a plotter or a 3D printer.

The biggest difference between a servo and a stepper is feedback. A servo checks where its shaft is and corrects itself. A stepper does not check. It trusts that every step happened.

Below, you will see how each one works, real numbers from data sheets, and a gate and a fan built step by step.

The short answer: which motor for which job

Start with the motion you need, not the motor. Most student projects fall into one of three patterns.

You need the shaft to...PickEveryday exampleStudent project example
Spin nonstop, faster or slowerDC motorA toy car wheel, a desk fanA small fan switched on when the room is warm
Turn to an angle and stay thereServoA car's windscreen wiper, a camera that pansA parking barrier that lifts for a car
Turn an exact amount, many times overStepper motorA 3D printer, a pen plotterA turntable that rotates a model 15° at a time
You need the shaft to...
Spin nonstop, faster or slower
Pick
DC motor
Everyday example
A toy car wheel, a desk fan
Student project example
A small fan switched on when the room is warm
You need the shaft to...
Turn to an angle and stay there
Pick
Servo
Everyday example
A car's windscreen wiper, a camera that pans
Student project example
A parking barrier that lifts for a car
You need the shaft to...
Turn an exact amount, many times over
Pick
Stepper motor
Everyday example
A 3D printer, a pen plotter
Student project example
A turntable that rotates a model 15° at a time

A quick way to remember it: a DC motor is about speed, a servo is about angle, and a stepper is about counting.

Three panels compare the motions: a DC motor spins while power is on, a servo turns to the angle its pulse width sets on a 0° to 180° dial (a 1.5 ms pulse puts the arm in the middle), and a stepper moves one step per pulse, so 3 pulses make 3 steps.
Three panels compare the motions: a DC motor spins while power is on, a servo turns to the angle its pulse width sets on a 0° to 180° dial (a 1.5 ms pulse puts the arm in the middle), and a stepper moves one step per pulse, so 3 pulses make 3 steps.

Two of these motors are not as separate as they look. A hobby servo has a small DC motor inside it, and Adafruit's stepper motor guide (opens in a new tab) describes steppers as "DC motors that move in discrete steps." So the real difference is in how each motor is controlled, which is what the next section covers.

How each motor works

DC motor: power in, spin out

A DC motor runs on direct current, the one-way current from a battery or USB supply. Arduino's transistor motor control guide (opens in a new tab) explains the idea: current through a coil of wire makes a magnetic field, and magnets inside the motor's body push and pull on it, so the shaft turns.

A DC motor has two wires. Connect power and it spins. Swap the two wires and it spins the other way. Lower the voltage, or switch the power on and off very fast with PWM, and it spins more slowly. The same guide says "the higher the PWM value, the faster the motor will spin."

What a plain DC motor cannot do is stop at a chosen position. It has no idea where its shaft is pointing. Our guide to how DC motors work and how to control their speed goes deeper.

Servo: a motor that checks its own angle

A hobby servo is a small DC motor, a gearbox, a position sensor and a control circuit in one case. SparkFun's hobby servo tutorial (opens in a new tab) explains that the servo uses a potentiometer attached to the shaft to sense the position. The control circuit compares that position with the target, drives the motor until they match, then stops.

This checking is called closed-loop control. If something pushes the arm, the servo notices and pushes back.

A servo has three wires: power, ground and signal. The signal is a stream of pulses. SparkFun's hobby servo tutorial (opens in a new tab) says they come every 20 ms. The SG90 data sheet (opens in a new tab) shows that a 1.5 ms pulse puts the arm in the middle, and about 1 ms or 2 ms sends it to either end. The SG90 turns only about 180°. Our post on what a servo motor is and what its three wires do covers the inside of a servo in detail.

Stepper motor: count the steps

A stepper motor has several coils, grouped into phases, around a magnetic shaft. A controller switches the coils on in a fixed order. Each switch pulls the shaft forward by one step. Arduino's stepper motor configurations guide (opens in a new tab) says steppers "can be controlled to a high degree of accuracy without any feedback mechanisms."

That is the trick. If one step is 1.8°, then 50 steps is 90°, every time, as long as no step is missed. The controller keeps the count. The motor itself never reports its position.

Steppers come in two main kinds. Adafruit's guide to the types of steppers (opens in a new tab) explains that unipolar drivers can be built from simple transistor circuits, while bipolar ones use H-bridges to reverse the current. It also says a 2-phase bipolar motor has 4 wires and that the 5-wire style is common in smaller unipolar motors. Either way, a stepper needs a driver between it and the microcontroller.

Servo vs stepper vs DC motor compared

Here is the three-way comparison on the points that decide most projects: how you control it, its speed, its torque, and whether it holds still when you stop.

DC motorServo (hobby)Stepper motor
How you control itPower on or off; PWM for speed; swap the wires for directionA pulse every 20 ms; the pulse width sets the angleA sequence of pulses to the coils, one step per pulse
Knows its position?NoYes, through its built-in sensor (closed loop)No; the controller counts steps (open loop)
Range of movementSpins without limitAbout 180° for a standard servoSpins without limit, in steps
SpeedFast; the 130-size motor below runs at thousands of rpmModerate; the SG90 below turns 60° in 0.1 sBest at low speed, where its torque is highest
TorqueNot listed for the 130-size motor below1.8 kgf·cm at stall for the SG90 belowHighest at low speed
Holds still when stopped?No; the shaft can turn freelyYes, it pushes back towards its angleYes, while its coils are powered
Extra parts neededA transistor, motor driver or relayNone on most kits; a separate supply for big servosA stepper driver and its own supply
Wires234 or more
Best forWheels, fansGates, flaps, pointersPlotters, 3D printers, CNC machines, camera platforms
How you control it
DC motor
Power on or off; PWM for speed; swap the wires for direction
Servo (hobby)
A pulse every 20 ms; the pulse width sets the angle
Stepper motor
A sequence of pulses to the coils, one step per pulse
Knows its position?
DC motor
No
Servo (hobby)
Yes, through its built-in sensor (closed loop)
Stepper motor
No; the controller counts steps (open loop)
Range of movement
DC motor
Spins without limit
Servo (hobby)
About 180° for a standard servo
Stepper motor
Spins without limit, in steps
Speed
DC motor
Fast; the 130-size motor below runs at thousands of rpm
Servo (hobby)
Moderate; the SG90 below turns 60° in 0.1 s
Stepper motor
Best at low speed, where its torque is highest
Torque
DC motor
Not listed for the 130-size motor below
Servo (hobby)
1.8 kgf·cm at stall for the SG90 below
Stepper motor
Highest at low speed
Holds still when stopped?
DC motor
No; the shaft can turn freely
Servo (hobby)
Yes, it pushes back towards its angle
Stepper motor
Yes, while its coils are powered
Extra parts needed
DC motor
A transistor, motor driver or relay
Servo (hobby)
None on most kits; a separate supply for big servos
Stepper motor
A stepper driver and its own supply
Wires
DC motor
2
Servo (hobby)
3
Stepper motor
4 or more
Best for
DC motor
Wheels, fans
Servo (hobby)
Gates, flaps, pointers
Stepper motor
Plotters, 3D printers, CNC machines, camera platforms

Table notes: Adafruit's what is a stepper motor (opens in a new tab) page says a stepper "has maximum torque at low speeds" and names 3D printers, CNC, camera platforms and plotters as uses. The 20 ms pulse is from SparkFun's hobby servo tutorial (opens in a new tab). The servo speed and torque are from the SG90 data sheet (opens in a new tab) and the DC motor speed from Adafruit's 130-size hobby motor (opens in a new tab) page. The stepper wire counts are from Adafruit's types of steppers (opens in a new tab) page.

Servo vs stepper motor: closed loop vs open loop

People compare these two most often, because both can point a shaft at an exact position. The difference is how they know they got there.

A servo measures. If a load slows it down, it keeps driving until the sensor says the arm is at the target. If someone nudges the arm, it pushes back. The cost is range: a standard hobby servo covers about half a turn.

A stepper counts. It can turn as far as you like, in either direction, and land on exactly the step you asked for. But if the load is too heavy, or you ask it to speed up too fast, the shaft can fall behind the coils and skip a step. The controller does not find out. Every move after that is off by the missed amount. Adafruit's stepper guide (opens in a new tab) notes that "most steppers do not have integral feedback for position," and that limit switches or "home" detectors are typically needed to set a reference position.

That is why a 3D printer moves each axis to a small switch when it starts. It finds a known spot, then counts from there.

The servo is a closed loop: target angle, motor turns, sensor reads angle, and it keeps turning until they match, then stops and holds. The stepper is open loop: send N pulses, the shaft moves N steps and nothing checks, so a skipped step leaves it one step short of the target.
The servo is a closed loop: target angle, motor turns, sensor reads angle, and it keeps turning until they match, then stops and holds. The stepper is open loop: send N pulses, the shaft moves N steps and nothing checks, so a skipped step leaves it one step short of the target.

There is one more difference people notice. Adafruit's guide says stepper current "is independent of load" and that steppers draw the most current "when they are doing no work at all." A stepper holding still is warm because its coils are still on. A hobby servo standing still uses very little. Arduino's servo motor basics (opens in a new tab) gives 5 to 6 mA at idle for a common mini servo.

So which is better? Neither, in general. For a short swing that must hold against a push, a servo is simpler. For many full turns with exact positions, a stepper is the better tool.

Servo motor vs DC motor: angle or speed

A DC motor vs servo choice is a choice between speed and position. A DC motor gives you rotation without limit. You control how fast and which way, but not where it stops. That suits a fan, where only the airflow matters. A servo gives you an exact angle, but only within its range. That suits a barrier, a flap or a pointer on a dial.

There is a third kind worth knowing about: the continuous rotation servo. It looks like a normal servo, but SparkFun's hobby servo tutorial (opens in a new tab) explains that it turns the pulse signal into "the rotational speed and direction of the shaft." It spins like a geared DC motor and gives up its sense of position. Our comparison of 360-degree servos and standard servos covers when that trade is worth it.

Stepper motor vs DC motor: exact turns or easy speed

Both can spin without limit, so the question is whether you need to know exactly how far it turned. A DC motor is simple: two wires, one transistor or driver, and PWM for speed. But it cannot tell you how far it went. A stepper is precise. Send 200 pulses to a 200-step motor and it makes one full turn. The price is a stepper driver, more wires, and code that sends the pulses in the right order. Arduino's stepper guide (opens in a new tab) uses a Darlington array for a unipolar motor or an H-bridge for a bipolar one, and says steppers should run from an external supply because "they draw too much to be powered directly from your Arduino board." Our post on motor drivers and why a pin cannot power a motor explains what those chips do.

Real numbers: four small motors side by side

Words like "fast" and "strong" only mean something next to numbers. Here are four small motors that students meet, with figures from their own spec pages.

MotorTypeVoltageMovementTorqueCurrentSource
SG90 micro servoServo4.8 V (about 5 V)About 180°, 60° in 0.1 s1.8 kgf·cm stallNot listedSG90 data sheet (opens in a new tab)
130-size hobby motorDC motor4.5 to 9 V, rated 6 V4,500 ± 1,500 rpm loadedNot listed250 mA loaded, 500 mA stalled (max)Adafruit 130 motor (opens in a new tab)
Small reduction stepperUnipolar stepper, geared5 VAbout 516 steps per turn150 gf·cm holdingNot listedAdafruit geared stepper (opens in a new tab)
NEMA-17 stepperBipolar stepper12 V rated200 steps per turn, 1.8° each2 kg·cm holding per phase350 mA maxAdafruit NEMA-17 (opens in a new tab)
Motor
SG90 micro servo
Type
Servo
Voltage
4.8 V (about 5 V)
Movement
About 180°, 60° in 0.1 s
Torque
1.8 kgf·cm stall
Current
Not listed
Motor
130-size hobby motor
Type
DC motor
Voltage
4.5 to 9 V, rated 6 V
Movement
4,500 ± 1,500 rpm loaded
Torque
Not listed
Current
250 mA loaded, 500 mA stalled (max)
Motor
Small reduction stepper
Type
Unipolar stepper, geared
Voltage
5 V
Movement
About 516 steps per turn
Torque
150 gf·cm holding
Current
Not listed
Motor
NEMA-17 stepper
Type
Bipolar stepper
Voltage
12 V rated
Movement
200 steps per turn, 1.8° each
Torque
2 kg·cm holding per phase
Current
350 mA max

The geared stepper's page works out its 32 steps × 16.128 gearing as about 516 steps per turn. Each maker measures differently, so treat these as a guide, not a contest.

Worked example: three quick calculations

  1. How many steps for a quarter turn?

    On the NEMA-17, one step is 1.8°. A quarter turn is 90°. 90 ÷ 1.8 = 50 steps. On the geared stepper, 516 steps make 360°, so one step is about 360 ÷ 516 = 0.70°, and a quarter turn is about 516 ÷ 4 = 129 steps.

  2. How fast does the servo swing a gate?

    The SG90 data sheet gives 0.1 s per 60°. A gate that lifts 90° needs about 90 ÷ 60 × 0.1 = 0.15 s at that rated speed. A real arm with weight on it will be slower, which is why the MakerBuddy rules let you set a slower movement on purpose.

  3. How heavy an arm can the servo hold?

    Torque is force times distance. The SG90's 1.8 kgf·cm means it can just hold about 1.8 kg hanging 1 cm from the shaft. At 6 cm out, divide by 6: about 0.3 kg. That is the absolute limit at stall, so plan for far less. A craft-stick barrier weighs a few grams and is well inside it. A long wooden ruler with a toy taped to the end is not.

The DC motor needs no sum to choose it, only a warning. At 250 mA loaded and 500 mA stalled, it needs far more current than a microcontroller pin can give. Arduino's motor control guide (opens in a new tab) says an Arduino digital pin can only provide 40 mA at 5 V. So a transistor, driver or relay always goes in between.

Which motor each MakerBuddy project uses

The MakerBuddy IoT Kit V1.0 is a learning board built around an ESP32. It has two outputs that make things move, and they match two of the three motor types in this post.

The servo moves things to an angle. The kit's SG90 servo plugs into the socket marked 19. It turns from 0° to 180° and holds. Lesson 14 teaches it with a cardboard parking barrier, and Lesson 29 starts the full gate, which Lesson 30 finishes. The servo control notes are clear that "this is a servo that turns to an angle, not a motor that spins." Servo moves in rules stop at 0° and 180° and never wrap round.

The relay switches a DC load on and off. The relay plugs into the socket marked 23. It can switch a small low-voltage fan or bulb. Lesson 15 explains how the relay keeps that load circuit separate from the board, and Lesson 26 builds a smart fan with it. A fan wired through the relay runs at one speed: on or off. The board does not set the fan's speed.

The kit photos also show a small motor with a fan blade and a small bulb. Ask which of these come with your order.

There is no stepper motor in the kit. The dashboard and rules control the servo and relay, and have no stepper control. If you want to try a stepper later, you would add a stepper driver and write your own Arduino sketch. Uploading your own sketch replaces the MakerBuddy firmware until you upload it again, and Install by USB shows how to put it back.

MakerBuddy projectMotor jobMotor typeHow the board drives it
Parking gateLift a barrier to an angle and hold itServoRule step moves the servo to an angle
Servo wiperSwing back and forthServoRule step with a back-and-forth movement
Pet feeder flapOpen a flap, then close itServoDashboard slider or a Timer rule
Auto-fanSpin a fan when the room is warmDC motorRelay switched on and off by a rule
Room mappingPoint the distance sensor at set anglesServoDashboard slider, angle by angle
MakerBuddy project
Parking gate
Motor job
Lift a barrier to an angle and hold it
Motor type
Servo
How the board drives it
Rule step moves the servo to an angle
MakerBuddy project
Servo wiper
Motor job
Swing back and forth
Motor type
Servo
How the board drives it
Rule step with a back-and-forth movement
MakerBuddy project
Pet feeder flap
Motor job
Open a flap, then close it
Motor type
Servo
How the board drives it
Dashboard slider or a Timer rule
MakerBuddy project
Auto-fan
Motor job
Spin a fan when the room is warm
Motor type
DC motor
How the board drives it
Relay switched on and off by a rule
MakerBuddy project
Room mapping
Motor job
Point the distance sensor at set angles
Motor type
Servo
How the board drives it
Dashboard slider, angle by angle

The gate is built in Lessons 29 and 30. The other four come from the project ideas library. The feeder has one honest limit: the board has no clock, so a Timer rule can open the flap every few hours, but not at 8 am.

Only one thing controls the servo at a time. While a rule, the knob or a sensor mapping holds it, the board refuses commands from the dashboard slider.

Worked example: a gate and a fan, rule by rule

Here are the two classic builds as no-code rules, using the steps from the MakerBuddy lessons. You need the HC-SR04 distance sensor and the servo for the gate, and the DHT11 and the relay for the fan.

The gate (servo)

First, find your angles. In Lesson 14 you fit a short cardboard arm, then move from 90° in 5° steps until the arm is flat (closed) and again until it is upright (open). Write both down. They are rarely exactly 0° and 180°.

Then build two Condition rules, as in Lesson 30.

  1. Rule 1, Car arrives.

    Condition: Distance (HC-SR04) less than your car threshold, for example 10 cm. Step 1: RGB Green, delay 100 ms. Step 2: Servo Move to your open angle, movement duration 1000 ms for a smooth lift, hold 100 ms.

  2. Rule 2, Car leaves.

    Condition: Distance greater than a bigger number, for example 20 cm. Step 1: RGB Red, delay 3000 ms, so the gate waits before closing. Step 2: Servo Move to your closed angle, hold 100 ms.

Why two different numbers? If the gate opened below 10 cm and closed above 10 cm, a car sitting near 10 cm would make it flap up and down. The gap between 10 and 20 stops that. Our post on why a fan keeps switching on and off explains this gap, called hysteresis.

The fan (DC motor through the relay)

Lesson 26 builds the smart fan.

  1. Rule 1, Fan on.

    Condition: Temperature (DHT11) greater than 30 °C. Step: relay on.

  2. Rule 2, Fan off.

    Condition: Temperature less than 26 °C. Step: relay off.

Again, the gap between 30 and 26 keeps the fan from flicking on and off near one number.

Look at what each step asks for. The gate step names an angle. The fan step only says on or off. That is the servo vs DC motor difference in one line. The board reads its sensors once a second, so each rule reacts in about a second, not instantly.

Common mistakes, with causes and fixes

The servo buzzes and will not settle

Symptom: the servo hums nonstop, feels warm, or the board restarts.

Cause: the arm is pressed against something or the angle sits past the servo's real end point, so the motor keeps pushing. Lesson 14 warns that stalled gears can buzz, draw extra current and get damaged. Arduino's servo motor basics (opens in a new tab) says a common mini servo blocked by an object can draw up to 800 mA.

Fix: move the arm back to a safe angle, then disconnect power. Keep your angles a little inside the limits you measured, and use a short, light arm.

The stepper ends up in the wrong place after a while

Symptom: the first moves are perfect, then everything is a little off.

Cause: the stepper skipped steps under a heavy load or a fast start, and nothing told the controller. It is open loop.

Fix: lighten the load, slow the speed, and add a home switch so the controller can find a known spot at start-up, as Adafruit's stepper guide (opens in a new tab) suggests.

The stepper gets hot while doing nothing

Symptom: the motor is still, but warm.

Cause: a stepper draws its current whether it is moving or not, and Adafruit notes it draws the most when doing no work.

Fix: this is normal up to a point. Check that your driver's current setting matches the motor, and give the motor its own supply.

A DC motor wired straight to a pin barely moves

Symptom: the motor twitches or does nothing, or the board resets.

Cause: a pin gives a tiny signal current, and motors pull the most current when they start. Arduino's motor control guide (opens in a new tab) says this is why a transistor sits between the pin and the motor.

Fix: switch the motor through a relay for on and off, or a transistor or motor driver for speed, with the motor on its own supply.

The gate flaps open and shut

Symptom: a car near the sensor makes the barrier lift and drop again and again.

Cause: the open and close rules use the same threshold.

Fix: leave a gap, such as open below 10 cm and close above 20 cm, as in Lesson 30.

How to choose: a three-question checklist

  1. Does the shaft need to keep spinning?

    If no, and half a turn is enough, use a servo. It is the simplest way to get an exact angle, and it holds that angle against a push.

  2. If it spins, do you need to know exactly how far?

    If yes, use a stepper with a driver. If no, use a DC motor.

  3. Does a DC motor need speed control or just on and off?

    On and off works through a relay. Speed control needs PWM and a transistor or motor driver.

Three questions pick the motor: if the shaft does not need to keep spinning, use a servo; if it spins and needs exact turns, use a stepper with a stepper driver; otherwise use a DC motor, with PWM and a driver for speed control or a relay for on and off.
Three questions pick the motor: if the shaft does not need to keep spinning, use a servo; if it spins and needs exact turns, use a stepper with a stepper driver; otherwise use a DC motor, with PWM and a driver for speed control or a relay for on and off.

If you are starting out, begin with the servo and the relay. They cover the two most common jobs, angle and on/off, and you can build both without code. Our pillar guide to actuators, motors, relays, buzzers and displays shows where they fit among other outputs, and the smart parking system project turns the gate into a full build. Students who want a kit with the servo, relay and sensors in labelled sockets can see what the MakerBuddy IoT kit for students includes.

FAQ

What is the difference between a servo motor and a DC motor?

A DC motor spins nonstop while it has power, and you control its speed and direction. A servo turns to a set angle and holds it, because it has a position sensor and control circuit inside. Most hobby servos actually contain a small DC motor and a gearbox. Use a DC motor for wheels and fans, and a servo for gates and flaps.

Which is better, servo or stepper motors?

Neither is better everywhere. A servo checks its position and pushes back if disturbed, so it suits short swings that must hold, like a barrier. A stepper can turn as far as you like in exact steps, so it suits plotters and printers. For a student's first moving project, a servo is usually simpler because it needs no driver.

How can I tell if a motor is a stepper motor?

Count the wires and look for a driver. A plain DC motor has 2 wires and a hobby servo has 3. A stepper has 4 or more. Adafruit's types of steppers (opens in a new tab) guide describes 4-wire bipolar, 5-wire unipolar and 8-wire motors. A stepper also needs a driver between it and the board.

Can a servo motor rotate 360 degrees?

A standard servo cannot. It turns to an angle, usually within about 180°, and stops. A continuous rotation servo can spin all the way round, but it uses the pulse to set speed and direction instead of angle, so it no longer knows its position. The MakerBuddy kit's SG90 is a standard servo.

Does a stepper motor need a driver?

Yes. A stepper needs its coils switched in the right order with more current than a microcontroller pin can give. Arduino's stepper guide (opens in a new tab) uses a Darlington array for unipolar motors and an H-bridge for bipolar ones, with an external supply.

What motor is used in 3D printers?

Stepper motors. Adafruit's stepper motor guide (opens in a new tab) lists 3D printers, CNC machines, camera platforms and X-Y plotters as typical uses. Each axis counts its steps from a known starting point, found with a limit or home switch.

Why does my servo jitter or shake?

A weak power supply or an arm pushing against something are common causes. SparkFun's hobby servo tutorial (opens in a new tab) says an underpowered servo can hunt, wobbling around its target instead of settling. Use a good 5 V supply and a short, light arm, and keep your angles inside the servo's real limits. More beginner guides like this one are on the MakerBuddy blog.

Sources

From the blog

Keep reading

Motors, Relays & Outputs

Active vs Passive Buzzer: How to Tell Them Apart

An active buzzer beeps on its own when you give it power. A passive buzzer needs a signal that wiggles, and plays whatever note you send. Here is how to tell them apart, wire them and use them.

20 min read

Learn with MakerBuddy

Start building today.

Every part in these guides has its own lesson. Read them free, or get a kit for your class.