Continue to Site

# high current motors and PIC

Status
Not open for further replies.

#### blibala

##### New Member
i am building a big car using few high wiper motors.do i need to use seperate batteries for motors and the PIC circuit?or i can share one battery among all circuits?

Using 2 separate batteries would be ideal. Whatever noise or spikes your motors generate, they would never interfere with the pic. But it is possible to run them all from the same battery

today i connected a steper motor drive circuit shown below, that will forward(RA0 switch), reverse(RA1 switch) and stop(RA2 switch) but i faced problems.
the program code is shown below.
TRISB=0
TRISA=255

start:
IF PORTA.0=0 Then Forwardmotor
IF PORTA.1=0 Then Reversemotor
IF PORTA.2=0 Then Stopmotor
GoTo start

Forwardmotor:
PORTB.0=1
Pause 100
PORTB.1=1
Pause 100
PORTB.2=1
Pause 100
PORTB.3=1
Pause 100
IF PORTA.0=0 Then Forwardmotor
GoTo start

Reversemotor:
PORTB.3=1
Pause 100
PORTB.2=1
Pause 100
PORTB.1=1
Pause 100
PORTB.0=1
Pause 100
IF PORTA.1=0 Then Reversemotor
GoTo start

Stopmotor:
PORTB.0=0
PORTB.1=0
PORTB.2=0
PORTB.3=0
IF PORTA.2=0 Then Stopmotor
GoTo start

i get this from a book but when it was connected, so many problems i faced.
(1)the output of 4050 hex buffer should be same as its inputs, that is, about 5V.but when i measure the output from the 4050, the outputs are only 1.3V only.i double check the connection but its correct.whats wrong with it?

(2)is it when i make a pin HIGH,the pin will continue HIGH until i make it LOW?it is becasue when i measure the output pin(when i try to make the motor forward and reverse), all the pins are at HIGH level.

(3)the circuit seems to draw more than 3A from the DC power supply.but the motor rating is only 2A.why?

hope someone can solve my wuestion

#### Attachments

• fig04.gif
9.3 KB · Views: 886
(1)the output of 4050 hex buffer should be same as its inputs, that is, about 5V.but when i measure the output from the 4050, the outputs are only 1.3V only.i double check the connection but its correct.whats wrong with it?
Because the the outputs of the 4050 are directly connected to the base of the darlington transistors. To the 4050, the load is like two diodes in series and therefore cannot go higher than 1.3V.

(2)is it when i make a pin HIGH,the pin will continue HIGH until i make it LOW?it is becasue when i measure the output pin(when i try to make the motor forward and reverse), all the pins are at HIGH level.
Yes, the pins will remain high until reset. However your code only sets the the outputs to HIGH but does not reset them to LOW. Eventually all of the outputs will be in the HIGH state. One excitation sequence for the stepper drive is as follows:
FWD REV
0001 1000
0010 0100
0100 0010
1000 0001
Repeat sequence until stopped.

FWD REV
0001 1000
0011 1100
0111 1110
1111 1111

(3)the circuit seems to draw more than 3A from the DC power supply.but the motor rating is only 2A.why?
Because of the reason above. Also, step motors are rated in Amps/phase. There are motor excitation methods that energize 2 of the 4 windings at the same time and therefore consume double the rated current. Finally, the current will depend on the voltage you apply to the windings.

Status
Not open for further replies.

Replies
7
Views
2K
Replies
28
Views
6K
Replies
18
Views
3K
Replies
5
Views
4K
Replies
8
Views
2K