Of all motors, step motor is the easiest to control. It’s handling simplicity is really hard to deny – all there is to do is to bring the sequence of rectangle impulses to one input of step controller and direction information to another input. Direction information is very simple and comes down to “left” for logical one on that pin and “right” for logical zero. Motor control is also very simple – every impulse makes the motor operating for one step and if there is no impulse the motor won’t start. Pause between impulses can be shorter or longer and it defines revolution rate. This rate cannot be infinite because the motor won’t be able to “catch up” with all the impulses (documentation on specific motor should contain such information). The picture below represents the scheme for connecting the step motor to microcontroller.
The key to driving a stepper is realizing how the motor is constructed. A diagram shows the representation of a 4 coil motor, so named because 4 coils are used to cause the revolution of the drive shaft. Each coil must be energized in the correct order for the motor to spin.
INTERFACING TO 8051
To cause the stepper to rotate, we have to send a pulse to each coil in turn. The 8051 does not have sufficient drive capability on its output to drive each coil, so there are a number of ways to drive a stepper,
Stepper motors are usually controlled by transistor or driver IC like ULN2003.
Driving current for each coil is then needed about 60mA at +5V supply. A Darlington transistor array, ULN2003 is used to increase driving capacity of the 2051 chip. Four 4.7k resistors help the 2051 to provide more sourcing current from the +5V supply.
??
Coil A | Coil B | Coil C | Coil D | Step |
0 | 1 | 1 | 0 | 1 |
0 | 0 | 1 | 1 | 2 |
1 | 0 | 0 | 1 | 3 |
1 | 1 | 0 | 0 | 4 |
Courtesy:Maheshwankhede
To Read more here