Hi,
I am trying to run the 12V stepper motor 35BYJ412 but with no success. I am using the driver board ULN2003 supplied with 12V. The program I am using is the one shown below.
The motor vibrates, indicating that it is receiving a signal, but the shaft does not move.
Can you please help?
import stepper, time
from time import sleep
# Initialize the stepper motors
stepper_motor1 = stepper.HalfStepMotor.frompins(4, 5, 6, 7)
stepper_motor1.step_until_angle(30)
sleep(0.5)
stepper_motor1.step_until_angle(335)
sleep(0.5)
stepper_motor1.step_until_angle(0)
Philip
Hi.
Are you using a specific example as a reference?
What board are you using?
Regards,
Sara
Hi Sara,
Thank you very much for your prompt reply.
I am using the driver board that comes with the stepper motor 28BYJ-48 (shown on page 306 of your book “Raspberry Pi Pico/Pico W with MicroPython”).
When I connect this stepper motor (changing the supply voltage to 5V) the stepper motor works fine. However when I change the motor to the 35BYJ412 and change the supply voltage to the driver board to 12V the motor just vibrates without moving the shaft.
Regards,
Philip
What kind of external power supply are you using?
Are you connecting the GNDs together (the Pico GND with the power supply GND)?
Regards,
Sara
HI,
I have a 240V ac to 5V dc step down power supply feeding the Pico and a 5v dc to 12v dc step up converter, which is feeding the stepper motor driver board.
In order to make sure that there is a positive connection between the ground of the power supply (step up converter) and the ground of the Pico I made a link between the -ve terminal of the 12V side of the converter to the ground point on the Pico.
However this made no change. The motor still vibrates when it should be turning.
Regards,
Hi again.
It’s hard to tell what might be wrong without looking at the circuit.
The most probable scenario is that there is something wrong with the circuit when powering the motor driver.
If you can send me a picture of the circuit that would be better. To send a picture, upload it to Google Drive or Dropbox, or Imgur and then share a link to the file.
Regards,
Sara
Just a thought but it sounds like the stepper motor and driver may be overloading the 5V to 12V boost converter.
Thanks,
Walton
Hi Walton,
Thank you for your suggestion, however the voltage booster is rated at 5A. So I do not think that this is the problem.
Hi Sara,
This is the link to the circuit diagram: https://drive.google.com/file/d/1atGs6nC0gdr7vao2d6xPkKrP8ru3yb6U/view?usp=drive_link
Regards,
Hi Sara,
I forgot to add that I changed the program as below to include two types of stepper motors.The 5v motor runs fine while the 12v motor just vibrates.
import stepper, time
from time import sleep
# Initialize the stepper motors
stepper_motor1 = stepper.HalfStepMotor.frompins(2, 3, 4, 5)
stepper_motor2 = stepper.HalfStepMotor.frompins(6, 7, 8, 9)
for i in range (4):
stepper_motor1.step_until_angle(30)
sleep(0.5)
stepper_motor1.step_until_angle(335)
sleep(0.5)
stepper_motor1.step_until_angle(0)
sleep (0.5)
stepper_motor2.step_until_angle(30)
sleep(0.5)
stepper_motor2.step_until_angle(335)
sleep(0.5)
stepper_motor2.step_until_angle(0)
sleep (0.5)
Regards,
Hi Sara,
I solved the problem.
From the way the stepper motor was behaving I suspected that the motor was getting a fluctuating magnetic field rather than a rotating one. I therefore compared the sequence of the wiring of the 12V motor with the sequence of the wiring of the 5V motor and found that they are not in the same sequence. I therefore made an adapter cable between the plug of the motor and the socket on the driver, taking care to arrange the sequence of the wires so that it matches the sequence on the 5V motor when it connects to the socket on the driver board.
The result was that the motor now turns smoothly.
Thank you for assisting me with this problem.
Regards,
Philip