Introduction: Easy DC Motor Controller
If you're building a robot or other microcontrolled gadget, you will need to drive DC motors forwards and backwards. In this instructable, I'll demonstrate a simple and inexpensive circuit that controls a DC motor from two I/O pins. It requires no integrated circuits, and uses commonly available parts. I recommend you build it on a breadboard the first time. I designed this circuit, but I'm not the inventor of this type of motor controller. I got interested in motor control circuits like this one when I saw the amazingly precise movements of the Makerbots and CNC routers at Maker Works in Ann Arbor.
Step 1: Parts List
Here are the parts you'll need. All of them should be available at your local RadioShack or hobby store.
(1) DC motor
(4) MOSFET transistors. I used the IRF540N, but any N-channel MOSFET will do.
(4) Diodes
(2) NPN bipolar transistors. I used the BC548.
(2) PNP bipolar transistors. I used the BC327.
(4) 2200 ohm resistors (red-red-red)
(4) 10K ohm resistors (brown-black-orange)
Some jumper wires and a breadboard, if desired
The resistor values are not critical. Values that are fairly close will most likely work fine.
Step 2: The Finished Circuit
Here's a picture of the complete circuit on a breadboard, with some additional part labels.
Step 3: How to Use It
I'm connecting the transistor gates to positive by touching them with a jumper wire in this video, but they also are easily switched by two microcontroller I/O pins. I put a piece of red tape on the motor shaft to make it easier to see.
Step 4: How It Works
When you set pin one high with your microcontroller, the NPN transistor Q7 switches on. This connects the base of the PNP transistor Q5 to ground, turning it on as well. Q5 then connects +12 volts to the mosfets Q1 and Q4, which connect the motor to positive and ground. Setting pin 2 high connects the motor to positive and ground in the opposite polarity. The four diodes protect your transistors from voltage surges that sometimes occur when a DC motor is abruptly stopped. The 10K ohm resistors pull the bases of the transistors to ground when your I/O pin goes low, and the 2200 ohm resistors limit the current that can be drawn from your I/O pins to protect them. Have fun spinning motors! I used two of this circuit for the drive train of my robot butler.

Participated in the
Kit Contest
70 Comments
8 years ago on Introduction
I'm considering making these as kits and selling them. Would anybody be interested in buying a kit if I go through with it?
Reply 5 years ago
You can also sell the PCB and schematic diagram of this motor drive circuit.
Reply 7 years ago
Yes this circuit seems to work exceptionally well, A PCB version would be preferable for durability and professionality. Maybe a variety of circuits with different power handling capabilities. Like a little pack you get with the PCB and the components and you solder them on yourself?
I would like to thank you for this circuit as I was able to adapt it further to create a robot arm controller and control 5 motors with this one circuit.
Reply 8 years ago on Introduction
On what? A breadboard or a circuit board?
Reply 8 years ago on Introduction
Presumably a circuit board. I was thinking a solder-it-yourself type of kit that comes with the necessary parts and a pcb. I could probably do a breadboard or veroboard instead though. What would you prefer?
Reply 8 years ago on Introduction
id be exceptionally interested
higher voltage/amperage ones would be a must for my applications though :)
9 years ago
Hey thank you for this awesome circuit, used it in a trade school project for proportional forward and reversing relative to temperature. I used the IRF511 MOSFETS and boy do they get hot!
Reply 9 years ago
Glad to hear it worked for you! Heat sinks are your friend
3 years ago
What am I missing here? The emitter on Q5 is grounded through the 10k resistor and 12v is applied to the collector. Grounding the base wouldn’t cause any current to flow, since both base and emitter would be at ground potential. Also, I even if it turned on, current would have to flow backwards. Or am I getting this wrong?
5 years ago
If anybody had a file or even made scale pencil drawing which I could convert to file for milling a pcb circuit I would gladly send you a few milled boards..
Question 5 years ago on Step 4
I would really like a pcb layout to mill out a few circuit boards for this. I would certainly be willing to send back a few milled circuit boards in return.
6 years ago
Hello.
I mistakenly emitter the collector in BC327. Can it still be?
6 years ago
how many amps can this handle?
6 years ago
I think you have the collector and emitter swapped on Q5 and Q6 in your schematic. The emitter should go to your supply and the collector should go to the load. PNPs will work with the emitter and collector swapped, but the current gain will be horrible (<<10). More importantly you will be limited to the reverse breakdown of the emitter-base rather than the much larger collector-base breakdown. The BC327 has a emitter-base breakdown of 5V, but your circuit will put 12V across the junction when off - not good!
7 years ago
Very good circuit. It works great
7 years ago
Very good circuit! driving a DC motor with Mosfets. I simulated your circuit with proteus and works great, I builded it up and works pretty good.
7 years ago
Can you please tell me how i connect my arduino or motors to this type of motor driver .
7 years ago
I am curious how you turn on the high side N-MOSFETS in your circuit. To turn these on the gate voltage would need to be significantly higher than the source. In other words, you would need a separate voltage source which supplies the voltage to charge the high side gates. I am unsure why your schematic would even work as the high side MOSFET source is close to 12V already.
7 years ago
Hi,thank you for this great project. I want to control the speed of the motor using pwm with Arduino. How can I do that using this circuit ?
7 years ago
Can you add a simple circuit to run this dc controller with only 1 pmw input which is similar circuit to a L293D driver? I have a Kyosho 370 dc motor.