Nema 17: all about the Arduino compatible stepper motor

Nema 17

We have already analyzed everything about stepper motors that you can use with your Arduino projects, but there is one of those motors that stands out from the rest of the models, such as the Nema 17, since it is a very precise motor with several applications, including those of replacing the damaged motor of some printers 3D.

With this stepper motor you will be able to control very precisely the rotation of its axis to make precision movements and thus control the movement of your machine or robot. And in this guide you can get all the information you need to get to know him up close and start working with him.

Technical characteristics of the Nema 17

Stepper motor Nema 17 is bipolar type, with a step angle of 1,8º, that is to say, it can divide each one of the revolutions or turns into 200 steps. Each winding that it has inside supports 1.2A of intensity at 4v of tension, with which it is capable of developing a considerable force of 3.2 kg / cm.

Also, this engine Nema 17 is robustThis is why it is used in applications such as home 3D printers and other robots that need to have considerable consistency. An example of printers that use this engine as the basis of their movements is the Prusa. It is also used in laser cutters, CNC machines, pick & place machines, etc.

However, not all are wonders and advantages in this engine, since it is More powerful that reliable, therefore, is not so balanced in this sense ...

In short, technical characteristics are:

  • Stepper motor.
  • NEMA 17 model
  • Weight 350 grams
  • Size 42.3x48mm without shaft
  • Shaft diameter 5mm D
  • Shaft length 25mm
  • 200 steps per turn (1,8º / step)
  • Current 1.2A per winding
  • Supply voltage 4v
  • Resistance 3.3 Ohm per coil
  • 3.2 kg / cm motor torque
  • Inductance 2.8 mH per coil

Pinout and datasheet

Nema 17 pinout

El pinout of these stepper motors It is quite simple, since they do not have too many cables for the connection, they also have a connector so that you can do them more easily. In the case of NEMA 17 you will find a pinout like the one you can see in the image above.

But if you need to know more technical and electrical details of the limits and ranges in which the NEMA 17 can work, you can search for a datasheet of this stepper motor and thus obtain all the complementary information you are looking for. Here you can download a PDF with an example.

Where to buy and price

You can find at a low price in various specialized electronics stores and also in online stores. For example, you have it available on Amazon. There are them from different manufacturers and in different sales formats, such as in packs of 3 or more units if you need several for a mobile robot, etc. Here are some great deals:

Example of how to get started with the Nema 17 and Arduino

Nema 17 and Arduino stepper motor schematic

A simple example to start using this stepper motor NEMA 17 With Arduino it is this simple schematic that you can assemble. I have used a driver for DRV8825 motors, but you can use a different one and even a different stepper motor if you want to vary the project and adapt it to your needs. The same happens with the sketch code, which you can modify to your liking ...

In the case of the driver used, it supports 45v and 2A intensity, so it is ideal for stepper motors or steppers of small and medium size such as the NEMA 17 bipolar. But if you need something "heavier", a bigger motor like the NEMA 23, then you can use the TB6600 driver.

Remember that you can also use the library AccelStepper for better handling. A library written by Mike McCauley that is very practical for your projects, with support for acceleration and deceleration, a great advantage for a multitude of functions.

Companies that connections summarized are the following:

  • The NEMA 17 motor has its GND and VMOT connections to the power supply. Which in the image appears with a component with a drawn ray and a capacitor. The source must have between 8 and 45v supply, and the added capacitor that I have added could be 100µF.
  • The two coils of the stepper are connected to A1, A2, and B1, B2 respectively.
  • The diver's GND pin is connected to the Arduino's GND.
  • The VDD pin of the driver is connected to 5v of the Arduino.
  • STP and DIR for step and direction are connected to digital pins 3 and 2 respectively. If you want to choose other Arduino pins you can, you just have to modify the code accordingly.
  • RST and SLP to reset and sleep of the driver you must connect them to 5v of the Arduino board.
  • EN or activation pin may be disconnected, since in this way the driver will be active. If it is set to HIGH instead of LOW the driver is disabled.
  • Other pins will be disconnected ...

As to sketch codeIt can be as simple as this to get NEMA 17 working and get started, pun intended ...

#define dirPin 2
#define stepPin 3
#define stepsPerRevolution 200
void setup() {
  // Declare pins as output:
  pinMode(stepPin, OUTPUT);
  pinMode(dirPin, OUTPUT);
}
void loop() {
  // Set the spinning direction clockwise:
  digitalWrite(dirPin, HIGH);
  // Spin the stepper motor 1 revolution slowly:
  for (int i = 0; i < stepsPerRevolution; i++) {
    // These four lines result in 1 step:
    digitalWrite(stepPin, HIGH);
    delayMicroseconds(2000);
    digitalWrite(stepPin, LOW);
    delayMicroseconds(2000);
  }
  delay(1000);
  // Set the spinning direction counterclockwise:
  digitalWrite(dirPin, LOW);
  // Spin the stepper motor 1 revolution quickly:
  for (int i = 0; i < stepsPerRevolution; i++) {
    // These four lines result in 1 step:
    digitalWrite(stepPin, HIGH);
    delayMicroseconds(1000);
    digitalWrite(stepPin, LOW);
    delayMicroseconds(1000);
  }
  delay(1000);
  // Set the spinning direction clockwise:
  digitalWrite(dirPin, HIGH);
  // Spin the stepper motor 5 revolutions fast:
  for (int i = 0; i < 5 * stepsPerRevolution; i++) {
    // These four lines result in 1 step:
    digitalWrite(stepPin, HIGH);
    delayMicroseconds(500);
    digitalWrite(stepPin, LOW);
    delayMicroseconds(500);
  }
  delay(1000);
  // Set the spinning direction counterclockwise:
  digitalWrite(dirPin, LOW);
  //Spin the stepper motor 5 revolutions fast:
  for (int i = 0; i < 5 * stepsPerRevolution; i++) {
    // These four lines result in 1 step:
    digitalWrite(stepPin, HIGH);
    delayMicroseconds(500);
    digitalWrite(stepPin, LOW);
    delayMicroseconds(500);
  }
  delay(1000);
}

More info, you can consult the programming course with Arduino IDE by Hwlibre.


The content of the article adheres to our principles of editorial ethics. To report an error click here!.

Be the first to comment

Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.