Joseph Taylor

Arduino Stepper Motor Control


I’ve started to learn about stepper motors and how to control them. From researching online I saw that there are many driver boards and libraries available to help drive stepper motors. The stepper motor I was issued is a 28BYJ-48 – 5V stepper motor.

It is a 4 phase unipolar stepper motor. Each colour wire corresponds to a different part of both coils.

There are different ways in which the motor can be controlled:

  • Wave Drive
  • Full Step Drive
  • Half Step Drive

Wave Drive is the simplest of the three. Only one winding has power applied to it at any one time. This mode offers the greatest step angle. The torque produced is less that the other two.

Cycle 1 2 3 4
A 1 0 0 0
B 0 1 0 0
C 0 0 1 0
D 0 0 0 1

In full step drive node, two stator phases are powered at the same time. The rotor experiences the torque from both phases. This method provides better torque than the wave step method.

Cycle 1 2 3 4
A 1 1 0 0
B 0 1 1 0
C 0 0 1 1
D 1 0 0 1

Half step drive is a combination of wave drive and full step drive. In this mode, single phase and dual phase excitations are carried out alternatively. The step angle becomes half of the full step angle, but this mode has the highest torque compared to other modes.

Cycle 1 2 3 4
A 1 0 0 0
B 1 1 0 0
C 0 1 0 0
D 0 1 1 0
E 0 0 1 0
F 0 0 1 1
G 0 0 0 1
H 1 0 0 1

Because the current draw of the stepper motor is greater than what the Arduino can supply, transistors were used to overcome this. Alternatively, a stepper motor driver board could have been used, but for this purpose transistors are fine.

Once I got the circuit functioning, I began adjusting the speed at which I could run the motor, by modifying the sketch. I also experimented with different control methods.

I decided to design my veroboard version to incorporate a speed and direction adjustment, as well as a way to identify and change the control method. This was all tested on a bread board before final implementation on a veroboard.

I found that by reversing the order in that I sent the pulses to the motor, I was able to change the rotation direction.

Below are some pictures of the final veroboard, that achieved me a mark of 100%.



If you have any questions about this project, or any others on my site get in touch!