# how to interface dc motors with 8051

#### anubhav_1986

##### New Member
hey can i use uln 2803 for interfacing dc motors with 8051?? can any1 provide me the circuit??

#### ikalogic

##### Member
what is the rating of the motor you are using?
how much current required?

#### gramo

##### New Member
I believe the ULN2003 is similar, but only has 7 outputs instead of 8 as the one your inquiring about. Both are rated for 500mA from memory, so if your motor requires more than that, Consider using a FET.

Heres a diagram on how to interface one with a unipolar stepper motor, a DC motor would be very similar, but only has a single winding to control;

Click here to watch this circuit in action

Generally because of the high current requirement of DC motors, FETs are the way too go. You can control copious amounts of current with a FET, and the IRL2203 is a great little logic driven FET.

Click here too watch this circuit in action

You have to be careful about how much current the FET is driving & how long it takes to switch.

The FET has a bias point, where it has resistance as it turns on or off. During this phase, there will be a voltage dropped over the FET & current running through it - it can dissipate massive amounts of power in the form of heat.

Without a drive circuit, your FET will burn out over time. Logic devices are very limited to the amount of current they can deliver, and the problem is that the Gate acts like a capacitor, and takes time to "charge" and "discharge". A PIC micro is capable of 25mA MAX per output, pro-longing this charge time significantly. As a result, there’s an instantaneous heat build up, that will reduce the life of the FET every time it occurs.

Using a Drive circuit allows the FET to turn On and Off much faster, limiting the amount of time it spends at the "bias point" - reducing the heat developed on the FET.

#### ikalogic

##### Member
Gramo, on your first schematic, you'r missing 4 other diodes between the ULN o/p and 12V... even if it works that way.. that's what we learnt in Power electronics...

#### anubhav_1986

##### New Member
8051

hey thanx for providing me with circuit for interfacing but i am a lil confused , the circuit u provided is interfacing ULN2003A with PIC16F876. i want to know is PIC16F876 same as 8051? sorry the question may sound dumb but want to clear my doubt n also tell me that if i can use the same circuit with 8051?

#### anubhav_1986

##### New Member
ratings

ikalogic said:
what is the rating of the motor you are using?
how much current required?
12-24 Volts, 150-200 rpm

#### gramo

##### New Member
ikalogic said:
Gramo, on your first schematic, you'r missing 4 other diodes between the ULN o/p and 12V... even if it works that way.. that's what we learnt in Power electronics...
Doesn’t the ULN2003 have those ones built in?

Pin 9 is the common to Vcc, and the built in diodes protect the ULN2003 from EMF caused by inductive loads, I could be wrong

Last edited:

#### ikalogic

##### Member
gramo said:
Doesn’t the ULN2003 have those ones built in?

Pin 9 is the common to Vcc, and the built in diodes protect the ULN2003 from EMF cause by inductive loads, I could be wrong
no you'r not wrong, i am! but i usually add additional protection diodes...

Loading