Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

[SOLVED] 8051 interfacing with stepper motor using uln2003

Status
Not open for further replies.

pradeep23

Member level 5
Joined
Aug 20, 2012
Messages
86
Helped
3
Reputation
6
Reaction score
2
Trophy points
1,288
Activity points
1,866
hi everyone i am doing one simple project like 8051 interfacing with stepper motor using the driver ic ULN2003 in this i have connected like 2 inputs (p2.1) (p2.3)and 4 outputs from(p2.13,14,15,16)..................i didnt get the output .........is der anything in that connections or in my program plz help me to do this...............
 

milind.a.kulkarni

Advanced Member level 3
Joined
Oct 6, 2011
Messages
923
Helped
214
Reputation
428
Reaction score
208
Trophy points
1,333
Location
Bangalore
Activity points
7,438
first is put your circuit diagram and then code on the forum such that one can able to anticipate what is problem ?

RD milind
 

pradeep23

Member level 5
Joined
Aug 20, 2012
Messages
86
Helped
3
Reputation
6
Reaction score
2
Trophy points
1,288
Activity points
1,866
hi everyone i am doing one simple project like 8051 interfacing with stepper motor using the driver ic ULN2003 in this i have connected like 2 inputs (p2.1) (p2.3)and 4 outputs from(p2.13,14,15,16)..................i didnt get the output .........is der anything in that connections or in my program plz help me to do this...............
this was my program for the below circuit...........











#include<reg51.h>
#include<stdio.h>

void delay(){
unsigned char i,j,k;
for(i=0;i<6;i++)
for(j=0;j<255;j++)
for(k=0;k<255;k++);
}
main()
{
while(1)
{
P2=0x0c;
delay();
P2=0x06;
delay();
P2=0x03;
delay();
P2=0x09;
delay();


}
}

- - - Updated - - -

please help want to change anything from that circuit or in programs..................
 

Attachments


Joined
Jul 25, 2012
Messages
1,192
Helped
170
Reputation
340
Reaction score
161
Trophy points
1,343
Activity points
0
See this attachement

The data you are sending to P2 is

1100
0110
0011
1001

So P2^0 and P2^1 will be 00 for first signal
then it becomes 10
then it becomes 11
then it becomes 01

assuming p1 and p2 in the diagram is connected to P2^0 and P2^1

so your uln2003 i/p and hence o/p will be

for 00 it will be 0101
for 10 it will be 1001
for 11 it will be 1010
for 01 it will be 0110

so check if uln2003 o/p sequnce is right for stepper.

if P2^2 and P2^3 is connected to P1 and P2

your signal is

11
01
00
10

uln2003 i/p and o/p will be

1010
0110
0101
1001


-----------------------------------------------------------


if you have connected P2.1 and P2.3

then your mcu o/p is

10
01
01
10

so uln2003 i/p and o/p is

0110
1001
1001
0110

check if uln2003 o/p sequence is right for stepper or not.





uln2003 o/p should be

1100
0110
0011
1001

to drive unipolar properly in full step mode.

and you cannot generate 1100 because

Pin1 = 0 means uln2003 pin 1 = 0 and pin 2 = 1
pin2 = 1 means uln2003 pin 3 = 1 and pin 4 = 0

so you get 0110

http://www.robosense.in/index.php/...r-motor-using-atmel-avr-microcontroller.html
 

Attachments

Last edited:

pradeep23

Member level 5
Joined
Aug 20, 2012
Messages
86
Helped
3
Reputation
6
Reaction score
2
Trophy points
1,288
Activity points
1,866
yes sir i done dat about circuit ..........but in that i am using only two inputs for uln2003 and 4 outputs............motor is not running .......what will be the problem...........
 
  • Like
Reactions: kewal

    kewal

    points: 2
    Helpful Answer Positive Rating

jjeevan007

Full Member level 5
Joined
Apr 13, 2012
Messages
311
Helped
44
Reputation
88
Reaction score
43
Trophy points
1,308
Location
bangalore
Activity points
2,781
y dont you use the 4 pins to drive the stepper motor........
 

pradeep23

Member level 5
Joined
Aug 20, 2012
Messages
86
Helped
3
Reputation
6
Reaction score
2
Trophy points
1,288
Activity points
1,866
but you saw the circuit sir i attached to that one we can use like that............sir
 

Joined
Jul 25, 2012
Messages
1,192
Helped
170
Reputation
340
Reaction score
161
Trophy points
1,343
Activity points
0
See this sequence

1100
0110
0011
1001

Can you generate the necessary 2 bits to get this o/p

read the above sequence form right to left. 0th byte comes from P2^1, and 3rd byte comes from P2^3.

if the code should be 1100 then how will you generate 2 bits for it.
 

pradeep23

Member level 5
Joined
Aug 20, 2012
Messages
86
Helped
3
Reputation
6
Reaction score
2
Trophy points
1,288
Activity points
1,866
why to use relays ...........

- - - Updated - - -

i attached my circuit in that

any problem in that circuit
 

Joined
Jul 25, 2012
Messages
1,192
Helped
170
Reputation
340
Reaction score
161
Trophy points
1,343
Activity points
0
Are you driving stepper motor or dc motor? you have used dc motor in simulation.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top