Skip to content
Badr Academy Education
العربية
Badr Academy Education

Browse by topic

Robotics & electronics

Motors in robots: DC, servo and stepper motors compared

Choosing a motor for your project: how each type works, why you need a driver, how to power motors safely – with a table and a servo example.

  • 8 min read
Motors in robots: DC, servo and stepper motors compared

If sensors are a robot’s senses, motors are its muscles. They turn the program’s decisions into real movement: wheels turning, an arm lifting, a camera looking round. But choosing the wrong motor can make your project fail even when the code is sound: a robot that is far too slow, an arm that cannot lift its own weight, or an Arduino that suddenly resets whenever the motor starts. In this article we explain the three types most used in educational robotics: the DC motor, the servo motor and the stepper motor. We show how each works, when to choose it, why you always need a driver circuit and how to power motors safely, and we finish with a servo control example and a list of common mistakes.

What you will learn

  • How DC, servo and stepper motors work, and the strengths of each.
  • A comparison table to help you choose the right motor for your project.
  • Why you never connect a motor directly to the Arduino, and what a driver circuit is.
  • Powering motors safely, and a practical servo control example.

How do you choose? Three questions

Before you buy a motor, answer three questions: do I need continuous rotation, like wheels, or a specific angle, like an arm or a gate? How much precision do I need? And how much force must the motor handle? The answers usually point clearly to one type.

1Kind of motionContinuous rotationor a set angle?2PrecisionDo you need an exact,repeatable position?3ForceWhat load will themotor move?4PowerWhat voltage andcurrent does it need?5DriverChoose the rightcircuit for the typeand current1Kind of motionContinuous rotation or a set angle?2PrecisionDo you need an exact, repeatableposition?3ForceWhat load will the motor move?4PowerWhat voltage and current does itneed?5DriverChoose the right circuit for the typeand current
How to choose the motor for your project

1. The DC motor

The simplest and most widespread type, found in small electric cars, fans and toys. When current flows through it, it spins continuously. Reverse the direction of the current and the direction of rotation reverses. The higher the voltage, the faster it spins, within its permitted limits.

  • Controlling speed: we use PWM, which switches the power on and off very rapidly; the proportion of on-time sets the average voltage and so the speed. On the Arduino we use analogWrite on a PWM-capable pin.
  • Controlling direction: we need a circuit called an H-bridge, which can reverse the current through the motor. Common modules in education include the L298N and L293D, along with newer, more efficient modules.
  • Geared motors: a bare DC motor is very fast and weak in torque, so in robots it is usually used with a gearbox that lowers the speed and raises the force – like the yellow geared motors common in educational robot chassis.

Good for: robot wheels, fans and conveyor belts.

2. The servo motor

A servo is a small motor with a gearbox, a control circuit and a position sensor, all in one case. You do not tell it “spin”; you tell it “go to 90 degrees”, and it goes there and holds, resisting attempts to move it away. Most educational servos move through a range of about 180 degrees.

It is controlled with electrical pulses whose width sets the desired angle, and the good news is that the Servo library built into the Arduino environment handles that for you, so you simply write the angle you want. It has three wires: power, ground and signal.

Good for: robot arms, steering, sweeping a distance sensor left and right, and small gates and locks. There are also “continuous rotation” servos used as wheels, but they lose the advantage of precise angle control.

The following video from The Engineering Mindset explains how servo motors work inside, with clear animations:

Video: “Servo Motors, how do they work?” – The Engineering Mindset on YouTube (in English).

3. The stepper motor

A stepper motor moves in fixed-size steps. Many common steppers complete a full turn in 200 steps – 1.8 degrees per step. When you send it a set number of pulses, it moves that exact number of steps, with no sensor needed to tell you its position, as long as the load is within its capacity. That is why you find them in 3D printers, cutting machines and scanners.

It needs a dedicated stepper driver circuit, and it draws current even when standing still in order to hold its position, so it runs hotter than the other types. One drawback is that if the load is too heavy or the speed too high, it may “lose steps” without the program knowing.

Good for: precise, repeated movement, printers, turntables and small telescopes.

A comparison table

Criterion DC Servo Stepper
Kind of motion Continuous rotation A set angle, usually in a limited range Precise steps within continuous rotation
Position control Does not know its position without an extra sensor Controls its angle internally Precise, by counting steps
Speed High, controlled with PWM Medium Low to medium
Driver circuit An H-bridge Usually no separate circuit, but needs enough power A dedicated stepper driver
Ease for beginners Easy Easiest Moderate
Typical use Robot wheels An arm or steering A 3D printer

Why not connect a motor directly to the Arduino?

An Arduino pin is designed to send a weak signal, not to drive a heavy load, and it can supply only a very small current compared with what a motor draws – especially at the moment it starts or when it stalls under a heavy load. Connecting a motor directly can damage the pin or the whole board. On top of that, a motor generates a reverse voltage when it stops, which can harm sensitive circuits. A driver circuit solves both problems: it takes the weak signal from the Arduino and uses it to control a large current from a separate power source, and most ready-made modules include protection against reverse voltage.

Powering motors safely

  • A separate supply for the motors: power the motors from batteries or a suitable adapter, not from the Arduino’s 5-volt pin. That prevents the board suddenly resetting when a motor draws a large current.
  • A common ground: connect the motor supply’s ground (GND) to the Arduino’s ground, or the signals will not be understood correctly.
  • Check the numbers: read the motor’s rated voltage and maximum current, and choose a driver rated above it.
  • Servos: one small servo may run from the Arduino in a light test, but several servos, or a large one, need a separate supply.

An example: controlling a servo

#include <Servo.h>

Servo arm;

void setup() {
  arm.attach(9);          // signal wire on pin 9
}

void loop() {
  arm.write(0);           // go to 0 degrees
  delay(1000);
  arm.write(90);          // the middle
  delay(1000);
  arm.write(180);         // the other end
  delay(1000);
}

What happens in this code?

The first line includes the Servo library. Then we create an object called arm that represents the motor, and in setup we attach it to pin 9, where we connected the signal wire. In loop we ask it to go to three angles in turn, waiting a second between each move so the motor can reach its position.

Develop the example: an arm you control by hand

Next, try making the servo’s angle follow a knob (a potentiometer): read its value with analogRead, convert the range from 0–1023 to 0–180 with the map function, then send the result to the servo. You have built an “arm” you control with your hand.

Common mistakes

  • Powering motors from the board, so the board resets whenever a motor starts.
  • Forgetting to connect a common ground between two supplies.
  • Choosing a low-torque motor for a heavy robot, so it moves slowly or not at all.
  • Forcing a servo to an angle beyond its mechanical range, so it buzzes and heats up.

Motors are the step that turns your project from a circuit on the table into a robot that moves. To make it move intelligently, combine them with sensors, and make sure you understand circuit basics before handling larger currents. In the robotics and embedded systems course at Badr Academy Education we build complete moving robots under the instructor’s supervision. For further resources visit the learning library, and try the Find your path tool.

The takeaway

DC motors are for continuous rotation and speed, servos for set angles, and steppers for precise, repeated movement. Never connect a motor directly to the Arduino: use a driver circuit, a separate power supply and a common ground, and choose the motor by the kind of motion, precision and force your project needs.

© 2026 Badr Academy Education – this content is exclusive to Badr Academy Education. Short quotations are welcome with the source and a link to this page.

Share this article

Comments (0)

You can comment without an account; your comment appears after review, and the academy may edit it before publishing.

Add a comment

Your e-mail will not be published. Required fields are marked *

No comments yet – be the first to join in.