#include <Stepper.h>
const int stepsPerRevolution = 200; // change this to fit the number of steps per revolution
// for your motor
// initialize the stepper library on pins 8 through 11:
Stepper myStepper(stepsPerRevolution, 8, 9, 10, 11);
int pulse1=2;
int pulse2=3;
int value1;
int value2;
void setup() {
// set the speed at 60 rpm:
myStepper.setSpeed(300);
pinMode(pulse1,INPUT);
pinMode(pulse2,INPUT);
}
void loop() {
value1= digitalRead(pulse1);
value2= digitalRead(pulse2);
if(value1==HIGH){
myStepper.step(1);
//delay(500);
}else{
if(value2==HIGH){
myStepper.step(-1);
//delay(500);
}else{
myStepper.step(0);
}
}
}
A 0.85 ohm stepper motor will try to draw 12 / 0.85 = 14 Amp from your power supply.
That will fry the L298 and/or the power supply.
As DrDiettrich said, you definitely need a constant current driver, like the DRV8825.
You must set the current on the driver to the 1.2Amp rated current of the motor (or less).
Leo..
It is hard to determine what you did from the pictures, can you post an annotated schematic and include links to technical information on the hardware items.
Instead of getting current regulator DRV8825, would a TB6600 driver work to replace the L298?
The only technical data on the motor I found is this here:
Lugar de origen Japón
Fabricantes (marca)
Modelo 103-594-05XD01
Fases (fase) 2
Número (root) línea 6
Paso ángulo (grados) 0.9
Tensión nominal (V)
Corriente nominal (a) 1.2
Resistencia (ohmios) 0.85
Motor de cilindro Diámetro (mm)
Longitud (mm)
Motor Cuboide Longitud (mm) 42
Ancho (mm) 42
Espesor (mm) 41
Diámetro del eje (mm) 5
Longitud del eje (mm) 18
Peso (g) 360
Otros
Actually running a stepper below its rated current will make it, and its driver, run cooler and last longer. If the motor misses steps and is not powerful enough, the extra 0.2A would probably not make much difference. You would need a more powerful stepper.