This project uses just three main components to provide forward and reverse control for a single motor.  You can easily interface it to an Arduino or any other microcontroller.

It's so simple - you can wire it up "free-form" without a circuit board in about 15 minutes.

All parts available at Radio Shack for under $9
Supports PWM for variable speed control
Handles up to 5 amps peak / 2.5 amps continuous (5 amps continuous with heatsink)
Controlled using just two pins - "enable" and "direction"

Requires at least 7.5 volts to operate
Relay is rated for "only" 100,000 cycles and may not be appropriate for some high vibration projects
Doesn't provide motor "braking"

The most common way to provide reversible motor control is with an H-Bridge.  A basic H-Bridge is made up of 4 transistors - but commonly end up requiring more like 10 components when you include things like flyback diodes and secondary transistors.  

I wanted something simpler for a CNC project I'm working on - so I came up with this design.  I'm fairly sure I'm not the "inventor" of this circuit - but it's not widely documented.  As far as I can tell it doesn't have a name.

I am hereby naming it the RAT Controller.  RAT being an acronym for Relay And Transistors.

Step 1: Stuff You'll Need

All parts are available at Radio Shack - expect to pay a bit under $9 for the main components.
The same parts are available online for under $4.

12VDC Coil DPDT Miniature PC Relay
Radio Shack Part: 275-249
If purchasing online - try searching for "OMI-SH-212D"

2 x TIP120 Darlington Transistors
Radio Shack Part: 276-2068

2 x 220 Ohm Resistors
Values do not need to be exact.

Optional: Heatsink
A TO-220 size heatsink such as Radio Shack 276-1363 will allow this motor controller to provide 5 amps continuously as opposed to just peak. You'll also need a #6 screw and nut. See the final "Notes" step for information on installing or making your own heatsink out of a pop can.

You'll also need:

Soldering Iron
And solder - any gauge is fine.

Hookup Wire
You'll need some kind of hookup wire to make connections and interface with your microcontroller.
22 Gauge Solid Core Hookup wire works well and easily fits into Arduino headers.
Available at Radio Shack - Catalog # 278-1221

<p>i made that circuit for running 12VDC car seat motor but one transistor (i.e. Enable one just keep burning. What should be possible solution to avoid that? Moreover, i did trying using heat sink and thermal paste but did not work the whole appratus just run for hardly 2 or 3 minutes and then transistor just go bad. Help needed </p>
It sounds like you're just drawing too much current for the tip120 datlington.<br><br>You could try swapping the tip120 with a MJ11032GG (about $10 online). Way more current handling. <br><br>That said - if you're going down that path may make more sense to look at other options (pololu is a good website for motor drivers).<br><br>Good luck!
Great post.indeed simple and useful..can utilize those relays who are depressed from unemployment...thumbs up to you.
<p>I'm considering using this circuit for a project at my internship. The caveat is I'm using a 12V 10A power supply as my motor draws a fair bit of current. I've already sourced a 12V 10A relay but as far as transistors go, I believe I need to go with 2 MOSFETs in order to handle the larger current. Would these work in place of the TIP120s? I'm also assuming the MOSFETs do not have built in flywheel diodes, and so I'm wanting to know where those would fit into the circuit.</p><p>thanks for any help and great instructable btw!</p>
<p>What motor do you use? I like the one in the video, would like to use the same model! Thanks!</p>
actually have no idea of model (was many years ago I got it).<br><br>some places to look for gear motors:<br>http://banebots.com/<br><br>http://www.robotmarketplace.com/products/motors_geared.html
<p>i finally managed to get the device to work.</p>
<p>Great instructable. I used 3 of them to control a robot for a local science fair yesterday and the circuits worked great. The robot worked continuously for 4.5 hours without fail. I am planning on using a similar circuit for a summer camp. I was wondering about the value of diodes to limit surge voltage from the inductors? Anyone have any thoughts?</p>
Glad you like the instructable!<br><br>The tip120 has a built-in snubber diode for some level of back EMF protection:<br>http://www.adafruit.com/datasheets/TIP120.pdf<br><br>I've found them adequate for most of my needs. Other darlingtons I've used have generally had adequate built-in EMF suppression for the kind of loads they were designed for (not saying you shouldn't add another snubber diode - not sure what I'd recommend though).<br><br>Have fun!<br><br>-Rich<br>
<p>Hey guys I have been able to control the motor speed and halt. But I am not able to change the direction I am using this relay http://www.futureelectronics.com/en/technologies/e...</p><p>Kindly help.</p>
<p>hey, i hav built a circuit to control 3 dc motors using icl293d , the operations include forward, reverse and speed control. the code works fine when motors are connected separately, but when powered together, it just stops in between and the resets the program.please help. </p>
It might sound obvious - but I'd make sure you don't have any shorts.<br><br>If you're trying to run all the motors at once - it might be overtaxing your power supply and causing a brown-out.<br><br>Good luck!<br><br>-Rich
<p>im trying to make a east speed control for a small dc motor i dont want to use a h brige simpllifying the design im trying to use a volume control but seems to not work anything i should try using for a control or is it fine i dont want to use an h bride thats the thing</p>
<p>I have built the exact circuit you have, same parts. I wired it up and hooked it up to a motor. The motor immediately turned on as the 12v clicked the relay, it seems like the arduino is doing nothing to the circuit. Volt meter shows the arduino sending signal but the relay isn't switching back. I think the enable transistor is shot, unknown. Thoughts?</p>
I would triple-check all wiring - and verify you're using the same model of relay.<br><br>It's possible the enable transistor is shot - but the darlingtons are pretty sturdy...
<p>Hi, I am planning to build one for a moving santa going up and down on a rope using a 12 volt DC electric motor, could the reverse action of the motor be set to a certain timings (say 2 min) after which the motor will automatically reverse the rotation, for un limited period, until it is shut off? Regards, Nazih</p>
as long as you use a microcontroller (like arduino) - you can do pretty much whatever you want.<br><br>good luck!
<p>So - not totally following what you're trying to do. I think if you're using a i-o-ii type switch with two poles (probably 6-pins total) - that might be enough to do forward / reverse / off on a motor..</p>
<p>Hi,</p><p>I am not too clued up on this sort of thing but I will be making one of these to control the opening and closing of a drawer using a threaded rod and nut, although, I will only be using a 'I-O-II' switch. I assume I would replace that piece of kit for the 'I-O-II' switch? And I assume that 'I' will go forward 'O' will kill it and 'II' will reverse if I use this same setup?</p><p>Thanks</p>
<p>Thanks for this. I was looking for an inexpensive H-bridge I could make from locally-available parts.</p><p>I am new to this type of thing, so forgive me if this is a naive question. If you were only interested in on/off and not PWM, couldn't you use the &quot;enable&quot; pin to drive the coil on an SPST relay which would then connect ground the common pin on the DPDT relay? That way you would only be driving the coils (your DPDT only uses 60ma) and would only be limited by the max current of the relays themselves. The TIP120s should be able to handle just about any size relay (RS sells a 10A DPDT with a coil rating of only 130mA). </p><p>I am asking because I want to use an old cordless drill and I've read that those things can pull over 100A! Thanks again for posting this guide.</p>
Sorry for slow response.<br><br>Yes - I suspect you can add an additional relay after the &quot;enable&quot; TIP120 - and then use it to drive as large a load as it can handle.<br><br>Sounds like a good idea if you're not interested in PWM. You might even be able to do very slow / loud PWM - not sure how long that would last though...<br><br>Have fun!<br><br>-Rich
<p>What would you need to add or do to make the motor go faster forwards and backwards and have a manual mode and auto - mode for 30 seconds involved into the circuit?</p>
<p>This is absolutely brilliant Thanks a bunch for awesome instructions. its exactly what i was looking for as h bridges keep over heating and cooking my BD135 NPN transistors. I owe you a beer. Cheers</p>
<p>Happy to be of service!</p>
<p>hello .. I have tried your circuit but the motor only moves in one direction only .. the delay is still there ... but I still hear the sound Click on the relay ..</p><p>so where is my mistake ... can you explain </p><p>I use tip 122 .. </p><p>relay as you use </p><p>batery 12 v 1.2 AH </p><p>plz help me ... </p><p>tq</p>
If the relay is engaging - but the motor direction isn't changing - I would triple-check how you have the relay wired. (assuming you're using the same kind of relay as described)<br><br>Good luck!<br><br>-Rich
<p>Can I connect two motors to the pins of relay instead of one for my project</p><p>or I need to make two similar circuits?</p><p>and, any other 6v relay should work fine, should nt it?</p>
<p>It worked pretty well until I burned it up. :)</p>
<p>Hi, i stumbled uppon a problem. I can hear my relay switch but when i hook up a 6/9v dc motor to it my motor doesn't turn. I'm using 7.4v.</p>
The relay is only used to switch the direction of the motor - as opposed to actually toggling the power.<br><br>The tip120 connected to the &quot;enable&quot; pin is responsible for toggling the actual power - so I'd start troubleshooting there.<br><br>Good luck!<br><br>-Rich
Hello again. is there a way it can be modified to have &quot;brake&quot;?
Maybe. <br> <br>I think typically motor controllers &quot;brake&quot; by shorting the motor leads. I don't think that's possible with this setup. <br> <br>However - you could try quickly toggling the direction pin (maybe 20hz - 40hz) - and then doing some level of PWM on the enable pin. <br> <br>Can't say if this will work - but it might. It will certainly make some noise though - and might not be very &quot;nice&quot; to the various components...
Hie. would this relay work as well? How do i know which ones are the normally open, normally closed pins and so on? Thanks <br> <br>http://www.jaycar.com.au/productView.asp?ID=SY4065
I believe that relay would work assuming you provide the needed voltage.<br><br>I would suspect there is some indication on what pins do what on the relay itself. Otherwise - I might just experiment using a multimeter.
Hope you don't mind the question but I'm wondering how this circuit could be used to control a high power device, it looks like the 12V-power charges the relay coil and drives the motor, I maybe wrong but is there a way to connect another power source to drive say a 36VDC motor? <br>Thanks for any help,
Should be able to - just find a DPDT relay and &quot;drive&quot; darlington of the values you need. <br> <br>The darlington that triggers the relay can probably stay a tip 120. <br> <br>On this page I mention I higher power darlington option: <br>http://www.nothinglabs.com/openmelt/ <br> <br>(the solid state relay on that page might also be of interest) <br> <br>-Rich
That link takes me to an awesome project thanks!! <br>Maybe I'm confused about the Relay, I notice they have two values one for the coil (I think) and the other for the max load, will the Max-load value work for the coil too, for example below the relay is rated at DC5V 28VDC? <br>Sorry I really don't see how I connect a higher voltage to this, My relays are &quot;JQC-3F(T73) DC 5V 5PIN 250VAC 28VDC Power Relay&quot; <br>I suppose this won't work also because of them being five pin opposed to six?
For this project you'll want DPDT relays - which I don't think those are.<br><br>Good summary on what this means here:<br><br>http://en.wikipedia.org/wiki/Relay<br><br>Relays are commonly rated at a voltage / current required to engage (you can usually go somewhat higher or lower) - and the maximum voltage / current it can switch (often different for AC and DC). <br><br>-Rich
Cool I've ordered some of the DPDT relays and the proper voltage. <br>Thank you for the summary link, you're right it has tones of good information. <br>Also thank you for the reply to my question and great job on the Tutorial. <br>Is it alright if I post something like this on my MOSFET page on electric-canada.com?
Good luck with the build.<br><br>Please feel free to use / share any aspect of this instructable however you like!
Ohh yeah one more thing I was looking at your website and the Arduino Laser show is awesome!!!! <br>http://www.nothinglabs.com/laser/
Just finished a prototype of this to run the motor for the solar forge I'm building. Here is a clip of it running a re-purposed Skil cordless drill:<br> <div> <iframe frameborder="0" height="315" src="http://www.youtube.com/embed/ggq07pLe7IQ" width="420"></iframe></div>
hello friend i have a question about your proyect and it is posible to use with a step direction 3d printer, the 3d printer use an arduino but is the only thing i need or is necesary a interpreter, i use a sprinter firmware, i need some change or only i have to conect direct.
it should be able to drive any standard DC motor. <br> <br>Not totally sure - but your printer may user stepper motors - which won't work with this project.
i dont understand all this circuit connections....can u suggest me any website where i could learn about all this stuff.......plz help me.................
Thanks for your suggestion. I found a wiring that might work for my need: http://www.quasarelectronics.co.uk/kit-files/help-files/uhf-remote-control-reversible-dc-motor-with-limit-switches.pdf <br> <br>If I use the forward and reverse leads (2.5~3v) to activate the top and bottom relays (e.g a SPDT relay, such as this one: http://www.mdfly.com/index.php?main_page=product_info&amp;products_id=444) respectively, and power(+) connected to the top NC, and power(-) to the bottom NO, do you think it will work? I appreciate your comments to a newbie like me.
While I am searching for ways to make my high torque DC motor reversible, I came across this instructable. It is amazing. What I am trying to do is to use a RC car's Transmitter(Tx)/Receiver(Rx) to control my DC motor's rotation(forward/reverse). The outputs from the Rx are one forward and one reverse which may be &quot;high&quot; depending on what is triggered on the Tx side. It works for low power DC motors. However, it is too weak to drive a high torque motor. So I need to get extra power to drive my motor reversibly. Is this control can be modified in some way to meet my need if I use the outputs from Rx as triggering signals (Say forward connects to one transistor and reverse links to another transistor)?
Hard to say - but maybe.<br><br>You might try connecting both leads from the RC car to the &quot;enable&quot; pin through their own diodes. Then - additionally connect just one of the leads directly to the reverse pin.<br><br>I think this -might- work (or it might make smoke). <br><br>have fun / good luck!<br><br>-Rich
I am planning to buy a new DC motor driver board which can run 5amp motor but I don't know how to connect it with Atmega 8A chip. Please see the pdf I attached for Atmega 8A.<br> <br> Here are the 7 pins in DC motor controller:-<br> <br> Pin No. Pin Functionality<br> 1 GND Ground<br> 2 IN-1 Logic input for the motor direction.<br> 3 Diagnostic 1<br> (DG-1) Output pin with logic 1 output in normal operation. Represents side of the internal<br> H bridge corresponding to IN-1. Pin is pulled to logic low by the motor driver in<br> case of over temperature or overload due to short circuit.<br> 4 PWM Used to apply Pulse Width Modulation to control motor velocity<br> 5 Diagnostic 2<br> (DG-2) Output pin with logic 1 output in normal operation. Represents side of the internal<br> H bridge corresponding to IN-2. Pin is pulled to logic low by the motor driver in<br> case of over temperature or overload due to short circuit.<br> 6 IN-2 Logic input for the motor direction.<br> 7 CS* Current Sense output to measure the current flowing through the driver

About This Instructable


188 favorites


Bio: Hi, I'm Rich Olson (nothinglabs.com). I sell cloud chambers for viewing radiation, make robots and dev software. If you need something prototyped - I ... More »
More by nothinglabs: 3D Printed Bike Shifter (friction) 2-Layer Circuit Boards Using Laser Cutter / Chemical Etching Laser Cut Circuit Boards
Add instructable to: