When I was first learning arduino, I purchased an experimenters kits and one of the experiments was using a little stepper motor. But that was years ago, now, and I was overwhelmed at the time with all I was trying to learn so I remember very little.
On my last amazon batch order I purchased one of these little stepper motors to play with and get a little more solid background on the operation of steppers:
This is, supposedly, a super popular motor, made in the millions, so using it for instruction purposes means whatever I learn I will have no trouble re-using in the future (I keep notes of my various experiments).
I did research on this 28BYJ48 motor and found a great little write up on the specs, how to connect the hardware, and some example code:
I love how easy it is to find such good write ups on the web.
I played with the first two examples which simply moved the motor in a linear fashion. Then I downloaded the AccelStepper example code (found here http://www.airspayce.com/mikem/arduino/AccelStepper/AccelStepper-1.37.zip) and tried that. Very cool. The motor starts slow, accelerates to full speed, then decelerates to a stop. Here’s a little video of it in operation: