Introduction: Interfacing Stepper Motor With Arduino Uno
The project is about how to interface Stepper Motor with Arduino Uno.
Stepper Motor ((28-BYJ48))
ULN2003 stepper motor driver module
Step 1: About Project
Stepper Motor (28-BYJ48) :
Not like a normal DC motor, this one has five wires of all superior colors coming out of it. Steppers motors do not rotate, they step and so they also understood as step motors. Which means, they will move only one step at a time. These motors have an order of coils present in them and these coils need to be energized in a specific pattern to make the motor rotate.
When each coil is being energized the motor takes a step and a sequence of energization will make the motor take constant steps, thus making it rotate, as shown below.
We know that this is a four-phase stepper motor after it had four coils in it. Now, the gear ratio is presented to be 1:64. This means the shaft that you notice outside will make one absolute rotation only if the motor inside rotates for 64 times. This is due to the gears that are connected in between the motor and output shaft, these gears serve in improving the torque.
Another important parameter is Stride Angle: 5.625°/64. This means that the motor when operates in an 8-step sequence will move 5.625 degrees for each step and it will take 64 steps (5.625*64=360) to finish one complete rotation.
Calculating the Steps per Revolution:
In Arduino, we will be exploring the motor in a 4-step sequence so the trail angle will be 11.25° since it is 5.625° for 8 step sequence it will be 11.25° (5.625*2=11.25). Steps per revolution = 360/step angle Here, 360/11.25 = 32 steps per revolution. Why we need Driver modules for Stepper motors? Most stepper motors will explore only with the guidance of a driver module.
This is because the controller module will not be capable to give sufficient current from its I/O pins for the motor to work. So we will use an outside module like the ULN2003 module as a stepper motor driver. There are various types of a driver module and the rating of one will change depends upon the type of motor used.
Step 2: Run a Program
// Arduino stepper motor control code
#include // Include the header file
// change this to the number of steps on your motor
#define STEPS 32
// create an instance of the stepper class using the steps and pins Stepper stepper(STEPS, 8, 10, 9, 11);
int val = 0;
val = Serial.parseInt();
Serial.println(val); //for debugging