Hi All
I am new to Arduino and trying to learn from picking up information/code from Internet. I have got an arduino UNO and a 5V-12V stepper motor 28BYJ-48 with ULN2003 Driver Board. I picked up sample code from internet/Elegoo and it is workiing but the speed is very slow. Now there are obvious problems, as I learned later, that for this particular motor the stepsperrev should be set to 32 (for 4 step sequence), But I have some additional questions that will help me better understand motor control. I don't know much, so any detail would be appreciated:
- What is the max that I can setspeed() for this combination of motor/board? I have seen numbers 200-300RPM being thrown around. But I also saw a post saying that just based on PPS rate, 15-25 RPM might be max! That is a big difference Given the 1:64 gear ratio, this would not give even half rev per minute at the axle.
- For motor to run continuously in a practical manner, the delay should be min. Do I really need delay at the end, given setspeed() actually does that for me? If I do, what is the min value I should be using. [I am a SW engineer, so I know the need for delay. But I am not a HW person, so I am not sure if such a big delay 500ms is really needed to bring the HW in a cooler state before starting the next iteration. Again, I just don't want to burn the board :)]
- I am currently plugged into 5V output pin of arduino board and so far the board has not burnt :). Would it be better to use separate power source, when running at higher speed. Any comment on this
#############################
Example Code
#############################
#include <Stepper.h>
const int stepsPerRevolution = 200; // change this to fit the number of steps per revolution
// for your motor
// initialize the stepper library on pins 8 through 11:
Stepper myStepper(stepsPerRevolution, 8, 9, 10, 11);
int stepCount = 0; // number of steps the motor has taken
void setup() {
// initialize the serial port:
Serial.begin(9600);
}
void loop() {
// step one step:
myStepper.step(100);
Serial.print("steps:");
Serial.println(stepCount);
stepCount++;
delay(500);
}