Easy DC Motor Controller





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

This circuit is designed to run a motor from the same power source as your microcontroller. Setting I/O pin 1 high makes the motor spin in one direction, and setting pin 2 high makes it spin in the other. Setting both pins low stops the motor, so speed control can be achieved through a PWM signal to a pin. I should also mention that setting both pins high at the same time shorts your battery, and should be avoided. I used a 12 volt power supply I made, but you could go as high or low as your transistors can handle. If you are driving very large motors, I recommend putting the MOSFETS on a heatsink or fan. Attached is a video of the circuit in action. 

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.



  • Paper Contest 2018

    Paper Contest 2018
  • Pocket-Sized Contest

    Pocket-Sized Contest
  • Science of Cooking

    Science of Cooking

We have a be nice policy.
Please be positive and constructive.



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.


I'm considering making these as kits and selling them. Would anybody be interested in buying a kit if I go through with it?

You can also sell the PCB and schematic diagram of this motor drive circuit.

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.

On what? A breadboard or a circuit board?

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?

id be exceptionally interested
higher voltage/amperage ones would be a must for my applications though :)

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!

Glad to hear it worked for you! Heat sinks are your friend

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..


I mistakenly emitter the collector in BC327. Can it still be?