Need help! Stepper motors

Thread Starter

royashley99

Joined Nov 20, 2021
47
When I use a 28BYJ-48 with a Uln2003 and I upload the example knob code, the stepper motor doesn't move when I turn the potentiometer, how could I fix this.

I'm running the stepper at +5v(not through arduino)
 

MrChips

Joined Oct 2, 2009
30,706
This is question about how to debug a microcontroller application regardless of complexity.

You have two components:
1) a potentiometer
2) a stepper motor

How would you determine that both are coded and functioning correctly?
You do this by taking baby steps. You need some way to indicate that the code is working the way you programmed it.

Assuming that you have no fancy tools such as an oscilloscope:
1) Write a program that can make an LED flash approximately at 1Hz.

Next step:
2) Write a program that will take a reading from the potentiometer by which you can alter the flash rate of the LED.

Post your code.
 

Thread Starter

royashley99

Joined Nov 20, 2021
47
This is question about how to debug a microcontroller application regardless of complexity.

You have two components:
1) a potentiometer
2) a stepper motor

How would you determine that both are coded and functioning correctly?
You do this by taking baby steps. You need some way to indicate that the code is working the way you programmed it.

Assuming that you have no fancy tools such as an oscilloscope:
1) Write a program that can make an LED flash approximately at 1Hz.

Next step:
2) Write a program that will take a reading from the potentiometer by which you can alter the flash rate of the LED.

Post your code.
I'll try that thanks for the advice.
 

Thread Starter

royashley99

Joined Nov 20, 2021
47
This is question about how to debug a microcontroller application regardless of complexity.

You have two components:
1) a potentiometer
2) a stepper motor

How would you determine that both are coded and functioning correctly?
You do this by taking baby steps. You need some way to indicate that the code is working the way you programmed it.

Assuming that you have no fancy tools such as an oscilloscope:
1) Write a program that can make an LED flash approximately at 1Hz.

Next step:
2) Write a program that will take a reading from the potentiometer by which you can alter the flash rate of the LED.

Post your code.
I have another issue, when every i try move anything with the 28BYj-48 and uln2003 driver board, the stepper motor just stops turning and starts vibrating even after i remove the weight, i have to physically turn it to get it started again, how can i fix this?
 

MrChips

Joined Oct 2, 2009
30,706
I have another issue, when every i try move anything with the 28BYj-48 and uln2003 driver board, the stepper motor just stops turning and starts vibrating even after i remove the weight, i have to physically turn it to get it started again, how can i fix this?
You have jumped ahead on me.

Did you get the flashing LED program working?
Are you able to control the rate of LED flashes with the potentiometer?

Step #3
Can you write a program to make the stepper motor step at a very low rate such as 1 step per second?
 

djsfantasi

Joined Apr 11, 2010
9,156
I have the stepper motor connected like this: View attachment 265683
What is the current draw of the stepper motor coil? And what is that small circuit board? The Arduino alone cannot provide enough current to drive a motor. So you need drivers for each coil, possibly as simple as a transistor.

An Arduino pin can only provide 40mA at maximum. Preferably, your circuit should limit the current draw to 20mA. And depending on the wiring, the Arduino can only provide a maximum of 200mA in total (specialized wiring might increase that amount, but normally the 200 mA total is the limiting factor).

These limits apply per pin even when you have a separate power supply, if the pin is required to sink more than 20mA
 

DNA Robotics

Joined Jun 13, 2014
647
I have another issue, when every i try move anything with the 28BYj-48 and uln2003 driver board, the stepper motor just stops turning and starts vibrating even after i remove the weight, i have to physically turn it to get it started again, how can i fix this?
Assuming you have the motor wired right, you are probably sending steps faster than the motor can start turning. Try one step at a time, then speed it up gradually.
 

shortbus

Joined Sep 30, 2009
10,045
Assuming you have the motor wired right, you are probably sending steps faster than the motor can start turning. Try one step at a time, then speed it up gradually.
That is likely the problem. The motor is a low step type, 64 steps per revolution, unlike most that have 200 steps per revolution. I think the low step count is so students learning about steppers can see the individual steps being taken. https://components101.com/motors/28byj-48-stepper-motor
 

Thread Starter

royashley99

Joined Nov 20, 2021
47
You have jumped ahead on me.

Did you get the flashing LED program working?
Are you able to control the rate of LED flashes with the potentiometer?

Step #3
Can you write a program to make the stepper motor step at a very low rate such as 1 step per second?
I found the problem, I wrote some of the code incorrectly, it all works now.
I have another question, can the AccelStepper library support more than 1 stepper motor?
 
Top