loading

Many projects with Arduino often need motors, whether it is a car or a vacuum cleaner or anything else. But the problem is that you cannot connect a motor directly to Arduino as the output current is very low. So, you can use an H-bridge circuit to operate the motors. The H-bridge circuit can operate the motors in both directions (clockwise and anti clockwise), but in many projects you don't need a motor to turn in both directions (e.g. fan). In such cases, it is a waste of money to buy an H-bridge circuit. So, in this instructable I'm going to show you how to make a motor driver board using transistors which can power two motors. This motor driver board will be able to operate the motors only in one direction, but would be cheaper than an H-bridge (E.g. For me, H-bridge would cost about Rs 150+ , whereas I could make this board in about Rs 30); and more importantly it's fun to do it.

Step 1: Components and Tools Needed

COMPONENTS:

2* BC-547 Transistor (NPN)

2* 1k Ohm resistor

2* capacitor (between 1 and 5 uF) (I used 2.2 uF)

Stack headers

Perf board (Any size you like, you can cut it later)

Bread Board (for prototyping)

Single stranded wire

TOOLS:

Soldering iron

FOR TESTING;

Arduino (Any will do)

9v Battery

Step 2: The Circuit

Now, for the circuit. There are two transistors which do the same thing, have the same connections except the motors they power are two different ones, and their bases are connected to two different pins on Arduino, one is connected to pin 10 and the other 11 (refer to first picture).

When either of the transistor's base goes HIGH, it forms connectivity between the collector an the emitter (refer to the second picture) . As +9v is connected the collector and the motor is connected to the emitter the motor starts spinning (refer to the first picture). The capacitor is connected to protect the Arduino from noise created by the motor.

Now assemble the circuit on your breadboard, as it is not a good idea to do it on the perf board before making sure that your circuit is working (diagram shown in first picture). To make sure that your circuit is working upload the sketch given below. Connect the battery as shown in the first picture.

If your circuit works, then the motor would be stationary at the beginning then will gradually increase its speed then stop again (the same thing would keep repeating).

Step 3: Perf Board It!!

If your circuit works then it's ready for perf boarding. I haven't made it as a shield because it uses very few pins of the Arduino so, it is much harder to make it as a shield. Instead I have made it as a separate board with wires sticking out of it which you have to connect to the Arduino. But if you like, you can make it as a shield (here is a link to help you on how to make shields - https://www.instructables.com/id/How-to-Make-Custom...) .

To create a circuit board, solder all components shown in the fritzing image above to your perf board (except for the Arduino, of course). If you don't know how to solder on perf board watch the video below (This is not my video, of course).

After you have finished soldering on the perf board, test it out and your motor driver is ready!

<p>So I tried this instructables and its not working! :/ damn transistors. I hooked everything up correctly and the transistor either did nothing or started to heat up. I got some new transistors (not radioshacks assorted transistors) and I still cant get the circuit to work..... the npn transistor seems fine when checked with an ohm meter but circuit will not work when I try to dry run (without the arduino). Any help would be great, I might post my question on electrical engineering stack exchange.</p>
<p>really sorry for the late reply.</p><p>Make sure you have wired it all properly. If it all seems right then try connecting the motor to the collector and the emitter directly to gnd .If it still doesn't work just post the picture of the one you made.and I'll try to tell you anything further.</p><p>Thanks</p>
<p>Thanks for the help! The transistor gets hot to the touch and the motor will continue to run when I pull the transistors base up to 9v + and disconnect it. The motor will stop if I disconnect the power supply.</p>
<p>Hope you liked the project. Please tell me if you have any suggestions or ideas.</p><p>Thanks</p>
<p>A trouble shooting section. lol so I guess my discription above means it working?</p>
<p>Sorry, I misunderstood your previous comment . It is quite weird that you need to pull the base to 9v. Try connecting the motor between 9v , the collector and connect the Emitter to Gnd. You will get a better voltage to your motors that way. If that still doesn't work tell me.</p><p>thanks </p>
<p>Another remark: in your circuit you first put your load, and then your transistor or mosfet. Otherwise you won't have 9V over your motors as you can see in the link below </p><p><a href="http://goo.gl/vSLRCM" rel="nofollow">http://goo.gl/vSLRCM</a></p>
<p>Thanks for telling me. I saw the simulation but I did not understand why that happens and how it makes a difference. Could you tell me?</p><p>Thanks. </p>
The voltage at the emitter can maximum be 0.7V below the voltage at the base. So in the case where the load is connected to the emitter, the load only sees 4.3V approx. Over a 1k resistor, you have 4.3mA. The transistor is a current amplifier (x100 approx.) So the current flowing thru the base is 4.3/100 = 43&micro;A. Over the 1k resistor at the base, you have a voltage loss of 43&micro;A*1k=43mV. (so in reality there is only 4.957V at the base)<br><br>When the load is connected to the collector, you can see that the emitter is grounded (0V) So in theory, when you have 4.3V over a 0 ohm resistor, you have infinite ampere. So the resistor at the base counts. There you have 5V-0.7V (from the transisitor) over a 1k resistor. this gives 4.3mA. The transistor amplifies this to maximum 0.43A. With the load of 1k and a voltage of 9V, you need around 9mA. Which is a lot less than the maximum that the transistor can deliver.The full power is released to the load.<br><br>Hope this helps, if not, just ask...
<p>Thanks. It was really help full. If you have any more suggestions please tell me.</p>
<p>easy project. but i think using breadboard is a good idea for prototyping. see how i started from breadboard and shifted to box here <a href="https://www.instructables.com/id/Arduino-Based-Solar-PV-Energy-Meter-With-Xively-Co/">https://www.instructables.com/id/Arduino-Based-Sola...</a></p>
<p>Thanks, I saw your intructable and it is great. It is a really nice idea to use a old router as a case. Please tell me if you have any more suggestiones.</p>
You are welcome :) if you need any help with arduino i will be there :)
<p>Nice project. I like seeing folks still making one-off circuits. Days past so many folks were into making circuits, but it seems computer tech has removed so much of the basic component ideas these days. </p><p>It seem like you are basically using the NPN transistor(s) for on/off switching transistors. If that is all you are doing, a relay would work equally well. But you could use the Arduino to drive the motors through a variable speed circuit using transistors or even MOSFETS. Just a thought. Nice project anyways and glad you are into electronics. A very good field to be into by the way!</p>
<p>I guess MOSFET's would be the better option since they can handle higher current for larger motors.</p>
<p>You could use a MOSFET, but it isn't necessary for small motors like the ones I used in the picture. BTW if you have any suggestions please tell me.</p>
<p>Thank you. Yes of course you can use relays instead of transistors which will work fine. But as I'm not using any heavy duty motors and I'm using a simple 200 mah 9v battery it is not really necessary to use MOSFETS or relays. But if you are using a high power battery or power hungry motors you could use them.</p>
<p>I fully agree.<br>However, though I built many circuits in my days, it seems we have come to a point that at least financially it isnt worth building various things anymore, seeing what the price for e.g. a motordrive module is nowadays.<br>I know some people critcise me for remarks like this, but it is just a fact. Still buying a module doesnt beat the satisfaction of indeed grabbing a few components, soldering them together and see it work.<br>Well done</p>
<p>Just curious: instead of capacitors to reduce noise, could you use diodes between the Arduino and the motors? It seems like that would protect the Arduino from noise and from stray currents.</p>
<p>Yes you can, like like the person above mensioned you can use Fly back diodes instead of a capacitor.</p>
<p>I'd suggest using flyback diodes to prevent current surge from motors</p><p>https://en.wikipedia.org/wiki/Flyback_diode</p>
<p>Thanks. I am pretty new in electronics so please continue giving such suggestions. I checked the Wikipedia page and I think a fly back diode will work</p>

About This Instructable

6,330views

159favorites

More by Tanmay Deuskar:The Attiny85/45 Capacitor Tester DIY H-Bridge Shield for Arduino With Transistors The Tic Tac Adjustable Power Supply 
Add instructable to: