It's so simple - you can wire it up "free-form" without a circuit board in about 15 minutes.
Features:
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"
Limitations:
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.
Remove these ads by
Signing UpStep 1: Stuff You'll Need
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


















































Visit Our Store »
Go Pro Today »




Not totally sure - but your printer may user stepper motors - which won't work with this project.
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&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.
You might try connecting both leads from the RC car to the "enable" pin through their own diodes. Then - additionally connect just one of the leads directly to the reverse pin.
I think this -might- work (or it might make smoke).
have fun / good luck!
-Rich
Here are the 7 pins in DC motor controller:-
Pin No. Pin Functionality
1 GND Ground
2 IN-1 Logic input for the motor direction.
3 Diagnostic 1
(DG-1) Output pin with logic 1 output in normal operation. Represents side of the internal
H bridge corresponding to IN-1. Pin is pulled to logic low by the motor driver in
case of over temperature or overload due to short circuit.
4 PWM Used to apply Pulse Width Modulation to control motor velocity
5 Diagnostic 2
(DG-2) Output pin with logic 1 output in normal operation. Represents side of the internal
H bridge corresponding to IN-2. Pin is pulled to logic low by the motor driver in
case of over temperature or overload due to short circuit.
6 IN-2 Logic input for the motor direction.
7 CS* Current Sense output to measure the current flowing through the driver
I haven't used an EMF protection diode with this circuit before (and haven't done too much with them in general) - so take this with a grain of salt.
I would place the diode between the transistor's collector and the positive input voltage. Wire it so the arrow points towards the positive voltage input (the other way round will cause a short).
more info here:
http://www.learnabout-electronics.org/ac_theory/inductors02.php
Sizing is a good question. There is some info at link above. The back EMF voltage can be higher than the driving voltage. Might look for something that can handle the input current at some multiple of the voltage than your'e driving it at. Might be able to get away with something less beefy since it's not getting hit constantly.
Good luck!
-Rich
HLS-4078-12vDC
www.helishun.com/hls-4078.html
1k resistor
and tip122
everything works fine but reverse. i suspected 6 volt battery was a problem but i am using a 12 volt battery now.
Please help
You'll loose some voltage through the transistor - and if the battery is too small - it'll drop more when it tries to turn the motor.
Easy test is to leave enable off - and then just toggle reverse back-and-forth in code. Make sure you hear the relay go "click"
Thanks!
what kind of 12v battery are you using?
Any ideas?
good luck!
-Rich
suspect it would probably not work.
hope this helps!
-Rich
I get the feeling something is fundamentally wrong because no power comes through to the motor when it's supposed to be running in reverse.
any ideas?
this might sound really generic - but I would triple-check all the wiriing.
is it possible anything is backwards / upside down?
I'm assuming you're not really using a stepper motor - but some kind of geared DC motor (stepper motors require very special drivers).
Good luck - let me know how it goes.
-RIch
anyways I ordered a motor controller because I'll need to use servos too. this was a good experiment and got us an A on our class project, so thank you.
if you poke around online - you should be able to find some relays that would work fine at lower voltages.
glad you got it working!
-Rich
is it possible you connected your battery to VSS instead of VIN? that might do it.
I've found pushing the reset button just before programming can help it take an upload (shouldn't need to do this - but sometimes helps)
also - trying another USB port might help.
-Rich
I only asked you because you seem to know more than me about this stuff and I was desperately trying to find the problem. The seller has agreed to ship me a new arduino provided I return the dead one. Going to be a long wait from hong kong.
on the other hand - if you're not even seeing it as a serial port - that does sound like a hardware issue.
i will mentiin that while I've generally had good luck with clone arduino (pretty mcuh anything from asia) - I've maybe had a few more issues with them than the ones actually from italy.
good luck!
-Rich
I went ahead and ordered a motor controller based on the L293D from ebay. Just waiting for it to arrive from hong kong...
Im planning on building an autonomous vehicle that uses skidstearing. So basically like a little tank. Ive got alot to learn. Right now im pretty much just finding tutorials like this and copy/pasting code. Ive yet to come up with anything on my own.
good luck with your robot!
copy/pasting is a pretty good way to learn stuff. I suspect a large amount of commercial software is developed like that...
-Rich
having read your Instructables, I'm wondering
why you use a relay to control a motor?
You could build a simple H-Bridge
and drive the MOSFETs with transistors.
Please have a look at this link:
http://www.instructables.com/id/H-Bridge-on-a-Breadboard/
Ciao Frank
and of course resistors or go straight for
an H-Bridge such as SN754410. Parts are readily available.
1.) Before you power up (every time) make a coil of solder on the tip so that it melts as the iron warms up.
2) Always add solder to the tip before setting the iron in the holder. Some people say keep the tip clean but that only applies to the dross (blackish metallic stuff that builds on the tip that doesn't melt), it is best to always have solder on your tip.
3) Add a large blob of solder to the tip as you turn the iron off so that there is a blob on it while its being stored.
4) Never...I will repeat NEVER use your soldering iron for anything except solder.
Air exposure while heated is what damages the tip mainly. Your solder joints will flow better and easier with a maintained tip.
These are the things I was taught in industry by 30 year solderers.
I agree about the sponges...some people overuse the sponge, I only use it if there is dross on the tip. My tip is a few years old and looks new.
I've gotten lazy and just crank the heat up until it works... which I'm sure compounds the problem.
I also have the bad habit of leaving it on for long durations.
I'll probably swap it before I do anything which requires precision...