EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Topics / Stepper Motor interfacing with 8051,

Stepper Motor interfacing with 8051,

|

Microcontroller › 8051 › Stepper Motor interfacing with 8051,

  • This topic has 6 replies, 3 voices, and was last updated 12 years, 4 months ago by AJISH ALFRED.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • October 27, 2013 at 1:06 pm #2689
    pankaj
    Participant

    Hi friends
    I am having problem in interfacing 8051 uC with stepper motor.
    My aim is to rotate the stepper motor by +90 degree when i push a “UP” button once and when I push the “UP” button twice +180 degree and then +270 then 0 degree.
    And when I push “DOWN” button rotate by -90 degree and when I push DOWN twice -180 degree and so on.

    I am working on a Proteus but I think there is problem in program and I am not able to get proper result.

    Can you any one give me proper Program for that

    Thanks in advance

    October 29, 2013 at 8:49 am #10560
    AJISH ALFRED
    Participant

    Hi Pankaj,
    Please try it on real hardware.

    November 5, 2013 at 8:33 am #10571
    daniel diamenu
    Participant

    hi can i have a look at your circuit so i can help with the program, i think that is the way u can get better help

    thank u

    November 16, 2013 at 10:38 am #10611
    pankaj
    Participant

    I started doing it on real hardware, with bipolar stepper motor, crystal 12MHz, capacitor 33pF ,AT89C51, and L293D .

    And my program is:

     

    It is working in proteus but not working in hardware:

     

    Reference:http://www.electrosome.com/interfacing-stepper-motor-8051-keil-c-at89c51/

     

    #include<reg51.h> //using AT89C51
    #include<stdio.h>
    void delay(int); // Rotation In sequence without any switch continously
    void main()
    {
    P1=0;
    P2=0;
    P3=0;
      do
      {
        P2=0x01; //0001
        delay(100);
        P2=0x04; //0100
        delay(100);
        P2=0x02; //0010
        delay(100);
        P2=0x08; //1000
        delay(100);
      }while(1);
    }
     
    void delay(int k)
    {
      int i,j;
      for(i=0;i<k;i++)
      {
        for(j=0;j<1725;j++)
        {}
      }
    }
     
    wysiwyg_imageupload:11078:
    November 16, 2013 at 10:48 am #10612
    pankaj
    Participant

    I am working on real hardware it is not giving any desired response (at output pins)  how ever it works perfectly in Proteus my circuit is:

    hardware: AT89C51, capacitor 33pF, crystal 12MHz, Bipolar Stepper Motor (4 wire)…

     

    my program is:

     

    #include<reg51.h> //using AT89C51
    #include<stdio.h>
    void delay(int); // Rotation In sequence without any switch continously
    void main()
    {
    P1=0;
    P2=0;
    P3=0;
      do
      {
        P2=0x01; //0001
        delay(100);
        P2=0x04; //0100
        delay(100);
        P2=0x02; //0010
        delay(100);
        P2=0x08; //1000
        delay(100);
      }while(1);
    }
     
    void delay(int k)
    {
      int i,j;
      for(i=0;i<k;i++)
      {
        for(j=0;j<1725;j++)
        {}
      }
    }
     
    wysiwyg_imageupload:11079:
    November 16, 2013 at 1:27 pm #10613
    pankaj
    Participant

    Now it is rotation but after few steps it stop rotating… 

    tried to change the program but same result… 

    My motor is:

     

    NMB-MAT pm35s-048 FEE6

                         

                            TB6628D

     

    I am giving 9 volt supply through HW HI Watt battery (vallue of current is not given in battery)…

     

    Is the current is not enouth to rotate the rotor ?

    November 27, 2013 at 6:04 am #10661
    AJISH ALFRED
    Participant

    Hi Pankaj,

    Please post the circuit diagram of the real hardware, that image dosen’t look like one.

  • Author
    Posts
Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.
Log In

RSS Recent Posts

  • isolating S-params in of PCB board without connectors April 11, 2026
  • Assistance locating a 'trail' camera gadget, please ? April 10, 2026
  • Raise your hand if your car had one of these: April 10, 2026
  • Some opamp advice please April 10, 2026
  • Voltage comparator circuit verification April 10, 2026

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2026 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise