The H-Bridge is a circuit which can drive a motor in forward and reverse. It can be a very simple circuit that requires only a handful of components to build. This Instructable demonstrates how to breadboard a basic H-Bridge. Upon completion you should be familiar with the basic operation of an H-Bridge and be ready to move on to more complicated versions that can support larger, more powerful motors.

Step 1: Gathering the Parts

Only a handful of parts are needed.

1) A bread board
2) A small DC motor capable of operating at ~7 volts
3) A 9-volt battery and battery snap
4) Four small signal NPN transistors. We're using the 2N2222A here. 2N3904 is another common part number and thousands of others will do.
5) Four 22k ohm resitors
6) Two push button switches
7) Jumpers or spare wire to hook everything up

Step 2: H-Bridge Theory

The H-Bridge is a circuit which can drive a DC motor in forward and reverse. The motor direction is changed by switching the polarity of the voltage in order to turn the motor one way or the other. This is easily demonstrated by applying a 9-volt battery to the leads of a small motor and then switching the terminals to change directions. The H-Bridge is given it's name based on the basic circuit which demonstrates it's operation.

The circuit consists of four switches which complete the circuit when applied in pairs. When switches S1 and S4 are closed the motor gets power and spins. When S2 and S3 are closed the motor gets power and spins in the other direction. Note that S1 and S2 or S3 and S4 should never be closed together in order to avoid a short circuit.

Obviously physical switches are impractical since no one is going sit there flipping switches in pairs to get their robot to move forward or in reverse. That's where the transistors comes in.

A transistor acts as a solid state switch that closes when a small current is applied to it's base. Because only a small current is required to activate a transistor we are able to complete one half of the circuit with a single signal.

That's enough theory to get started so let's start building.

Step 3: Powering the H-Bridge

We'll start by laying out the power lines. Connect your battery snap to one corner of the power bus. The convention is to connect the positive voltage to the upper row and the negative to the bottom row to denote the HIGH and LOW signals respectively. We then connect the top and bottom sets of power buses.

Step 4: The Transistor As a Switch

The next step is to set up the transistors. Recall in the theory section that we need four switches to build an H-Bridge, so we'll be using all four transistors here. We're also limited to the layout of a breadboard so the actual circuit will not resemble the letter H.

Let's take a quick look at a transistor to understand the current flow. There are three legs on each transistor known as the collector, base, and emitter. Not all transistors share the same order so be sure to consult a datasheet if you're not using one of the part numbers mentioned in step one.

When a small current is applied to the base, another larger current is allowed to flow from collector to emitter. That's important so I'll say it again. A transistor allows a small current to control a larger current. In this case the emitter should always be connected to ground. Note that the current flow is represented by a small arrow in the figure below.

Step 5: Switching Polarities

Now we're going to line up the transistors on the bottom half of the breadboard, flipping the orientation for every other transistor. Each pair of adjacent transistors will serve as one half of the H-Bridge. An adequate space needs to be left in the middle in order to fit some jumpers and eventually the motor leads.

Next we'll connect the transistors' collector and emitter to the positive and negative power buses respectively. Lastly we'll add the jumpers which will connect to the motor leads.

The transistors are now ready to pass a current when the base is activated.

Step 6: Applying a Signal

We need to apply a small current to each of the transistors in pairs. First we need to hook up a resistor to each transistor's base.

Next we'll connect each set of resistors to a common point in preparation to connect a switch.

Then we'll add the two switches which also connect to the positive bus. These switches will activate one half of the H-Bridge at a time.

And finally we hook up the motor. That's it. Connect your battery and test your circuit. The motor should spin one direction when one button is pushed and the opposite direction when the other button is pushed. The two buttons should not be activated at the same time.

Step 7: Getting a Clear Picture

Here's a diagram of the complete circuit in case you want to save it for reference. The original graphics are courtesy of Oomlout.

Step 8: More Power to Ya

Okay, so you have a shiny new H-Bridge on a breadboard. Now what? The important thing is that you understand how a basic H-Bridge works and that the essentials are the same no matter how much power you're pushing. Here are a few tips to take it a step further in order to support larger motors and more power.

- You can use Pulse Width Modulation (PWM) in place of the two switches to control the speed of the motor. This is easy when you have a microcontroller at your disposal and can also be accomplished with a 555 or 556 timer IC and a few passives without too much trouble.

- The key to supporting higher power motors is higher power transistors. Medium power transistors and Power MOSFETs in TO-220 cases can handle significantly more power than the low power TO-92 transistors we're using here. Proper heatsinks will also increase the capacity.

- Most H-Bridges are built using both NPN and PNP transistors in order to prevent short circuits and optimize current flow. We used only NPN here to simplify the circuit.

- Flyback diodes are usually used in higher power H-Bridges to protect the rest of the circuit from dangerous voltages that are produced by the motor's coils when the power is disconected. These diodes are applied across the transistor in the direction of current flow and resist these harmful EMF back voltages.

- The TIP 102 and TIP 107 are a pair of complementary power transistors that have built in flyback diodes. The TIP 122/127 and 142/147 are similar pairs of power transistors.

That should be enough to put you in the right direction if you want to keep you going.
<p>Hello, </p><p>Really nice project!! But can I use BC-547 transistors instead, and what is the use of the 22 k resistor?</p><p>Thanks</p>
<p>Its used to ensure that only a specific current goes to the base when a signal is given to it.</p>
<p>hi, </p><p>i need circuit diagram of this circuit pls help</p>
<p>Hi,</p><p><br>I have receiver of rc car, but i don t have Transmitter remote. How to make of this?<br>How to make dual H- Bridge RX -2 Transmitter?<br>Can you send the diagram of the remote?<br>Thanks <br>Biswajit</p>
<p>Sorry if this is a naive question - I'm just starting :) - but could you make do with just 2 resistors in the base circuit by putting them before the switches?</p>
<p>I made it, using 4 AA batteries, the voltage to my DC motor is 0.0 no button, press left button gets -5.75v, press right button gets 5.75v -- but motor does not run :-(</p>
<p>Sounds like the circuit is working correctly. Does the motor turn when the battery pack is applied directly? You probably need smaller resistors if so. Otherwise try a higher voltage.</p>
<p>I have a question. How do I replace those switches with an impusle from arduino/beaglebone to allow current to flow through? What I want to do is if the micrcontroller says '1' one set of transistors get activated and allow the flow of current to spin the motor. I hope I dont sound stupid if this problem is very easy</p>
<p>The diagram in step 7 shows two dark blue dots where you would connect. Basically the same place as the switch output.</p>
great instructable, I first had some problems with only one button working however, this proved to be a dodgy transistor. It now works great, I made a copy of this on stripboard, really easy to do. Here are some photos:<br>
<p>can you provide circuit diagram and the motor part number and specification thanks</p>
Cool, thanks for sharing your photos.
<p>Hi all,</p><p>I have just built this using the same parts apart from my transistors are 8c547c and an unknown motor from a DVD drive (I assume 5v). The motor runs if I connect direct to the 9v battery but the motor won't run inline with the circuit. I have checked the output from the I get the following:</p><p>Battery = 8.07vDC - 50mA</p><p>Power leaving circuit to motor = 7.43vDC - 3.4mA!!!!</p><p>I then changed the resistors to 10K and get 2.0mA!!!</p><p>How am I losing so many Amps?</p>
I found that I had to assign a digital write pin for each of the transistors and run the pins I'm pairs. not sure why but, but it was good fun building the h-bridge. Time to write some code and automate the process. Thanks for the instructions.
<p>I&rsquo;m working on a project which is about making a rescue <br>robot . I have struggling with it for 4 months and now all the mechanical works <br>had been done . but I&rsquo;m facing difficulty in make the robot to work with rf <br>module can u plzz help me&hellip;</p><p>I want make transmitter and receiver that can control the <br>motion&hellip;I mean that receiver should have control 8 dc gear motor and each dc <br>motor should have a forward and backward botton to control the motion &hellip;&hellip;can u <br>kindly help me with this project &hellip;.if u can make the circuit board diagram for <br>the PCB &hellip;.or any other suggestion plz reply&hellip;&hellip;mail me at &ldquo;sunny1995gagan@gmail.com&rdquo;</p>
<p>Build one of these circuits for each of your motors, and connect all the bases of the transistor to a microcontroller. Then write a program on the microcontroller that takes the signal output from the reciever and then closes the transistors required to make the motor spin. For example, if you were getting a 50% PWM signal from channel 1 of your reciever, then the microcontroller would output a HIGH value to one of the transistors going from ground to motor 1, and output a 50% PWM signal to one of the transistors going from your power supply to motor 1.</p>
<p>Dose this work with MOSFET's as well.. I am doing this project for uni which involves constrcting a H-Bridges.. but it specfies using MOSFETS. not NPN transistors.</p><p>Can you use the same design for MOSFET's</p>
<p>Yes, you can. MOSFETs are simply transistors that can handle higher power. When powering higher power motors, MOSFETs are the usual choice.</p>
<p>if i use 12v motor what should be the voltage of power supply ?</p>
<p>As long as your transistors can handle the power, then the same voltage as your motor. So 12 volts.</p>
This is a great Instructable, but you need to add a main image of the final project to the intro step. Please do that and leave me a message when you have so that we can publish your work. Thanks!
<p>Where is the <a href="http://tureng.com/search/circuit%20diagram" rel="nofollow">circuit diagram</a>? Could you send me <a href="http://tureng.com/search/circuit%20diagram" rel="nofollow">circuit diagram</a> please. İt's urgent. I need it immediently. Here my mail adress you can sent here: seydanuryilmaz@yandex.com</p>
<p>Where is the <a href="http://tureng.com/search/circuit%20diagram" rel="nofollow">circuit diagram</a>? Could you send me <a href="http://tureng.com/search/circuit%20diagram" rel="nofollow">circuit diagram</a> please. İt's urgent. I need it immediently. Here my mail adress you can sent here: seydanuryilmaz@yandex.com</p>
<p>I am trying to use NTE 292/291 complimentary transistors to power the circuit. Can I wire it in this way but use a PNP and NPN paired in each set of adjacent transistors? Or does the use of PNP require a different configuration?</p>
<p>PNP requires a different configuration since they're normally closed (applying a current opens the circuit), as opposed to NPN which is normally open.</p>
<p>how can i modify this circuit using a 12v motor??can anyone help me...</p>
I actually have been messing around with H-bridges lately and have had a lot of success (when the FETs are in working condition) with the attached configuration. It delivers a large current using a small &quot;base&quot; voltage.
what is the value of r1?
To use the Pulse Width Modulation, do you just connect a microcontroller directly where the pins of the switch were?
One pin of MCU going to one &quot;buton&quot; and second pin to second &quot;button&quot;. Just programm it as you want and then you control it. (If you mean this)
Thanks for this guide. I made the schematic on Crocodile Technology and the emulation works perfect.<br> <br> http://i46.tinypic.com/34t95ia.jpg
this is totally awesome..!!<br>can i use it in my light following robot for forward and revers movement???<br>plz explain how it the bridge get activated for both movments..<br>in my robot circuit, current flows when light above certain limit is fall on LDR..<br>plz explain how and where do i connect this bridge in circuit??? if possible then show diagram..
you could replace the buttons with SPST relays (or any type really) and your robot circuit can control them, but there will be slight delay.
So I cannot get this to work. I have rebuilt it twice now and still get the same problem. When no button is pushed each switch is passing about 1.8 volts and then passes the full amount when pushed. So even when you push a switch there is still some positive current to each motor terminal, preventing it from spinning either direction. Any help would be appreciated! Thanks! :D
I have used 2n4401 NPN for this but it won't work. The output voltage is just 0.47v....... Please help me!
hi, great instructable. I made a h bridge circuit following a schematic i found on internet somewhere. I used 2n3904 and 2n3906 transistors and 1 k resistors. When i try it with a 1.9v dc motor it works, but with a 3v dc motor it heats up the transistors and barely move. I tried with 3, 5, 9, 12 v but none of these worked. I made it to move a tray about 2 inches foward and back. I don t know if i have to change the transistors, the resistors, everything?? <br>Sorry for my dumb question, i m begining to learn about electronics, self teaching for now (not very well apparently) <br>thanks for the help
Thank you for this instructable. I used it to make a motorized focuser for my telescope. I still need to tweak a few things but it works good.
When trying to replicate your project (using 2N3904 NPN instead, all other parts were identical) i noticed the image in &quot;Getting a Clear Picture&quot; is off. According to the image, you have the emitters on power, and the collector's on ground. If the image is correct than according to the pin layout in the image, your actual project is hooked up the same way (emitter to + and collector to - ). <br> <br> When reading your tutorial, you said to connect emitter's to ground, and collectors to positive. So i first tried mine this way and i couldn't get it to work. I then switched my NPN's around to match your image (emitter on + / collector on - ) and that didn't work either. Maybe I am missing something but i tried every combination and then some until my transistor exploded (started putting power where it didn't belong =P). <br> <br>Should i be using the same transistor as you? (is something wrong with 2N3904?) i am trying to create an h-bridge which inputs 12 volts and outputs as close to that as possible to the motor. I was using 9 volts however when i blew up the NPN. <br> <br> <br>
i have two questions. <br>1. i see the buttons share one pole, would it be possible to use a Single pole changeover switch to switch between directions and keep it going without pushing the buttons? <br> <br>2. how significant is the resistance? i want to use this for a tape player and im afraid i have to do a lot more modding to give it enough power
1. Yes, that's possible.<br>2. That depends largely on the components and power supply you choose to use.
well, i found out you cant just make the motor spin backwards in a tape player. but thanks anyway
Could I make this circuit using just TIP-102:s (NPN) with a load of 0,4 A (motor) at 12V? or would I also need TIP-107(PNP)?<br>Thx.
The addition of PNPs makes for a better circuit but that's not covered here. NPNs will work fine. Just be careful not to short the circuit as outlined in step 1.
Cool, Thx!
imm I think I have one of those motors out of a printer.
Did I understand correctly that this circuit keeps the motor running only as long as long as one of the buttons is pushed, but when you release it, the motion stops? If so, what would be needed for a continuos motion? In other words, that the motor would keep running until the other button is pushed? Thxs.
Yes, you understand correctly. You might want to take a look at a <a href="http://www.kpsec.freeuk.com/555timer.htm#bistable" rel="nofollow">bistable multivibrator</a> circuit using a 555 timer.
I have just gotten familiar with programming MCU, and I really want to make some hw to play with.<br> Great intruction, I will make one and post the result here after the midterm exams. :))
I used your instructable to build 2 dual h bridges to drive 2 bipolar stepper motors, works very well. Thank You
Nice. Care to share more info about what you did?

About This Instructable




More by gzip:IR Receiver for Infrared Capture Simple Animatronics with Servos and Arduino 3x3x3 LED Cube with Arduino Lib 
Add instructable to: