Controlling the stepper using the Arduino
The part number of the stepper motor used in this example is 28BJY-48 (http://www.adafruit.com/product/858). A stepper motor is a type of motor that is operated by energizing its coils in several steps. The coil energization in several steps enables the stepper to rotate in precise angular steps. This precise movement aids the use of a stepper motor in open loop systems. Since the working principle of a stepper motor is beyond the scope of the book, let's discuss its control technique.
Prepare for lift off
The stepper motor is powered by a common lead connected to the power supply and the other end is connected to a transistor. Since transistors can be used as switches, the leads of the coil can be grounded alternatively. This alternative sequence causes the stepper motor to rotate and the speed of rotation is controlled by introducing a delay in between the coil energization. The minimum delay required between each energization step to make...