Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 7

 The connection of stepper motor to 16F877A:

The exact circuit to connect the stepper motor to 16F877A is given below:

In this the common is connected to the 16V supply(12 v is actually enough actually higher current drives the motor better as far as i know*). Now whenever the pin at the input of the ULN2003 goes high say pin 1 the output pin 16 drains the current throuh the motor thus completing the circuit from supply16V through motor to the ground in that line. When you keep doing this in series as i called it the abcd pulse the motor will rotate . When your reverse the pulse order the motor rotates in the other direction.

 Stepper motor:

The above are the most common types of stepper motors There are two types of stepper motor that normally is used.1)Unipolar 2)Bipolar . In simle terms they can be thought about like this. In unipolar there are 5 wires.One common wire and four wires to which power supply has to be given in a serial order to make it drive. Bipolar can have 6 wires and a pair of wires are given supply at a time to drive it in steps. STEP ANGLE :The angle with which the stepper motor turns for a single pulse if supply tone wire or a pair is called step angle. Driving a stepper motor: 1) Identify the wire : Common and windings

As you may see that out of the five wires two are grouped as common. The other four are the windings youl have to give your supply to. Now major crux here is to identify the common line. thats pretty simple.  Connect this circuit:

So this is it.Now use your Microcontroller PIC16F877A to give +5v supply to pins a,b,c,d one by one thats: a=5v,b=0,c=0,d=0 a=0,b=5v,c=0,d=0 a=0,b=0,c=5v,d=0 a=0,b=0,c=0,d=5v Then stand aside and watch your motor run.!! >The minimum time between the two pulses given to a , b must be greater than 200 micorseconds(it depends on your motor)

> Microcontroller can always be replaced with your computer parallel port > UlLN2003 can drain up to 500 mA so most stepper motors can be drivin satisfactorily.
Stepper motors are very different from a regular DC motors. Instead of spinning like DC motors do, stepper motor steps at a specific resolution for each pulse. The motor that we are using needs 48 steps / pulses just to complete a single revolution! That should be enough to tell about its precision. Another advantage of stepper motors is the fact that their speed of rotation can be achieved almost instantly even if you change the spinning direction. Stepper motor consists of a rotor - the permanent magnet that rotates inside, and stator - four coils (north, east, south, west) that are part of the case, and which don't move. Rotor can be moved by sequentially applying a pulsed DC voltage to one or two coils at a time.

Stepper Motor Connections

Unipolar motor should have five or six connections depending on the model. If the motor has six connections like the one pictured above, you have to join pins 1 and 2 (red) together and connect them to a (+) 12-24V voltage supply. The remaining pins; a1 (yellow), b1 (black), a2 (orange), b2 (brown) should be connected to a driver (ULN2003) as shown on the schematic.

How Stepper Motors Works? Stepper motors are very different from a regular DC motors. Instead of spinning like DC motors do, stepper motor steps at a specific resolution for each pulse. The motor that we are using needs 48 steps / pulses just to complete a single revolution! That should be enough to tell about its precision. Another advantage of stepper motors is the fact that their speed of rotation can be achieved almost instantly even if you change the spinning direction. Stepper motor consists of a rotor - the permanent magnet that rotates inside, and stator - four coils (north, east, south, west) that are part of the case, and which don't move. Rotor can be moved by sequentially applying a pulsed DC voltage to one or two coils at a time.

 Stepper Motor Driver :


ULN2003: Why use another chip to control outputs? Well the answer to that is that the PIC micro-controller can only source or sink up-to 25mA for each output. While this might be fine for logic level shifting, and even small devices like LED's, you can't drive a relay, motor, etc with a PIC. The ULN2003 is a very cost effective chip that acts like a switch. The easiest way to explain its operation: It simply switches an earth to/from an external circuit, and can withstand a continual 500mA current drain and a maximum 50V. All this for $0.47 AUD.

What's Inside?
The picture on the right is what the ULN2003 looks like internally. Pins 1:7 are inputs, while pins 10:16 are high current sink drivers. Between the I/Os is an independent Darlington pair (the 'Darlington pair' behaves like a single transistor with a high current gain). When an input is driven high, the corresponding output will basically become an earth. Alternately, when the input pin is low, the output pin adopts a high impedance. This allows external high-current circuits to be driven by small micro-controllers. There are seven channels ready to be used, and as mentioned earlier, the ULN2003 can sink up-to 500mA between all the channels.

Operation
There is only one power connection, a common ground (Pin 8). Here's an example of driving a high power LED with logic voltages via the ULN2003 (note the LED is being driven by a 12 volt source, but controlled by the logic voltage);

For inductive loads, such as motors and relays, Pin 9 is connected to the loads +V to shunt counter-electromotive force (EMF, also known as CEMF) safely. That is, if the motor was connected to +12V and then pin 16 of the ULN, then pin 9 would be connected to the same +12V source as the motor. The ULN2003 has become my primary choice to controlling external components - its cheap, effective, and requires no operating voltages other than the common ground. Keep in mind that you will have a voltage drop of about 0.9v-1.0v over the UL2003 when in circuit.
http://electronics-diy.com/stepper_motors.php http://madan.wordpress.com/2006/06/24/stepper-motor-driver-circuit/#comment-200

You might also like