28BJY-48 Motor Control Questions

Hi,

Arduino newbie here. I am currently working on a watch winder project and I have noticed that my 28BJY-48 motor has become hot. After doing some research, i understand it is because that power needs to be constantly send to the motor to hold its position. My first question is

  • is there a way to set a timer to de-power the motor?

I have almost 0.5 to 0.6 kg of weight attaching to the motor and rotating. However, after awhile, it starts to have grinding sound. But when I unplug the power and cool it down for an hour, it starts to have the smooth sound after plugging the power back in. My second question is

  • Is there any way i can constantly running the motor without worrying about grinding sound?

here is the code i am using:

//Include the Arduino Stepper Library
#include <Stepper.h>

// Number of steps per internal motor revolution
const float STEPS_PER_REV = 32;

// Number of Steps Required
int StepsRequired;

// The pins used are 8,9,10,11
// Connected to ULN2003 Motor Driver In1, In2, In3, In4
// Pins entered in sequence 1-3-2-4 for proper step sequencing

Stepper steppermotor(STEPS_PER_REV, 0, 2, 1, 3);

void setup()
{
// Nothing (Stepper Library sets pins as outputs)
}

void loop()
{

// About 15 rotations Clockwise (1 full rotation is 2050 steps)
//steppermotor.setSpeed(500);
steppermotor.setSpeed(1000);
StepsRequired = 30750;
// About 100 rotations Clockwise (1 full rotation is 2050 steps)
//StepsRequired = 205000;
steppermotor.step(StepsRequired);
delay(2000);

// About 15 rotations Counterclockwise
//steppermotor.setSpeed(500);
steppermotor.setSpeed(1000);
StepsRequired = - 30750;
// About 100 rotations Counterclockwise (1 full rotation is 2050 steps)
//StepsRequired = - 205000;
steppermotor.step(StepsRequired);

// Wait 1 hour before rotation again
delay(600000);
// Wait 10 minutes before rotation again
//delay(2000);

}

Thanks,

How are you powering the stepper motor? I have one of them and it just gets warm.

Your variable StepsRequired is defined as an int. An int can only take values up to +32767 and down to -32768. You are trying to store 205000 in it. You need to define that variable as long rather than int.

What Arduino are you using? It is generally not a good idea to use pins 0 and 1 as they are used for Serial and when uploading programs.

...R

"grinding sound" is cool :slight_smile: when the motor gets warm, it gets weaker. When it's week enough to loose steps you have that nice soundeffect. So your motor is most likely not up to the task. Or your drivers are crap - ULN2008? Get a decent stepper driver, even the toy ones for NEMA17 will do.

zwieblum:
Or your drivers are crap - ULN2008?

My 28BYJ-48 motor works perfectly well with the ULN2003 driver that came with it.

...R

Robin2:
How are you powering the stepper motor? I have one of them and it just gets warm.

Your variable StepsRequired is defined as an int. An int can only take values up to +32767 and down to -32768. You are trying to store 205000 in it. You need to define that variable as long rather than int.

What Arduino are you using? It is generally not a good idea to use pins 0 and 1 as they are used for Serial and when uploading programs.

...R

Hi thank you for replying back. I am powering the motor using usb wall plug instead of through a computer.

I will put it back to 30750 instead of 205000.

I am using Arduino Uno. Is there a specific reason why i shouldn't use pin 0 and 1? I am planning to run three 28BYJ-28 motors using the same board. I know it doesn't sound idea and i have my concern on the power consumption and whether or not the board will not be able to handle the voltage/current.

This is an off topic, but if i want to control 9 stepper motors. is it better to just to get a Arduino Mega instead? From your experience, is there any other concern you might know of?

Much appreciated

zwieblum:
"grinding sound" is cool :slight_smile: when the motor gets warm, it gets weaker. When it's week enough to loose steps you have that nice soundeffect. So your motor is most likely not up to the task. Or your drivers are crap - ULN2008? Get a decent stepper driver, even the toy ones for NEMA17 will do.

Hi thank you for the reply.

That's what i am planning to try if 28BYJ-48 does not work. What I am worried about is that 28BYJ-48 cannot hold 0.5kg of weight while rotating. I suspect this is the because of the load i am putting on the motor.

Does NEMA17 behave a bit better in turns of load holding?

much appreciated

Ask the datasheet of your stepper.

newbiewinder:
I am using Arduino Uno. Is there a specific reason why i shouldn't use pin 0 and 1? I am planning to run three 28BYJ-28 motors using the same board.

I have given you the reason. You can use the analog pins as digital pins.

I know it doesn't sound idea and i have my concern on the power consumption and whether or not the board will not be able to handle the voltage/current.

Even with one motor you should not powering it from the Arduino. With a suitable separate power supply you can have as many motors as you like - the Arduino only provides the control signals.

This is an off topic, but if i want to control 9 stepper motors. is it better to just to get a Arduino Mega instead? From your experience, is there any other concern you might know of?

A Mega has a lot more I/O pins. What may be a limiting factor is the ability ot a 16MHz Arduino to produce enough steps per second for several motors.

What I am worried about is that 28BYJ-48 cannot hold 0.5kg of weight while rotating. I suspect this is the because of the load i am putting on the motor.

Can't you provide a counterbalance or a separate bearing to take the load (or both) so the stepper motor's bearings and gearbox are not stressed.

...R

Thank you again for replying back.

Robin2:
Even with one motor you should not powering it from the Arduino. With a suitable separate power supply you can have as many motors as you like - the Arduino only provides the control signals.
...R

Understood. I will have a breadboard and power it from there instead of directly to the board.

Robin2:
A Mega has a lot more I/O pins. What may be a limiting factor is the ability ot a 16MHz Arduino to produce enough steps per second for several motors.
...R

I am not concerning about the precision of the stepper I guess..? Since the sole purpose of the motor is to continue to rotate the watches at constant low speed and high torque. But, if that's the case, I could just a DC brushless motor instead and control the speed from Arduino. I have not played much with a DC motor but i take it that a DC motor speed is controlled by voltage and current? Can this be done from coding? or do i need to have a voltage regulator (like a potentiometer?)

Robin2:
Can't you provide a counterbalance or a separate bearing to take the load (or both) so the stepper motor's bearings and gearbox are not stressed.
...R

That was my original design. But, the whole structure is not mounted 90° or perpendicular to a table, it is actually placed with a slope of 55° because i want don't want to the motor shaft to take on the full weight. By doing that, i can actually make the motor move, but i guess i will need to use a ball bearing just to avoid damaging the motor.

newbiewinder:
I have not played much with a DC motor but i take it that a DC motor speed is controlled by voltage and current? Can this be done from coding?

Assuming you have a suitable motor driver between the Arduino and the DC motor you can control the speed with an Arduino. However if you want to maintain a constant speed with a varying load then you will need some means for the Arduino to measure the speed of the motor so it can make corrections if the speed varies.

...R

newbiewinder:
But, if that's the case, I could just a DC brushless motor instead and control the speed from Arduino. I have not played much with a DC motor but i take it that a DC motor speed is controlled by voltage and current? Can this be done from coding? or do i need to have a voltage regulator (like a potentiometer?)

DC motors don't have accurate speed control, the load will affect the speed, but the no-load speed is proportional to the voltage, and the current is proportional to the torque (including friction).

Brushless DC motors need a brushless controller or ESC, and you'll need a sensored motor for any kind of
accurate speed control at low speeds. For very low speed you'll probably need a servo control loop and a
shaft-encoder - which is why steppers are often preferred (simpler).

MarkT:
DC motors don't have accurate speed control, the load will affect the speed, but the no-load speed is proportional to the voltage, and the current is proportional to the torque (including friction).

Brushless DC motors need a brushless controller or ESC, and you'll need a sensored motor for any kind of
accurate speed control at low speeds. For very low speed you'll probably need a servo control loop and a
shaft-encoder - which is why steppers are often preferred (simpler).

In other word, 28BYJ-48 is the way to go in this application? Got it. I will try to do the bearing combination and see if i can take some of the loads off motor. If that doesn't work, i will have to go to NEMA 17

If i use NEMA 17 instead of 28BYJ-48, can i still use the same coding?

newbiewinder:
If i use NEMA 17 instead of 28BYJ-48, can i still use the same coding?

Pretty much - except that most Nema17 motors don’t have gearboxes and I suspect those that do will be expensive.

And you will need a suitable stepper motor driver - choose the motor first and then then choose the driver. Motors that need 1.7amps or less can be controlled with the cheap DRV8825 driver.

Drivers such as the DRV8825 only need two connections to the Arduino for STEP and DiRECTION so this line of code

Stepper steppermotor(STEPS_PER_REV, 0, 2, 1, 3);

will need to change to

Stepper steppermotor(STEPS_PER_REV, stepPin, directionPin);

Note that most Nema17 stepper motors without gearboxes have 200 steps per revolution. You can get some with 400.

…R

Robin2:
Drivers such as the DRV8825 only need two connections to the Arduino for STEP and DiRECTION so this line of code

only need two connections to the Arduino? That is so interesting. It is different than 28BYJ-48 where you need to use 4 connections. Does that mean arduino is able to control six NEMA 17 motors?

I just checked the spec sheet of NEMA 17. It is using 12 VDC and it's running 1.4A @ 4V. I can still use my external power supply module that provides 5V? I just want to make sure i am not confused with the voltage and power supply since Arduino board is running at 5V.

I have no experience with NEMA 17. Can this motor hold more load compared with 28BYJ-48? or do i still need a bearing to hold the load as a good practice?

Does NEMA 17 get warm like 28BJY-48? I would assume so since it is constantly getting powered?

newbiewinder:
I just checked the spec sheet of NEMA 17. It is using 12 VDC and it's running 1.4A @ 4V. I can still use my external power supply module that provides 5V? I just want to make sure i am not confused with the voltage and power supply since Arduino board is running at 5V.

I have no experience with NEMA 17. Can this motor hold more load compared with 28BYJ-48? or do i still need a bearing to hold the load as a good practice?

Does NEMA 17 get warm like 28BJY-48? I would assume so since it is constantly getting powered?

Read through this Stepper Motor Basics to get some background knowledge.

Nema 17 just tells you the size of the front face is 1.7 inches, There are hundreds of different Nema17 motors.

The DRV8825 requires a minimum of 8.2v and can go up to 45v according the Pololu DRV8825 web page. Higher voltages give better performance if you need high speeds. I would consider 12v to be the practical minmum.

The bearings of a Nema 17 will be better than a 28BYJ-48.

...R

Robin2:
Even with one motor you should not powering it from the Arduino.

There is no problem with powering even two 28BJY-48 stepper motors from an Arduino Uno, if that is USB powered.
Uno can provide 450mA, a single 28BJY-48 draws 200mA:

Does even work when stepper PT camera system has to carry 109g camera with lens:

HermannSW:
There is no problem with powering even two 28BJY-48 stepper motors from an Arduino Uno, if that is USB powered.
Uno can provide 450mA, a single 28BJY-48 draws 200mA:

I think most of the regulars here will disagree with that.

...R

Robin2:
I think most of the regulars here will disagree with that.

That are not my numbers, under the link I provided I cited Wawa and JCA34F.
Can you please tell what is wrong with their numbers?

Uno/Leonardo have this nice part: https://www.onsemi.com/pub/Collateral/NCP1117-D.PDF - rated 1A, but needs colling if you ask for more than 0.2A.

Robin2:
Read through this Stepper Motor Basics to get some background knowledge.

Nema 17 just tells you the size of the front face is 1.7 inches, There are hundreds of different Nema17 motors.

The DRV8825 requires a minimum of 8.2v and can go up to 45v according the Pololu DRV8825 web page. Higher voltages give better performance if you need high speeds. I would consider 12v to be the practical minmum.

The bearings of a Nema 17 will be better than a 28BYJ-48.

...R

okay thanks. that's good to know that i can control more using NEMA 17 motors and they have better bearing. I might just get one and try it.

I am currently using MB102 on my breadboard to power both my motor 28BJY-48 and my Arduino. If i am to use DRV8825 which is taking 12V, do i need a power supply module that can can provide 12V? Or do i need a 12V AC/DC power supply adapter and a female jack connector connecting to breadboard?

Thanks