Home > Circuit ideas, New circuits, PIC ideas, Robotics, Tech talks > Exact Circuit and MicroC code for stepper motor

Exact Circuit and MicroC code for stepper motor

Well saw that people still are having quite some doubts on the stepper motor post that i had put up. so i thot to make that abstact clear i better put the exact circuit and the code here.

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*). If u are new here and donot know how to find the common line in a unipolar Stepper motor then see here

The MicroC code for running the motor is as below.
void main()
{
TRISB = 0×00;
PORTB = 0×00;

//routine to move in one direction
for (i=0;i<50;i++)// increse i=50 no i=100 to cover double the distance
{
PORTB=0×80;
delay(20ms);
PORTB=0×40;
delay(20ms);
PORTB=0×20;
delay(20ms);
PORTB=0×10;
delay(20ms);
}

//routine to move in the other direction

for (i=0;i<50;i++) // increse i=50 no i=100 to cover double the distance
{
PORTB=0×10;
delay(20ms);
PORTB=0×20;
delay(20ms);
PORTB=0×40;
delay(20ms);
PORTB=0×80;
delay(20ms);
}
}

There are much easier ways to write the above code but then i am not worried about the memory it’l take nor have any pressing need to keep my code small and trim ,so i guess this will make you absolutely clear of what i’m trying to do to make my motor run.

If you din know MicroC well,let me brief. The line PORTB = 0×80 (1000000)makes my 8th pin of the PORT “B” that’s b7 pin or the 40th pin go high.The next line PORTB = 0×40(01000000) will make the 39th pin go high and all other low.

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 supplt 16V 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. As simple as that. For most robotic application atleast at contest level you may use this circuit uinless you go for bigger stepper motors that need more current to drive and is greater than the 500mA that the ULN2003 can sink!!
i guess i was clear about using ULN2003 to drive a sstepper motor. pl post your comments and doubts
–Madan
I like keeping all my circuits small and simple and not crowd it with resistors and capacitors.Afterall its a hobby and we need not complicate it.Cheers.

About these ads
  1. Harrynee
    July 3, 2006 at 4:10 am | #1

    thanks buddy..this is really helpful..u doing a gr8 job!

  2. July 3, 2006 at 7:34 am | #2

    :)

  3. RITWICK
    August 23, 2006 at 3:44 pm | #3

    as iam a begginer plz tell how to enter programs in microcontrollers

  4. August 24, 2006 at 12:39 pm | #4

    you’l need a programmer… that’s a device…. u need to connet it to the computer and transfer the code u wrote on computer to the microcontroller… see it in the ‘Micro-controller’ page in the top.

  5. Surfer
    September 3, 2006 at 9:28 am | #5

    Funny Stuff …

  6. September 3, 2006 at 2:02 pm | #6

    I wish it really was surfer :). so how is amsterdam man?

  7. PRATAP
    November 14, 2006 at 6:35 am | #7

    plz send me the deails of (,hardware and software)stepper motor speed controller in my above mentain email id

  8. November 14, 2006 at 7:11 am | #8

    change the delay to change the speed. that’s all to it.

    delay(20ms);

  9. December 26, 2006 at 7:07 pm | #9

    Hey, you dint ground your ULN correctly.
    I guess it should be like, PIN 8 to GND and PIN 9 to high, i.e. 16V.
    I tried your circuit, it is not working.
    This is what I am sayign is correct :
    http://electronics-diy.com/stepper_motors.php

  10. December 30, 2006 at 4:17 pm | #10

    Yes you are right . in 8 should be grounded . i made a mistake here. i forgot to change that. i had noted it though. i’l try to change it as soon as poosible.

    Thanks for reminding

  11. December 31, 2006 at 2:37 am | #11

    The circuit has been modified, the circuit now is CORRECT!! :) . Thanks rishi for bringin it to my notice.

  12. vishal
    March 23, 2007 at 5:25 am | #12

    hi madan..
    i trying to move stepper motor with the help of AT89S51 using ISP(in system programming)…
    from ur referance i m not getting the pin configuration of ULN2003 ..
    8-PIN is ground .. where is Vcc ..

    and also if u having AT89S51 ISP ckt. plz send me..

  13. March 23, 2007 at 12:16 pm | #13

    finally i corrected the circuit diagram. Sorry for all the ones above.

    @ Vishal Uln Will get not have any direct VCC. It will have ground at pin 8. And read datasheet or the post carefully to know what uln does here vishal.

    ISP? u want a circuit for that form me?

  14. Iceman
    May 14, 2007 at 11:33 am | #14

    Hi Madan
    Was wondering is this the easiest way to interface between 4 stepper motors and my PIC16F877 development board, have seen circuits were two motors can be controlled using the ULN2003, is it possible that you might be able to send me a circuit design like this or maybe another alternative. First time acually experimenting with this field of electonics so some help would be great…

    Thanx Ryan

  15. aswadi
    May 21, 2007 at 10:14 am | #15

    Hi Madan

    Is it necessary to put a diode between the COM line and the power supply(16V)? I heard it is to prevent the back emf of the stepper motor…

  16. May 22, 2007 at 7:00 pm | #16

    For small motors it is not. if the rating is higher you might swell put a optical coupler to avoid the bacf emf problem completely.

  17. rohit
    June 26, 2007 at 8:44 pm | #17

    hi madan,
    i just needed 2 knw dat isnt dre ne need 2 power d ic’s… i mean wat abt vcc’s… is dis d complete circuit… don mind.. actually m a noobie in dis field… just askin.. n ya i wanted to knw dat is dre ne way 2 drive a motor of 3.25 A.. i hv heard dat uln2003 cannot drive motors above 1.2 A or sumthin…

  18. June 27, 2007 at 4:12 pm | #18

    @Rohit To drive 3.2 A motors try to use relays. or 2 uln’s one over
    the other. And pls try to type your questions fully.
    Thankyou

  19. rohit
    July 1, 2007 at 12:37 pm | #19

    hi madan…
    thnx for ur reply… i really want ur help regarding dis circuit… i hv seen the datasheet of 877a also n frankly speaking m unable 2 understand it fully.. m a mechanical engg student. plz help me regarding powering 877A n uln2003(i mean vcc’s).. i need the complete circuit.. hope 2 receive ur reply

  20. mukul
    July 7, 2007 at 9:54 am | #20

    madan …dont u think u have to declare i first … int i;

  21. July 8, 2007 at 6:59 am | #21

    @Mukul
    Well do i need to include that? :)

  22. mukul
    July 9, 2007 at 7:00 am | #22

    for me … it says …an undeclared identifier[i] in expression
    in mikroC only

  23. mukul
    July 9, 2007 at 7:51 am | #23

    hey that problem is solved…

    but i have to change delay to delay_ms and 20ms to 20 before i was able to run …thanks it worked….

    but as u know it limits the current to 500ma ….wat if i need to run a motor of around 3.25 A as i need to take up high load….

  24. July 10, 2007 at 7:04 pm | #24

    @mukul
    You are right . and i said do i have to mention that means you have to !!!.

    Then the syntax in MicroC is delay_ms and not delay(20ms)
    That was just a representaiton.

  25. August 2, 2007 at 2:47 pm | #25

    Sir,
    I am very new in stepper motor field.So,I have some problems.Please help me-
    1)please,tell me the significance of the 5th,6th and 7th pin of the ULN2003 IC.
    2)Is there any chip select input in ULN2003?
    3)please,give me the most cost efficient and easy circuit diagram for driving three and six stepper motors by using ULN2003,parallel port and other IC’s(At any time only one stepper motor will be active and others will be disable)but without using AND gates.
    4)Send me the complete C code for robot gripper(three stepper motors) and robot leg(six stepper motors).

  26. Isuru
    August 6, 2007 at 6:01 am | #26

    Hi all…

    I am very new to stepper motors.
    i have to control a UNIPOLAR stepper motor to control a sluice gate in my college Mini project.
    I am using PIC16F877A for my project and i have develope a PIC simulation board and a PIC programmer.
    im using MikroC to program and ic-prog to burn .hex to the chip.

    You guya anyone have a complete circuit diagram (PCB top and Bottom) to do this task?
    do i have to use ULN2003 to do this task????
    does anyone have the source code for above thing???

    pls post a reply or reply to isuru66@gmail.com

    Thanx.
    Isuru

  27. Isuru
    August 6, 2007 at 7:01 am | #27

    Hi all,
    i have try out above source code.
    but it provide 3 errors.. tell me whats wrong in this code….

    void main()
    {
    TRISB = 0×00;
    PORTB = 0×00;

    //routine to move in one direction
    for (i=0;i<50;i++)// increse i=50 no i=100 to cover double the distance
    {
    PORTB=0×80;
    delay_ms(20);
    PORTB=0×40;
    delay_ms(20);
    PORTB=0×20;
    delay_ms(20);
    PORTB=0×10;
    delay_ms(20);
    }

    //routine to move in the other direction

    for (i=0;i<50;i++) // increse i=50 no i=100 to cover double the distance
    {
    PORTB=0×10;
    delay_ms(20);
    PORTB=0×20;
    delay_ms(20);
    PORTB=0×40;
    delay_ms(20);
    PORTB=0×80;
    delay_ms(20);
    }
    }

    \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

    error message is

    ‘;’ expected but x found
    internal error
    internal error

    i think errors are in line 3 o 11

    please give me a solution…

    • edimund
      March 23, 2011 at 9:38 am | #28

      the problem is that: you have to declare i as type int,write delay_ms(value without units)insteady of delay(20ms)and lastly you have to write x in proper way.

  28. mukul
    August 21, 2007 at 1:05 pm | #29

    hey madan …

    u are well known of the fact that with uln2803 i get around .6A what if i need more current as the motor i wanna use has the max rating of 3.25A ,10kg-cms holding torque.Its kinda important for the project to use such high torque motors and these cant be avoided so i m kinda stuck with it.

  29. August 21, 2007 at 4:01 pm | #30

    @mukul
    use a relay to drive motor, and the uln to switch relays.

  30. Aditya
    September 17, 2007 at 1:51 pm | #31

    can you please tell me how to accomplish the above without the microcontrollers???(…i am very much familiar with them.)

  31. October 11, 2007 at 4:57 am | #32

    Which libraries do I have to use to run this code?
    Thanks

  32. Diego
    October 11, 2007 at 5:06 am | #33

    I have another doubt, does this code work for bipolar (6 wires) motors? If not, could you please help me? I’m stagnant about how to drive it using C code.

  33. Kushal
    October 18, 2007 at 6:48 am | #34

    Hey Madan, I was just asking if this code can be put in the MPLAB software and be made to work?
    Regards
    Kushal

  34. Apiz
    October 31, 2007 at 2:10 pm | #35

    i have the same problem with ICEMAN, i use 4 stepper motor.my problem is how is the command to make the stepper motor run the different rotation at the same time?

    like motor a turn clockwise direction while another motor run at counter clockwise direction.

  35. Apiz
    October 31, 2007 at 2:25 pm | #36

    should i change this code to make both run but at the different direction?

    TRISB = 0×00;
    PORTB = 0×00;

  36. November 6, 2007 at 8:32 pm | #37

    it already has code to run in either directions. Just put them in diff functions and call when needed

  37. jayshri
    November 17, 2007 at 12:03 pm | #38

    i want to know the program to run stepper motor.
    i use pic 16f628 and the driver ic is 3967. also i want the interfacing onnection between these ic’s.

  38. susheel
    November 28, 2007 at 6:48 am | #39

    hi all..

    I want to know the

    “configuration of stepper motors”

    to be used in

    “micromouse”

    which are sufficient enough to drive my bot..Im not going for a complicated and high standard bot, but for a simple one ,as a beginner.

    Thankyou for the reply…

  39. Rajib
    January 14, 2008 at 8:04 am | #40

    void main()
    {
    TRISB = 0×00;
    PORTB = 0×00;

    //routine to move in one direction
    for (i=0;i<50;i++)// increse i=50 no i=100 to cover double the distance
    {
    PORTB=0×80;
    delay(20ms);
    PORTB=0×40;
    delay(20ms);
    PORTB=0×20;
    delay(20ms);
    PORTB=0×10;
    delay(20ms);
    }

    //routine to move in the other direction

    for (i=0;i<50;i++) // increse i=50 no i=100 to cover double the distance
    {
    PORTB=0×10;
    delay(20ms);
    PORTB=0×20;
    delay(20ms);
    PORTB=0×40;
    delay(20ms);
    PORTB=0×80;
    delay(20ms);
    }
    }

    i have written this code but when i built then three error is shown below:
    ‘;’ expected but x found
    internal error
    internal error
    plz give me solution

  40. Adnan_Merter
    January 22, 2008 at 10:54 pm | #41

    hi i have a step motor produced by philips and its model MB 11. but i dont know i can drive it. i have a circuit eith ULN integer but i dont know how i can connect the integer and motor. i mean i dont know wire connection. please help me.

    if you want to help me.

    please send me your information:

    adnanmerter@gmail.com

  41. January 23, 2008 at 4:45 am | #42

    hello sir,
    where r the pins of port b connected in 16f877a .i m using 16f877a
    to generate PWM which is connected to the power drive circuit to run the stepper motor.how r the interrupts used.

  42. Chetan
    January 29, 2008 at 5:03 am | #43

    Hey thank you for posting this.

    Does this circuit work only for unipolar Stepper motors? Or it also works for Bipolar Stepper motors. Also, can we distinguish between different pins of the bipolar Stepper motors in the same way as you explained for the Unipolar Stepper motors?

    Thank you

  43. shahin_198
    February 11, 2008 at 7:18 pm | #44

    Sir,
    I am very new in stepper motor field.So,I have some problems.Please help me-
    1)please,tell me the significance of the 5th,6th and 7th pin of the ULN2003 IC.
    2)Is there any chip select input in ULN2003?
    3)please,give me the most cost efficient and easy circuit diagram for driving three and six stepper motors by using ULN2003,parallel port and other IC’s(At any time only one stepper motor will be active and others will be disable)but without using AND gates.
    4)Send me the complete C code for robot gripper(three stepper motors) and robot leg(six stepper motors).

  44. shahin_198
    February 11, 2008 at 7:22 pm | #45

    Sir,
    I am very new in stepper motor field.So,I have some problems.Please help me-
    1)please,tell me the significance of the 5th,6th and 7th pin of the ULN2003 IC.
    2)Is there any chip select input in ULN2003?
    3)please,give me the most cost efficient and easy circuit diagram for driving four and six stepper motors by using ULN2003,parallel port and other IC’s(At any time only one stepper motor will be active and others will be disable)but without using AND gates.
    4)Send me the complete C code for robot gripper(four stepper motors) and robot leg(six stepper motors).

  45. aravinth s
    February 14, 2008 at 4:56 pm | #46

    @shahin_198:

    1.they also similar to the pins 1,2and3 inputs.
    2.so far i didn’t heard any chip select in ULN..

    aravinth.s

  46. Cyril
    February 21, 2008 at 11:54 am | #47

    What about half stepping or microstepping. how can it be done? Does any one have code for that?

  47. biti
    February 25, 2008 at 5:37 am | #48

    Hi,
    I’m currently uskng PIC16F877A and CCS c compiler to do the programming, is it possible to use the above codes with ccs c? i’m relatively new to stepper and micro-controller. hope you would be able to help with this issue. Thanks alot.

  48. fabian
    February 27, 2008 at 9:31 pm | #49

    hi CAn you help me? I need to control four stepper motor with the pic 16f877, then I need the circuit and d the code..

    help please

  49. gaurav
    March 2, 2008 at 12:04 pm | #50

    dear sir,

    I am new in robotics field. I wasted my uptill 14000/- rupees in bilding micromouse . please help I am ery much in trouble. Please tell me the exact coding flood fill algo. or Djiktar’s algo. and there are very few days left in competition please help!!!
    regards
    gaurav

  50. naveen
    March 16, 2008 at 5:38 pm | #51

    hi, i need ur help.i am doing robotic arm project.In ur project we r using 89c51microcontroller.to drive stepper motors we r using latch,optocouplers-(4N35),steppermotordriver(TIP122)in order to run stepper motor.But u r saying that with only one device uln2003 is sufficient to run stepper motors.so wat r the advantages and disadvantages in using uln2003 and cant we use ur method to run motors. which is efficient one in taking into consideration all the factors like cost,efficiency,accuracy etc. i am circuit also.please giv reply at my mailid

  51. haitham
    March 28, 2008 at 8:00 pm | #52

    Unable to compile it in MicroC

  52. vivekz
    April 16, 2008 at 2:55 am | #53

    hey, i am pretty new 2 to stepper motors
    can any body help me with micro c code to control ir sensors pls send ur reply 2 my mail id

  53. July 17, 2008 at 10:44 am | #54

    hi i need circuit and how to give pulse for 4 wire stepper motor

  54. July 17, 2008 at 10:45 am | #55

    hi
    i need circuit and how to give pulses for 4 wire stepper motor

  55. ehtesham
    July 18, 2008 at 7:58 pm | #56

    hi
    i have to do the project on fault analysis of dual stepper motors using pic such that on is stopped by some fault the other motors should automatically starts wotking.the pic i am using is 16F873A WITH TWO ANALOGUE MULTIPLEXER

  56. ehtesham
    July 18, 2008 at 8:00 pm | #57

    hi
    i have to do the project on fault analysis of dual stepper motors using pic such that one is stopped by some fault then the other motor should automatically starts wotking.the pic i am using is 16F873A WITH TWO ANALOGUE MULTIPLEXER.
    i want the code for pic in micro c language

  57. sibashis
    August 6, 2008 at 2:57 pm | #58

    helo sirr i ws rely informtive but cn u plzz advice me how to control speed of a 12v dc motor …i m begner and only know how to synronice led using atmega 16…..my im is to buid a line ollower …i am in 2nd yer….plz avdice me

  58. November 7, 2008 at 7:52 am | #59

    sir
    i new in stepper motor. I dont know how to derive a stepper motor using ULN2003.How i find out the stepper motor wire configuration.

  59. Awais
    November 15, 2008 at 6:38 am | #60

    Hi Madan
    I am doing my final year project for the completion of computer engg degree. THe project is all about controlling the movements of a battery operated robotic arm through the PC’s parallel port.
    THe arm is OWI-007(made by OWI Inc.) The stepper motors need a 3v supply while the parallel port giving me 5 volts! So Should I use a voltage regulator here to step down the voltage or simply use ULN 2803 with my circuit?
    waiting for reply

  60. thando
    November 18, 2008 at 10:28 am | #61

    I’ve tried your code but my unipolar stepper is rotating in the same direction for both loop, what could be the problem??? pls help!!!

  61. Awais
    November 25, 2008 at 5:19 am | #62

    Hi Madan
    I am doing my final year project for the completion of computer engg degree. THe project is all about controlling the movements of a battery operated robotic arm through the PC’s parallel port.
    The arm is OWI-007(made by OWI Inc.) The motors need a 3v supply while the parallel port giving me 5 volts! So Should I use a voltage regulator here to step down the voltage or simply use ULN 2803 with my circuit?
    waiting for reply

  62. sandesh
    December 16, 2008 at 12:44 pm | #63

    hi,
    I am new to this feild of robotics & don’t have any idea about it.I want some help on how to build a robot that can solve the maze i.e. micromouse kind of thing.please help me out

  63. ajeesh
    January 7, 2009 at 2:37 pm | #64

    plz send me the code 2 rotate 2stepper motors simultaneously & independently

  64. ope rawman
    February 3, 2009 at 2:36 pm | #65

    pls ineed help on circuit diagram using 2 stepper motor with 16f877a via uln2003

  65. ope rawman
    February 3, 2009 at 2:38 pm | #66

    ineed help on circuit of 2stepper motor with 16f877a via uln2003

  66. saran
    March 13, 2009 at 4:13 am | #67

    hi madan,

    we need to control a stepper motor using 89c51. we used the same circuit you have posted, using uln 2003. But the problem we are facing is the stepper rotates two steps clockwise and two steps anti clockwise continuously. Its not rotating in the same direction. Help us to fix it…

  67. April 1, 2009 at 8:06 am | #68

    I want to know circuit diagram of 28 v dc stepper motor with input equal to 0.01 v to 15 volts

  68. Amit
    May 7, 2009 at 4:21 pm | #69

    hai madan i m getting a problem in installing the LPT1.exe in my system it is asking for the file HanDes.dll but when i run the file after downloading it is not wprking properly can u please sujjest the optimum solution for this.

  69. santosh
    June 29, 2009 at 4:51 am | #70

    Hello sir i need the program in arm7tdmi based pograming

  70. M Zuhaib
    August 6, 2009 at 7:01 am | #71

    plz send me the deails of (,hardware and software)stepper motor speed controller in my above mentain email id

  71. Amjid Niazi
    September 29, 2009 at 3:29 am | #72

    A lot of thanx dear…….
    Nice efforts…….

  72. Amjid Niazi
    September 29, 2009 at 3:32 am | #73

    has someone control 2 dimentional motors through mouse using 59c51?

  73. priya
    February 18, 2010 at 7:55 am | #74

    hi,
    ur pgm is nice,can u pls help modify the pgm so as to provide rotating a certain angle then a 10 sec pause,again rotating at an angle then pause hence providing a complete 360deg…this is regarding our project

  74. ANUPAMA
    February 26, 2010 at 3:46 pm | #75

    Mam,
    I am a final year engineering student.In our project,we use stepper motor and ULN2003 as the driver..We have to rotate the stepper motor in both clockwise and anticlockwise directions……..When a condition,say true, is met,stepper must rotate in clockwise direction otherwise in anticlockwise direction.program must be written in mikroc..So please help us.pls send me the prgrm.it’s very urgent

  75. nagham
    March 13, 2010 at 4:22 pm | #76

    thank u thank u thank u i will try this ,..how can i rate this ,..oh star star star star star ^_^ sooo happy

  76. madan
    May 27, 2010 at 4:04 pm | #77

    can u please send the code… having a real problem with it

  77. madan
    May 27, 2010 at 4:06 pm | #78

    i am not getting it run…sir/madam….

  78. ansar
    June 5, 2010 at 9:11 am | #79

    The above program is correct.

  79. saqib
    August 14, 2010 at 11:43 am | #80

    Thanks buddy, this was realy very useful for me. we are in the process of making a micromouse. your posts are very much useful for not only to us but also to many other robotics enthusiast…keep up the good work

  80. Rafa
    October 18, 2010 at 5:01 pm | #81

    Hi..just a question… and what is the ULN2003 Vcc? 16v too?
    i try to connect my ULN2803 to 12V and I burned it!! :( do you know why?

  81. samiul alam
    October 20, 2010 at 4:42 pm | #82

    Hello sir,
    i m working on a project using stepper motor
    Model: 24BYJ48-01
    Rated voltage: 12VDC
    Number of Pole: 4
    Speed Variation Ratio: 1/64
    Stride Angle: 5.625 /64
    DC resistance: 200ohm +-7%(25k)
    Idle In-traction Frequency: >600Hz
    Idle Out-traction Frequency: >1000Hz
    In-traction Torque: >29.4mN.m(120Hz)
    Self-positioning Tor: >29.4mN.m
    insulated resistance: >10M ohm(500V)
    insulated electricity power :600VAC/1mA/1s
    Insulation grade: A
    Rise in Temperature:<40K(120Hz)
    Noise; <40dB(120Hz,No load,10cm)
    Weight About: 40g

    i m confused which driver ic would b the perfect as its current rating is high.
    Please inform me the suitable driver ic and possible coding.
    thanks

  82. eng soso
    January 28, 2011 at 3:31 pm | #83

    hello,i am using microbasic ,if i want the motor to rotate only 45 angle clkwise,90 angl anticlkwise,180 angle anti clkwise ,what modificatiion shall i do?

  83. Simeon
    January 13, 2012 at 8:05 am | #84

    Hello
    I am currently working on a robotics project that requires using 2 stepper motors and 3 gear heads to control a 5 DOF robot. I am using either MicroC ar CCS C. I will love any hints available on the coding. Also if anyone has done something like this before, I would please love to see the code used.

  84. saravanan
    January 20, 2012 at 9:53 am | #85

    please send me the code for half step sequence

  85. tom
    February 5, 2012 at 6:34 am | #86

    please send me the code for 90 degree rotation of the stepper motor.

  86. tom
    February 5, 2012 at 6:37 am | #87

    please reply..

  87. February 28, 2012 at 5:56 pm | #88

    hello..i’m doing final year project…can i ask..i m using 16f877a to generate PWM which is connected to the power drive circuit (h-bridge…L298) to run the stepper motor…I’m currently using PIC16F877A and CCS c compiler to do the programming, is it possible to use the above codes with ccs c? I hope you would be able to help with this issue. (^_^)

  88. irshad
    March 27, 2012 at 12:59 pm | #89

    hi, i tried to interface stepper motor with 89s52 and used uln 2003e.. Not able to drive motor.can any one mail the circuit and program to Irshadahmedakp@gmail.co thank you..

    • irshad
      March 27, 2012 at 1:01 pm | #90

      stepper motor should be rotated for 90degree

  89. divy kiran
    May 31, 2012 at 5:13 am | #91

    hai, i have interfaced a sensor with the pic and once its output is “1″ the stepper motor should move to 180 degree. i have tried different methods but the motor is stopping it is continuously running till the sensor is “on”. plz help me how to stop it. m using mplab and c code…

  90. Romim
    June 12, 2012 at 9:28 am | #92

    Hye, thanks for your code.
    I need your help. If i want to rotate stper motor in a 90 degree rotation then what modefication is need.
    Is it possible with yous code or need to write new code???

  91. shani
    September 19, 2012 at 6:06 am | #93

    this program is for….??? clockwise rotation or anticlockwise rotation…..plz tell me….

  92. John Lusinde
    March 1, 2013 at 6:18 pm | #94

    I need code that can control stepper motor, buzzer and LED (green and red), inerval btn motor and the two ie. (red led and buzzer) is 30sec. bt red led and the buzzer are all on at the same time

  93. August 5, 2013 at 10:25 am | #95

    madan :i am not getting it run…sir/madam….

    i want project wireless notice bord can you help me,Rajnigandha

  94. ziad
    January 4, 2014 at 2:52 pm | #96

    how to make the stepper motor goes to 72 degree and stop

  95. Dinesh
    February 11, 2014 at 5:04 am | #97

    How to rotate the stepper motor to 180 degree for forward and reverse in left direction and forward and reverse in right direction..I tried ,but it rotates only one direction ..

  1. June 29, 2006 at 12:33 pm | #1
  2. February 11, 2008 at 11:45 am | #2

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 32 other followers

%d bloggers like this: