How to make a stepper motor just "go"?

Hello all. I'm looking at making a simple project that uses a motor that just spins. The module I purchased is the ULN2003 with the 28BYJ-48 motor.

Now I'm a novice so bear with me, and please correct me if I'm wrong. From what I understand, the ULN2003 module hooks up to 4 PWM pins on the Arduino. However from what I'm seeing, it looks like controlling the motor eats up the entire sketch and "pauses" the loop until it's done spinning. I don't want that. I just want the motor to "go." Arduino powers on, starts the motor, and then runs the rest of the sketch. It doesn't need any steps, I just need to be able to control the speed. And by that, I mean set up the speed in the code, not control the speed while the sketch is running. Does that make sense?

So is it possible to just make the motor "go" and still have the sketch run? Thank you in advance.

|500x500

What do you mean "eats up the sketch"? What do you mean "still have the sketch run"? The motor will do what you tell it to do. If you want to do multiple things, you need to actually explain that.

From what you understand, you do not. Pins do not need to be PWM. You need to show the code you are using. There are many ways to control the stepper motor and you need to actually show which way you're going with.

So is it possible to just make the motor "go" and still have the sketch run?

No. The motor takes [u]one step[/u] when the computer and driver board tells it to.

If you want a motor to just "go", buy a brushed DC motor and connect it to a battery or power supply.

There are threads talking about using that motor.

https://arduino-info.wikispaces.com/SmallSteppers

Google gives a lot of hits.

.

jremington: No. The motor takes [u]one step[/u] when the computer and driver board tells it to.

If you want a motor to just "go", buy a brushed DC motor and connect it to a battery or power supply.

Great, thanks. That's exactly what I needed to know.

Depending on what other code you are using, you might be able to get it working by using some clever timing tricks, but it is indeed much easier to just use a brushed DC motor.

To drive the DC motor, you'll need a transistor or a MOSFET if you want to drive it in one direction (1 PWM pin needed). If you need to be able to run it in both directions, you'll need an H-brigde (1 or 2 pins + 1 PWM pin needed). You can use 4 discrete transistors or MOSFETs to build one, but the easiest way is to just buy it in one package. If you want accurate speed control and/or stall detection, you'll need some kind of feedback. This could be a hall effect sensor to count the revolutions, or a rotary encoder. This input can then be processed by a PID controller that controls the PWM width to keep the speed constant.

Pieter