I have an adafruit motor shield and attached the Nema 17 stepmotor. Now the big problem is trying to power it without it overheating. I was originally using a 12v 6a power supply but quickly switched to a 12v 2a and then a 12v 1a. All of them still make the Nema stepper motor very hot.

I'm using the accelstepper and adafruit modules on the arduino to control the stepper motor. I noted that the magnets are all always on in my code which might explain why it gets hot but I need to maintain some form of torque for the system I'm developing.

I will attach code as that might be the problem. Is there a second device I need to attach to the adafruit motor sheild and the nema stepper motor.

#include <AccelStepper.h>
#include <MultiStepper.h>
#include <Wire.h>
#include <Adafruit_MotorShield.h>
#include "utility/Adafruit_MS_PWMServoDriver.h"

int ComControlValue = -1;

/* Define pins for motor and define step motor function */
const int SlowStepPerRev = 400;                              // Define slow speed constant
const int MotorB = 2;
int rpm = 60;                                                // Rotation per minute
int acelspeed = 40;                                          // Acceleration speed
int distrot = 200;
int destinationunknown = 0;                                  // Destination of plate 1

/* Initialize the stepper library on the motor shield */
Adafruit_MotorShield AFMS = Adafruit_MotorShield();
Adafruit_StepperMotor *myMotorB = AFMS.getStepper(SlowStepPerRev, MotorB);

/* you can change these to SINGLE or DOUBLE or INTERLEAVE or MICROSTEP! */
// wrappers for the motor!
void forwardstepB() {  
   myMotorB->onestep(FORWARD, INTERLEAVE);
void backwardstepB() {  
   myMotorB->onestep(BACKWARD, INTERLEAVE);

AccelStepper stepperB(forwardstepB, backwardstepB);

void setup() {
   Serial.begin(115200);                                     // Establish Serial connection to computer
   Wire.begin();                                             // join i2c bus as master
   AFMS.begin();                                             // Begin useage of conveyorbelt motor

   stepperB.setMaxSpeed(rpm);                                // Initialize max speed
   stepperB.setAcceleration(acelspeed);                      // Initialize and set speed of acceleration for spinning

void loop() {
        case -1: //wait
            Serial.println("Waiting for Command");
            while (Serial.available()==0){}
            ComControlValue=Serial.parseInt();               // Pull value from serial port
            break;                                           // break loop & return to start
        /* 1 : Move plates into the system */
        case 1:                                                  
// Arduino using accelmotor, move to position X
        if (plateNum < platelimit){
               ComControlValue= 11;                          // After establishing plate num & location, move to case 11 to start stepmotor movement
               destinationunknown = destinationunknown + 200;
        else { 
               ComControlValue = -1;                         // To many plates, cancel move command

        /* 2 : Move plate out of system */
        case 2:
        // Arduino using accelmotor, move to position Y
        if (plateNum > 0){
               plateNum = plateNum--;
               ComControlValue= 11;                         // After establishing plate num & location, move to case 11 to start stepmotor movement
               destinationunknown = destinationunknown - 200;  
        else {
               ComControlValue = -1; 

        /* 1 : Run Stepmotor to completion */
        case 11:
        // Step motor requires an uninterrupted while loop to move to completion
        // code setup will utilize while loop and allow for movement
        stepperB.run();                                     // run stepmotor
        if (stepperB.distanceToGo() == 0 ){
                ComControlValue = -1;                       // Completed movement, go back to case -1

2 Answers 2


Stepper motors get hot. It's a fact of life. More so when they are held stationary.

A typical 12V Nema 17 stepper motor has a coil resistance of 30Ω per phase. With 12V across a single phase it will consume 0.4A. That is the equivalent of about 4.8W of power. That comes out in the form of heat.

Reducing the current capacity of your power supply will not "fix" the problem. All that will happen is that as you go to lower and lower current supplies the supply will get hotter and eventually break.

You can test the coil resistance of your motors with a DMM set to the Ohms range, then calculate the power dissipation using:

Current = V ÷ R = 12 ÷ <measured resistance>


Power = V² ÷ R = 144 ÷ <measured resistance>
  • Also if you go with decreasing the voltage (instead of reducing the current value), you would have to compromise with a decrease in torque. Jun 21, 2018 at 10:05
  • Sounds like the 12v 1a power supply should be used then and just compromise with the head via heatsinks Jun 21, 2018 at 10:27
  • You have 2 phases. That's a potential peak of 0.8A for just the motors alone. I would derate it and use at least the 2A. You can't have "too many" amps - it only draws what it needs.
    – Majenko
    Jun 21, 2018 at 10:28

I think you will have a better chance reducing the heat by lowering the supply voltage (which will reduce the current as a consequence). You won't get the nominal torque if you go below 12V, but this is a compromise and there's no free cheese there.

Limiting the available current only works in a predictable manner with power supplies which can work as current sources. If your power supply is only a voltage source, then trying to draw more current than it can provide will eventually result in the power supply going into self-protection (not delivering any voltage) or breaking down. With voltage sources, maximum current is a limit you have to respect, not a limit the power supply will impose.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.