Monday, November 29, 2010

16F84A Stepper Motor Control


In this post , we 'll see how to control a stepper motor using the Microcontroller PIC 16F84A.


The stepper motor is a special type of motor in which motion can be controlled by speed and position. As the name complies, the stepper motor moves in steps (degrees) .

Unlike other types of motors, stepper motors have more than 2 terminals ( They can have 3 , 4 or five terminals ) .


Thus , the stepper motor is driven by switching its coils ON and OFF according to certain sequence. The function of the microcontroller is generating the driving signals.


Of course, the output current of the Microcontroller is not sufficient to drive the motor coils. There is an interfacing IC that can supply the motor coils with the suitable driving current.

This IC is ULN2003. It acts as an electronic switch opened and closed according to the output signals of the Microcontroller.






This is the real circuit connection


As you can see , I used an old hard disk drive motor. This is a three coil stepper motor. Actually it has 4 terminals ( 3 Coils and 1 Common ).








You can see the four terminals on the back of the motor



video



This video shows the stepper motor connected to the driving circuit and rotating



You can find the source code and simulation files on this link.




The simulation model shows LEDs connected to the Microcontroller 16F84A. That is because this version of Proteus ISIS does not contain a three coil stepper motor model.







This is the schematic diagram of the circuit.








0 comments: