I have a stepper motor and a stepper driver. I am trying to get them to work. I have been trying this for the last 2 weeks. I have gotten different motors, drivers, microcontrollers nothing seems to work. The amazon links to them are in a google dock Arduino stuff - Google Docs
The code that I am using is.
/* Stepper Motor Control */
#include <Stepper.h>
const int stepsPerRevolution = 90;
// 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);
void setup() {
// set the speed at 60 rpm:
myStepper.setSpeed(5);
// initialize the serial port:
Serial.begin(9600);
}
void loop() {
// step one revolution in one direction:
Serial.println("clockwise");
myStepper.step(stepsPerRevolution);
delay(500);
// step one revolution in the other direction:
Serial.println("counterclockwise");
myStepper.step(-stepsPerRevolution);
delay(500);
}
The photos and amazon links are in this google docs. I am new user so wouldn't let me upload more than 1. Arduino stuff - Google Docs
When I run the code nothing happens. I have other stepper motors and driver. Wich are different and the same thing happens, nothing. The motor isn't vibrating. I have also tried this with a smaller stepper motor 3.3v and plugged the voltage into the Arduino but still doesn't work. I don't know what is wrong. Any help would be very appreciated. If you ned any more information I am happy to provide it.
Post an annotated schematic as to how you have it wired, include all connections, power, ground, and power sources. Frizzy pictures are useless they do not contain the needed information. They are wiring pictures not schematics. Also post links to TECHNICAL information on the hardware parts (motors drivers etc). Links to Amazon and other market places are useless as they do not have the needed information. This is possibly you are having problems you do not have enough information either. Fyi in the time it takes me to guess what you have and get close I could have helped at least ten other users. Merry Christmas!
I can tell you right off the bat that that that L298 driver is not an appropriate driver for the stepper that you have. The ancient L298 is a crappy DC motor driver and even worse stepper driver. That stepper needs a current control stepper driver like a DRV8825 (good for 2A with a heat sink and fan), a TB6600 or equivalent. Pololu offers a good line of modern stepper drivers.
The Stepper library is not used for step/dir type drivers like the stepper requires. Use the AccelStepper, MobaTools or any library written for the step/dir drivers.
The pictures show a crappy DC motor driver, which is not a stepper motor driver.
It won't work with modern low-impedance stepper motors.
Question is; which stepper motor do you have (exact numbers please).
Leo..
Edit: Just saw it in the link. A 1.4ohm/2A stepper.
The L298 driver you are trying to use is totally unsuitable for this motor.
You need a current controlled stepper driver that can comfortably handle 2Amp.
With a 12volt supply, or 24volt if you want torgue at higher speeds.
A TB6600 driver would be good.
With proper stepper code (AccelStepper etc).
/* Stepper Motor Control */
#include <Stepper.h>
const int stepsPerRevolution = 90;
// 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);
void setup() {
// set the speed at 60 rpm:
myStepper.setSpeed(5);
// initialize the serial port:
Serial.begin(9600);
}
void loop() {
// step one revolution in one direction:
Serial.println("clockwise");
myStepper.step(stepsPerRevolution);
delay(500);
// step one revolution in the other direction:
Serial.println("counterclockwise");
myStepper.step(-stepsPerRevolution);
delay(500);
}