Javatpoint Logo
Javatpoint Logo

Arduino Stepper motor

The stepper motor does not require any feedback for its operation. It can be controlled with high accuracy due to its design.

The series of magnets mounted on the shaft of the stepper motor are controlled by the electromagnetic coils. These coils are negatively and positively charged in a sequence, which makes the shaft to move in forward and backward in little steps.

We can also hold the position of the motor at any step during rotation. It has a simple, accurate open-loop system.

The Stepper is categorized into two types, which are listed below:

  • Unipolar
  • Bipolar

Each type possesses a different circuit, but the coding is similar.


The Unipolar stepper motor consists of one winding that operates with a center tap per phase. There are three leads per phase in the motor. For the regular two-phase stepper motor, there are six leads per phase.

The Unipolar stepper motor has five leads when both the phases are joined internally.


The bipolar stepper motor consists of a single winding per phase. There are two leads per phase in the motor.

The bipolar stepper motors do not have any center tape connections. Such devices are used when we require high torque popularly at low speeds.

How Stepper motor works?

The stepper motor can control the angular position of the rotor without a closed feedback loop.

For example,

Consider a motor with six stator teeth and a rotor. It is shown below:

Arduino Stepper motor

A stepper motor with six stator teeth can be triggered with three different DC power sources. The rotor in the stepper motor is made up of a stack of steel laminations. It has different teeth compared to the rotor, which is four.

It is done so that one pair of rotor teeth at a time can be aligned easily with the stator.

If we trigger or energize the coil A and B, the rotor would rotate. The above figure signifies the step size is 30 degrees. We will energize coil B and C. After that, the coil A will energize again. It means that the rotor moves to the position with the least reluctance.

The position of the rotor, when coil A is energized is shown below:

Arduino Stepper motor

The position of the rotor (moves 30 degrees), when coil B is energized is shown below:

Arduino Stepper motor

When both the coils are excited, the position of the rotor (in between) is shown below:

Arduino Stepper motor

The energizing of both the coils change the accuracy of the rotor from 30 degrees to 15 degrees.

The common stepper motor type is the hybrid motor type.

In this project, we will use the hybrid motor type. It looks like the image shown below:

Arduino Stepper motor

Hardware Required

The required components are listed below:

  • 1 x Arduino UNO R3 (We can use any Arduino board)
  • 1 x Breadboard
  • Jump Wires
  • 1 x 10K Ohm Potentiometer
  • 1 x Stepper motor
  • 1 x power supply (according to the stepper)
  • U2004 Darlington Array (For a Unipolar stepper)
  • SN754410ne H-Bridge (for a bipolar stepper)

Connection diagram

We will show the connection using the Simulator so that the connections become clearer and more precise.

We can make the same connection using the hardware devices.

Arduino Stepper motor


Consider the below code:


The steps to establish the above connection are listed below:

  • Connect the negative and positive terminal of the battery to the GND and 5V pin of the Arduino board.
  • One outer pin of the potentiometer is connected to ground (GND), and the other external pin is connected to 5V of the Arduino board.
  • The middle pin of the potentiometer is connected to the analog input pin A1 of the board.
  • Connect the 8 to 11 digital pins of the Arduino board to the U2004 Darlington Array, which is further connected to the motor.
  • Connect other pins of the U2004 Darlington Array to the stepper motor, as shown in the connection diagram.

Youtube For Videos Join Our Youtube Channel: Join Now


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Trending Technologies

B.Tech / MCA