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.
Remove these adsRemove these ads by Signing Up

Step 1: Parts List

Picture of 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

Picture of The Finished Circuit
Here's a picture of the complete circuit on a breadboard, with some additional part labels.
Akbar1319 days ago


Thanks for such a good information about dc motor controller! :)

I'm planning to make a Segway using Arduino Uno microcontroller. I have two 24V 250W DC motors. Is it possible to control them using this circuit? If it's possible do I have to make two such circuits?

Otherwise I plan buying a sabertooth 2x25 motor driver which costs 128$ :(

H-bridge is much cheaper but I think it can not drive 24V motors.

I'm waiting for any suggestions and recommendations for this project.

Thanks in advance,

mgingerich (author)  Akbar1319 days ago

It's possible to control them using a circuit like this, but you'd definitely have to use different mosfets that could stand up to the high power. If you put them in parallel and add heatsinks and fans you should be able to get it to work. You'd also have to use a 24 volt battery and regulate it down for your arduino. If it might save you $250 then it's worth a shot, right?

Thanks for your reply,

I ask you because you have an experience, could you please provide me parts list like in step 1 above to control 24V 350W or 250W dc motor.

Below I provided a link for the details of motor, I would appreciate your help thanks

Gabse10 months ago
JesusGeek10 months ago
Save up a few hundred, buy these parts from, and start an eBay kit business! (before I do)
wankeye10 months ago
Thanks, I tried this with zero knowledge besides a Google search of various H-bridges and I had pretty poor results. I look forward to looking at yours to see where I went wrong and to try again!
nroche10 months ago
Hey. I can see where the collector / emitter confusion has come from - it's wrong in the PNP circuit on that Adafruit quick reference sheet you linked in. In principle that sheet would be great, but in practice its really not good. They have also made very dangerous generalizations about device pinouts which are definitely not safe blanket statements - they could well confuse the beginner / hobbyist users who they are aimed at even more! Silly people! My advice: take the link down - it will do more harm than good and frustrate people who are trying to learn how this stuff works.
Anyway, that's my 10 cents. Nice instructible though - pretty straight forward and I think I might just use this.
mgingerich (author)  nroche10 months ago
Thanks, looks like I fell into that trap! That reference sheet worked for me, but I probably just had forgiving transistors. I took the link down, maybe I'll find a more accurate one. Wouldn't want to confuse my fellow electronics geeks!
Wyle_E10 months ago
Quibble: the control element of a bipolar transistor is called the base, for historical reasons.

This "H-bridge" configuration is so common that it's available as a single chip from the companies that make power MOSFETs.
mgingerich (author)  Wyle_E10 months ago
Good point about the transistor's base, I'll fix that. I know you can buy integrated circuits that will do this, but where's the fun in that? I try to avoid using ICs in my projects because it forces me come up with my own solutions and I like to use salvaged parts. Thanks for the input!
profpat10 months ago
nice circuits!
mgingerich (author)  profpat10 months ago
Thanks :)
mgingerich (author) 10 months ago
It's been brought to my attention that Q5 and Q6, which are BC327 PNP transistors, appears have their emitter and collector swapped in my diagram. They worked fine for me in this configuration, but you might get different results if you use different transistors. If the MOSFET section of the circuit works, but you have trouble getting the BJTs to switch them, try reversing the emitter and collector.

Get More Out of Instructables

Already have an Account?


PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!