PIC to ULN2803 to Stepper Motor Interface

Status
Not open for further replies.

jenny1985

New Member
Hi,
I connected a PIC16F84 to a ULN2803 5volt driver to a 5volt 6-wire stepper motor. The motor was running for about 20 seconds, then stopped and it will not start again. Even if I turn off power and turn it back on.
Here is my code to control / pulse the stepper motor.
Attached is my schematic. Any idea why it would quit and then not work again?
Jen


start

movlw 0x00
tris PORTA

loop
movlw b'00000101'
movwf PORTA
call DELAY_20
movlw b'00001001'
movwf PORTA
call DELAY_20
movlw b'00001010'
movwf PORTA
call DELAY_20
movlw b'00000110'
movwf PORTA
call DELAY_20
goto loop
 

Attachments

  • stepper.JPG
    35.4 KB · Views: 21,306
The ULN2803 continuous collector current is 500ma - so you most likely didnt burn the transistors out..

The code looks fine, although im do not know which digital sequence is used to drive unipolar stepper.

Although I highly doubt it - could the stepper be out of range of the magnets (though i didnt even think this is possible)

If it made a full rotation then the above problem should not be consider^

I wish I could give some better insight.. im sure a more expierenced member will post soon.

Goodluck
 
Forgot to mention to try with the other 4 transistors of the ULN array.. if they motor moves like normal immediately turn the power off so you dont kill the transistors..!

Then use power transistors or MOSFETS.
 
You don't have current limiting resistors at the input to the ULN. The PIC can output 20mA minimum, the max is not specified. Perhaps the base-emitter junction is fried, use your diode checker to see if the ULN input still looks like a diode.
 
You don't have current limiting resistors at the input to the ULN. The PIC can output 20mA minimum, the max is not specified. Perhaps the base-emitter junction is fried, use your diode checker to see if the ULN input still looks like a diode.

the ULN2803A has a 2.7kW input resistor for 5V TTL and CMOS.
 
Sorry... Actually, yes I do have it grounded. I just neglected to put in the gnds on the schematic to speed things up for posting the picture. Yes, it was very weird, it worked for a while then stopped, I reprogrammed the PIC with some updated code and tried it again and it worked for about 20-30 seconds then stopped and didn't go again.
Any other ideas?
Jen
 
Last edited:
try using a simpler step sequence like this:

1000, 0100, 0010, 0001

also make sure your leads are in the correct order ... you may also want to slow down the pace of your steps a little, try increasing the delay between each step.
 
Got it!
MCLR needed to be tied high via 100 ohm resistor... and I had to lower my delay - it was a little too quick.

Thanks for all the help guys! You have proved to be a valuable resource!
 
jenny1985 said:
Got it!
MCLR needed to be tied high via 100 ohm resistor... and I had to lower my delay - it was a little too quick.

Thanks for all the help guys! You have proved to be a valuable resource!

Glad to hear!!
 
jenny1985 said:
Got it!
MCLR needed to be tied high via 100 ohm resistor... and I had to lower my delay - it was a little too quick.

Thanks for all the help guys! You have proved to be a valuable resource!

woot, nice work
 
i need program 180 degrees right and 180 degrees left in hex code to run stepper motor
i make project
please help me
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…