Interfacing Stepper Motor with PIC Microcontroller

Interfacing Unipolar Stepper Motor with PIC Microcontroller

PIN Diagram of L293D

PIN Diagram of L293D

L293D and L293 are dual H-bridge motor drivers. The L293D can provide bidirectional drive currents of up to 600-mA at voltages from 4.5 V to 36 V while L293 can provide up to 1A at same voltages. Both ICs are designed to drive inductive loads such as dc motors, bipolar stepping motors, relays and solenoids as well as other high-current or high-voltage loads in positive-supply applications. All inputs of these ICs are TTL compatible and output clamp diodes for inductive transient suppression are also provided internally. These diodes protect our circuit from the Back EMF of DC Motor. In both ICs drivers are enabled in pairs, with drivers 1 and 2 are enabled by a high input to 1,2EN and drivers 3 and 4 are enabled by a high input to 3,4EN. When drivers are enabled, their outputs will be active and in phase with their inputs. When drivers are disabled, their outputs will be off and will be in the high-impedance state.

ULN2003 is a monolithic high current and high voltage Darlington transistor arrays. ULN2003 consists of seven NPN Darlington Transistor pairs that have high-voltage outputs with common-cathode clamp diode for switching inductive loads. The collector-current rating of a single darlington pair can be up to 500mA. We can connect Darlington Transistor pairs in parallel if higher current capability is needed..

Interfacing using L293D

Interfacing Unipolar Stepper Motor with PIC Microcontroller using L293D Circuit Diagram

Interfacing Unipolar Stepper Motor with PIC Microcontroller using L293D Circuit Diagram

Note: VDD and VSS of the pic microcontroller is not shown in the circuit diagram. VDD should be connected to +5V and VSS to GND.

PORTB of PIC Microcontroller is used for controlling the stepper motor.

Interfacing using ULN2003

Interfacing Unipolar Stepper Motor with PIC Microcontroller using ULN2003

Interfacing Unipolar Stepper Motor with PIC Microcontroller using ULN2003

Note: VDD and VSS of the pic microcontroller is not shown in the circuit diagram. VDD should be connected to +5V and VSS to GND.

See Next Page to Read about MikroC Programming……

Pages: 1 2 3 4

  • Janelle Serrano Polinga

    can you please give me a sample program for five degree freedom robotic arm using servo motor? we are using mikroc in 16f84a as our pic and we are having a hard time solving it. thanks! :D

  • Esala

    What does 0x0f mean?I am newbie to mikro c.

  • http://www.electrosome.com/ Ligo George

    0x indicates hex code…
    0b indicates binary…
    0 = 0000 in binary
    F = 1111 in binary..
    there for .. 0x0f in hex equal to 00001111 in binary..
    0x0f = 0b00001111

  • jatindecoded

    I want four steppers to be controlled from a single PIC16 or ATMega16. I want o have speed control (i.e the steps and the direction to be controlled by the user via a serial hyper -terminal). In that case do I need to use PWMs ?
    How many PWMs are there on PIC16F877a ? Would I be able to run four motrs witha single MCU chip and L293D ?

  • http://www.electrosome.com/ Ligo George

    You needn’t use PWMs as you are using Stepper Motor….
    You can adjust speed by changing the delays between steps

  • Hafiz

    hello, my question… i follow this circuit….. my project i use 2 ldr as input at portA… but motor cannot move. why?? please reply or send to me the program. email :[email protected]… Urgent!!!