1. You can now buy finished microcontroller project from us, Check out the Store for the complete list of projects.
  2. Need a custom project, Send us some details about your project. So that we can quote the price for it.

Stepper Motor Interfacing with P89v51RD2

Discussion in 'Microcontrollers' started by megaposiedon, Oct 15, 2012.

  1. megaposiedon

    megaposiedon New Member

    Likes Received:
    0
    Trophy Points:
    0
    I'm using a unipolar stepper motor (1.8deg)
    Here is the datasheet.


    According to the datasheet (see the link above)I connected the respective color wire to the respective pin of l293D according to the following circuit diagram


    [​IMG]


    and applied 12v,500mA as motor supply to L293D.


    Here is my program


    Code (Text):
    1. #include <intrins.h>
    2. #include "p89v51rx2.h"
    3.  
    4.  
    5. #define stepper P1
    6.  
    7.  
    8. void delay();
    9.  
    10.  
    11. void main(){
    12.        while(1){
    13.                
    14.                 stepper = 0x09;
    15.                 delay();
    16.         stepper = 0x08;
    17.          delay();
    18.         stepper = 0x0C;
    19.                 delay();
    20.                  stepper = 0x04;
    21.                 delay();
    22.                  stepper = 0x06;
    23.                 delay();
    24.                  stepper = 0x02;
    25.                 delay();
    26.                  stepper = 0x03;
    27.                 delay();
    28.                  stepper = 0x01;
    29.                 delay();
    30.         }
    31. }
    32.  
    33.  
    34. void delay(){
    35.         unsigned char i,j;
    36.         for(i=0;i<255;i++)
    37.                     for(j=0;j<1275;j++);           
    38. }

    I observed small vibrations in the stepper motor but the motor is not rotating at all...even after changing the delay. What might be the problem ???


    Thanks in advance
  2. embedded678

    embedded678 New Member

    Likes Received:
    0
    Trophy Points:
    0
    diagnosis for stepper motor project

    Hi,
    I have made a program by referring to this link https://github.com/divyansh/Embedded-For-You-Projects/tree/master/Mechatronics
    The program is made on Mechatronics kit from Embedded For You magazine using Arduino compiler.
    You will get idea of connections and algorithm at this link.
    All the Software and Hardware design is open source and available at that GIT repository.
Loading...

Share This Page

Loading...