Stop stepper motor from heating when idel

Hello there,

i am using a simple code to allow a stepper motor to rotate a display for 180 degree cw when button (1) is pressed and rotate 180 degree ccw when button (2) is pressed. i have noticed the motor gets supper hot and it caused the gears to bend of heat. I need to be able to stop the current from the motor when Idle. (note, that I don't mind allowing the motor to rotate manually when idle)

i am using the following:
-Arduino uno R3
-L298N motor driver
-50byj46-6 stepper motor
-IR remote
-IR reciever
-15 V power source

  • step down converter to power the Arduino

this is the code i am using,

// 1=180 CW
// 2=180 CCW

#include "Stepper.h"
#include "IRremote.h"

/----- Variables, Pins -----/
#define STEPS 32 // Number of steps per revolution of Internal shaft
int Steps2Take; // 2048 = 1 Revolution
int receiver = 6; // Signal Pin of IR receiver to Arduino Digital Pin 6

/-----( Declare objects )-----/
// Setup of proper sequencing for Motor Driver Pins
// In1, In2, In3, In4 in the sequence 1-3-2-4

Stepper small_stepper(STEPS, 8, 10, 9, 11);
IRrecv irrecv(receiver); // create instance of 'irrecv'
decode_results results; // create instance of 'decode_results'

void setup()
{
irrecv.enableIRIn(); // Start the receiver
}

void loop()
{
if (irrecv.decode(&results)) // have we received an IR signal?

{
switch(results.value)

{

  case 16724175: //   >> button pressed
                  small_stepper.setSpeed(500); //Max seems to be 700
                  Steps2Take  =  3180;  // Rotate CW
                  small_stepper.step(Steps2Take);
                  //delay(200); 
                  break;

  case 16718055: //   << button pressed
                  small_stepper.setSpeed(500);
                  Steps2Take  =  -3180;  // Rotate CCW
                  small_stepper.step(Steps2Take);
                  //delay(200); 
                  break;

}

  irrecv.resume(); // receive the next value

}

}/* --end main loop -- */

The most likely reason is that there is too much current flowing through the stepper coils.
Can You post a link to the datasheet of the stepper, schematics showing how the project is powered?

Please post schematics! I have an idea how to cut off power when the stepper has finished the move.

A LOW to the enable pins on the driver disables the output drivers. See the data sheet.

If you disable the driver outputs the motor will may not hold its position if acted upon be an outside force.

What version of the IRremote library do you have installed? The code that you posted is written for the older version (<3.0). See the IRremote GitHub page to see how to fix older code to work with the new version.

Read the forum guidelines to see how to properly post code and information on how to get the most from this forum.
Use the IDE autoformat tool (ctrl-t or Tools, Auto format) before posting code in code tags.

I actually Googled up the datasheet. It's a geared stepper.....

OK, I will amend my statement to "may not hold position".

Googling for data that should have been supplied or by a link, ..... I don't do it for every question either......