How to solve the problem of Step Motor overheating using Stepper library

Recently I discover that the included Stepper Motor library do not have an option to stop the motor without energizing the coils. Wen it stops after doing de steps or setting the speed to zero it always keep some of the coils energized. This could overheat the motor and controller.

To solve this simply set the pins outputs of you motor to LOW.

Example:

digitalWrite(motor_pin_1, LOW);
digitalWrite(motor_pin_2, LOW);
digitalWrite(motor_pin_3, LOW);
digitalWrite(motor_pin_4, LOW);

Or you can alter your libary and include a "stop" function like this:

In the file Stepper.h on "public:"

void stop(void);

In file Stepper.cpp just at the end:

void Stepper::stop(void)
{
	if (this->pin_count == 2) {
		digitalWrite(motor_pin_1, LOW);
                digitalWrite(motor_pin_2, LOW);
		 }
		 
	if (this->pin_count == 4) {	 
	       digitalWrite(motor_pin_1, LOW);
               digitalWrite(motor_pin_2, LOW);
               digitalWrite(motor_pin_3, LOW);
	       digitalWrite(motor_pin_4, LOW);
	       }
	 	
}

Of course if you want the motor to keep its position or to break you will not use this.

I hope I helped someone.

Stepper motors normally run hot (uncomfortable to touch with a finger) and they need to have their full current when stationary if they are to hold their position.

...R
Stepper Motor Basics

Proper stepper drivers reduce current on idle, so they still hold position, but
reducing power consumption by a large facter. It you de-energize the coils
completely you are likely to lose step-registration.

If you want to stop the stepper and not waste a lot of power, you need a modern chopper-driver for your motor. Like this: http://www.ebay.com/itm/261238770983

// Per.