this is my second Arduino project and I am trying to figure out why my stepper motor is not moving. I was able to get a basic 28byj-48 stepper motor to work using stepper.h and some sample code.
Now I am trying a new setup and not getting any turning action. I do see power to the Arduino stepper motor and power supply and can hear the motor buzzing its just not turning when uploading the Arduino code:
#define STEP_PIN 9
#define DIR_PIN 8
void setup() {
pinMode(STEP_PIN, OUTPUT);
pinMode(DIR_PIN, OUTPUT);
digitalWrite(DIR_PIN, HIGH); // or LOW to change direction
}
void loop() {
for (int i = 0; i < 8000; i++) {
digitalWrite(STEP_PIN, HIGH);
delayMicroseconds(100);
digitalWrite(STEP_PIN, LOW);
delayMicroseconds(100);
}
}
Setup :
Power : 24V 10A 240W AC/DC Power Adapter
Motor : STEPPERONLINE Nema 17 Stepper Motor Bipolar 2A
Stepper Driver: STEPPERONLINE CNC Stepper Motor Driver 1.0-4.2A 20-50VDC 1/128 Micro-Step Resolutions for Nema 17 and 23 Stepper Motor
Pin Config :
Stepper Motor
| Driver Terminal | Wire Color from Motor |
|---|---|
| A+ | Black |
| A− | Green |
| B+ | Red |
| B− | Blue |
Power Supply is wired to +vdc and GRND
Arduino is wired
- pin 8 to DIR +
- pin 9 to PUL +
For DIR - and PUL - Both are plugged into this breadboard and there is a pin from there into the Arduinos GRND.
Where should I look next for potential issues on why the motor isn't rotating ?