0

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 ?

Edgar Bonet
45.1k4 gold badges42 silver badges81 bronze badges
asked May 20 at 17:49
3
  • Would you mind to edit your question to add the working minimal sample code, please? Commented May 21 at 7:48
  • 1
    As there is no standard on what colors the motor wires should have, try swapping them around a bit and see, if that changes something. Commented May 21 at 13:21
  • you should find with a multimeter what wires on the motor are connected to same coil (one coil should go to A, another to B). Second, check switches on the driver that they have correct microstepping and current. Try reducing microstepping and increasing current. Third, the driver seems to also have ENA pins, maybe you need to wire them to power or ground also (look into datasheet). Commented May 22 at 13:51

1 Answer 1

2

If your stepper motor is just buzzing but not rotating, you can checkout following things:

Wiring – Double-check motor coil connections (A+/A− and B+/B−). Incorrect coil pairing will prevent rotation.

Step pulse timing – Try increasing delayMicroseconds(100) to 500 or more. Some drivers need slower step pulses to respond.

Enable pin – Some drivers require an EN (Enable) pin to be set LOW to activate the motor. Make sure it's either grounded or properly configured.

Power supply – You're using a 24V supply, which is good, but ensure your driver current setting matches the motor’s rated 2A.

Driver overheating/protection – Check if the driver is entering thermal or overcurrent protection.

If you want to know how to control 28BYJ-48 Stepper Motor checkout my article: 👉 How to Control 28BYJ-48 Stepper Motor with ULN2003 Driver and Arduino

Hope this helps!

Juraj
18.3k4 gold badges31 silver badges49 bronze badges
answered May 29 at 15:15

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.