I am very new to the world of raspberrypi and I am probably making some beginner mistakes. I am trying to move a NEMA17 motor (stepper motor) using a Raspberry Pi 3B+ and a4988 driver.
First I set the driver voltage to 12v (since Imax = Vref/(8Rs); Vref=1.5A8*0.1 Ohm ; vref=12v).
So, after this adjustment and measuring it with the multimeter I connected the motor to the driver (Red wire to 2A, Blue wire to 2B, Green wire to 1A, Black to 1B).
I also connected the voltage of 5V (pins 4 y 6) and 12 v after transform it.
Additionally I connected MS1, MS2 and MS3 of the driver with pins 8, 10 and 12 of the Raspberry Pi . Finally I connected pins 38 and 40 of the Raspberry Pi to the step and dir pins respectively.
Something like this:
The code I used is from this page (https://www.iotdesignpro.com/projects/raspberry-pi-stepper-motor-control-through-a-webpage-using-flask) I paste the link to the page as I don't want to overwhelm the reader writting here all the code.
After switching on the transformer the driver gets very hot and the motor makes noises but does not run. I followed all the instructions on the page copied above. What am I doing wrong?
Any contribution will be welcome. Thank you in advance.
I paste photos of the connection: