Control Nema Stepper Motor With Arduino and Micro Stepping Drive





Introduction: Control Nema Stepper Motor With Arduino and Micro Stepping Drive

About: We are group of makers who love and create different products related to hobby electronics, automation and OEM consumer and industrial products.

Lots of People want to build Them own small Cnc machine . they started with drives stepper motor but they stacked in controller Programming . In this instructable Robokits will provide Resource to control your Stepper motor with Arduino . before Programming we have to learn some basics Related to Stepper motor .

What is stepper motor ?

A stepper motor is a brushless, synchronous electric motor that converts digital pulses into mechanical shaft rotations. Each rotation of a stepper motor is divided into a set number of steps, sometimes as many as 200 steps. The stepper motor must be sent a separate pulse for each step. The stepper motor can only receive one pulse and take one step at a time and each step must be the same length. Since each pulse results in the motor rotating a precise angle typically 1.8 degrees you can precisely control the position of the stepper motor without any feedback mechanism.

As the digital pulses from the controller increase in frequency, the stepping movement converts into a continuous rotation with the velocity of the rotation directly proportional to the frequency of the control pulses.

Types of Stepper Motors

There are three kinds of step motors: permanent magnet, hybrid, and variable reluctance. Hyrbrid step motors offer the most versatility and combine the best characteristics of variable reluctance and permanent magnet stepper motors. Hybrid stepper motors are constructed with multi-toothed stator poles and a permanent magnet rotor. A standard hybrid stepper motor has 200 rotor teeth and rotates 1.8 degrees per step.

Half Step means that the stepping motor is rotating at 400 steps per revolution (0.9 degree steps x 400 = 360 degrees). First one winding is energized and then two windings are alternately energized. This will cause the rotor of the stepping motor to move at half the distance (0.9 degrees). In half-step mode, a typical stepper motor provides about 30% less torque, but it provides a smoother motion than it would in full-step mode.


Microstepping energizes the stepper motor winding in a manner that further subdivides the number of positions between poles. Some microstepping controllers are capable of dividing a full step (1.8 deg) into 256 microsteps. This would result in 51,200 steps in one revolution (.007 deg/step). Microstepping is usually applied to applications that require accurate positioning and smoother motion over a broad range of speeds. As in the half-step mode, microstepping reduces torque by about 30% compared to full-step mode.

Step 1: Control 4.2 Kgcm,4.4 Kgcm,10 Kgcm Motor With Arduino and Micro Stepping Drive

Step 2: Connection Diagram

Step 3: Simple Arduino Program to Give Step and Direction Signal

#define Pulse 9

#define Dir 8

long delay_Micros =1800; // Set value

long currentMicros = 0; long previousMicros = 0;

void setup()






void loop()


currentMicros = micros();

if(currentMicros - previousMicros >= delay_Micros)


previousMicros = currentMicros;


delayMicroseconds(500); //Set Value


} }

Step 4: Universal Program to Control All Nema Stepper Motor With Arduino and Rmcs Driver

Step 5: Working Video

Step 6: Download Complete Arduino Sample Code Zip File for Our Stepper Motor Drivers



    • Oil Contest

      Oil Contest
    • Water Contest

      Water Contest
    • Creative Misuse Contest

      Creative Misuse Contest

    11 Discussions


    Question 2 months ago

    How can I get it to run forward and backwards, alternating?

    Greetings. Great instructible! I am using the same setup minus the potentiometer. I am using a capacitive touch sensor to trigger the stepper to do a quarter turn per touch. The issues I am having is that the motor is jerky and not smooth (like in your video), also, it seems to want to ramp up and ramp down. Any suggestions as to what might be happening? Thanks.


    7 months ago

    Hi, II used a NEMA23 and a microstep driver ST-5045 and used your upload code for arduino uno board, and did the same wiring as you showed. when I ran i used option a for 200 steps/rev, key 90 between 30 and 100, and choose 1000 steps, but there was nothing happening. What should I do?



    I have RMCS 1102. In circuit, D13 is connected to EN+ But code does refer this, For a GRBL Setup, this may be required to get it working. So, should it be connected or not for GRBL setup in Arduino ?


    11 months ago

    Hi, for the same setup above i had written a labview program. But the motor is running very slowly. So can you help send me any labview program for this?

    Good day. I want to ask how to configure this nema 23 stepper motor with leadshine DM556 driver to microstepping. Thank you

    how i can add CNC shield V3 in same circuit ??? i have RMCS driver dont want to use other drivers..

    I am planning to buy following :

    But could not find how drives are connected to power supply. Can I just connect -V of each power supply terminal to GND of each driver ? Anything else to be taken into account ?

    Also should I adjust the output voltage of power supply. As I understand, input range for driver is 15-50v so 24v output of power supply need not be adjusted. Please correct me if I am wrong

    1 reply

    Great instructable! I actually didn't know what a stepper motor was until I started researching to put towards a project I intend working on. THANK YOU!! I will keep you informed of the progress!

    1 reply

    Hello you are most Welcome we are happy to help you in your specific query .