ESP32 NEMA14 Stepper motor won’t turn

As I connect per the breadboard diagram below, the shaft of the stepper motor will only lock in position and won’t turn. My stepper motor would able to only turn in one direction only when pressing EN.

Value measurement obtained:
1.	VMOT : 	12.05V
2.	VDD: 		4.85V
3.	4 of the stepper motor pin: 	12.46V
4.	Step pin of A4988 & Pin18 of ESP32: 0.05~2.65V
5.	Dir pin of A4988 & Pin 19 of ESP32: 0.05~2.65V

Coding:

/*     Simple Stepper Motor Control Exaple Code
 *      
 *  by Dejan Nedelkovski, www.HowToMechatronics.com
 *  
 */
#include <Stepper.h>
// defines pins numbers
const int stepPin = 18; 
const int dirPin = 19; 
 
void setup() {
  // Sets the two pins as Outputs
  pinMode(stepPin,OUTPUT); 
  pinMode(dirPin,OUTPUT);
}
void loop() {
  digitalWrite(dirPin,HIGH); // Enables the motor to move in a particular direction
  // Makes 200 pulses for making one full cycle rotation
  for(int x = 0; x < 100; x++) {
    digitalWrite(stepPin,HIGH); 
    delayMicroseconds(2000); 
    digitalWrite(stepPin,LOW); 
    delayMicroseconds(2000); 
  }
  delay(2000); // One second delay
  
    digitalWrite(dirPin,LOW); //Changes the rotations direction
  // Makes 400 pulses for making two full cycle rotation
  for(int x = 0; x < 100; x++) {
    digitalWrite(stepPin,HIGH);
    delayMicroseconds(2000);
    digitalWrite(stepPin,LOW);
    delayMicroseconds(2000);
  }
  delay(2000);
}

Breadboard diagram:

Stepper motor Spec:

Quick Update
While measuring the voltage at Step pin of A4988 by sticking a probe at the GND of the A4988, my motor miraculously turn as per the coding. I really don’t understand what going on… hope someone could explain thanks.

Zenoxdia:
``Previously it worked using the simple stepper motor code below. My stepper motor connected to the ESP32 capable to turn clockwise and anticlockwise in high speed but for now as I connect per the breadboard diagram below, the shaft of the stepper motor will only lock in position and won’t turn. My stepper motor would able to only turn in one direction only when pressing EN.

I can't make sense of that. You seem to be talking about two separate situations, in one of which the motor worked and in the other, it didn't.

Please describe the two situations separately and clearly so we can understand what is the difference between them. If appropriate post the working and non-working programs and post wiring diagrams for the working and non-working systems.

...R

Robin2:
I can't make sense of that. You seem to be talking about two separate situations, in one of which the motor worked and in the other, it didn't.

Please describe the two situations separately and clearly so we can understand what is the difference between them. If appropriate post the working and non-working programs and post wiring diagrams for the working and non-working systems.

...R

Hi, I had already updated my post for a simpler problem statement. My latest founding is the bolded Quick Update on my first post. Thanks.

"While measuring the voltage at Step pin of A4988 by sticking a probe at the GND of the A4988, my motor miraculously turn as per the coding. I really don't understand what going on... hope someone could explain thanks."

That might indicate a lack of ground issue on the step pin, may it is not being set low when needed.

Zenoxdia:
Hi, I had already updated my post for a simpler problem statement.

For the future, please don't make big changes to earlier posts as it makes subsequent comments irrelevant. Put new material in a new Reply in chronological order. That way someone reading the Thread from top to bottom can make sense of it.

@Zoomkat's comment seems likely to solve the problem.

If not it would still be a big help if you respond to my Reply #1 as the problem must be in the difference between the two situations.

...R

Robin2:
For the future, please don't make big changes to earlier posts as it makes subsequent comments irrelevant. Put new material in a new Reply in chronological order. That way someone reading the Thread from top to bottom can make sense of it.

@Zoomkat's comment seems likely to solve the problem.

If not it would still be a big help if you respond to my Reply #1 as the problem must be in the difference between the two situations.

...R

Alright noted I'll post in that order then.
As for your Reply #1, both situations used the same coding and wiring diagram that I posted.
I had tried to take another measurement for the STEP pin on A4988 which varies around 0~1.05V every second only whereas the DIR pin on A4988 goes around 0~2.66V every second. Is this normal?

zoomkat:
"While measuring the voltage at Step pin of A4988 by sticking a probe at the GND of the A4988, my motor miraculously turn as per the coding. I don't understand what going on... I hope someone could explain thanks."

That might indicate a lack of ground issue on the step pin, may it is not being set low when needed.

But my Step pin would vary in between 0~1.05V every second, doesn't that indicates there are high & low pulse/signal generated from my ESP32?
By the way, I tried to redo the whole situation again but this time nothing happened. My stepper motor shaft just locked in its default position and won't turn. I also noticed that my stepper motor gets very hot quickly to the point it can't be touched.

Does your breadboard have gaps that have to be jumpered like this?

Zenoxdia:
As for your Reply #1, both situations used the same coding and wiring diagram that I posted.

If one worked and the other does not then that is unlikely to be true. Treble check all the connections.

Be VERY CAREFUL never to disconnect the wires between the motor and the stepper driver while the driver is powered up. The driver will be instantly destroyed.

...R