The 28BYJ-48 stepper motor is readily available and very inexpensive - yet quite decent for the money.
The library uses 8-phase half-stepping to give 4096 discrete (mini-)steps per shaft rotation for precise control.
The total steps per rotation is also adjustable :
the motor has an advertised 64:1 gear ratio but it has been measured as being 63.68395:1, which would give ~4076 steps per shaft rotation.
you can also adjust this value to account for external gear ratios
(e.g. if you are controlling a turntable with 1:4 motor:turntable gearing, change total steps to [4096*4=] 16384 steps, and then your motor control - rpm, degrees, etc. - will match your turntable)
The library allows you to:
control the stepping directly (CheapStepper::step()) or
use blocking moves (CheapStepper:move()) - i.e. sketch will "pause" - or
use non-blocking moves (CheapStepper::newMove() and CheapStepper:run()) - i.e. moves will be timed to occur across loop() iterations
More info is available on the GitHub repo and in the library code (fully commented!)
This is my first Arduino library, so I'm happy to receive feedback or pull requests!
Roadmap:
adjustable voltage input (right now calcs are based on 5v)
acceleration/de-accelaration
easier external gear ratio adjustment
I'm using this library right now to build a 3D scanner and it's working quite well
Although, now that I'm playing with it, I can't seem to declare the stepper on other pins. Is there something inherent in the library that forces the use of pins 8, 9, 10, and 11?
I also want to use this library on different pins. With my level of expertise I cannot figure out from the description above what code I have to add to make this work.
I asked a friend for help. He has no Arduino experience, but a lot of programming skills. Not sure if this the best solution, but I did the following and that worked.