Introduction: H-Bridge on a Breadboard

Picture of H-Bridge on a Breadboard

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

Picture of 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

Picture of 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

Picture of 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

Picture of 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

Picture of 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

Picture of 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

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


PhilipE100 made it! (author)2017-06-24

Really useful project and easy to follow instructions, enjoyed doing it so much thank you

made few changes:

1-Made Arduino as a power supply (5V) instead of 9V Battery

2-replaced buttons by connecting to 4&8 pins in Arduino making the dc motor rotates with specific time in each direction

3-Put 330 ohm resistors instead of 22k ohm resistors


Tanmay Deuskar (author)2016-03-29


Really nice project!! But can I use BC-547 transistors instead, and what is the use of the 22 k resistor?


Its used to ensure that only a specific current goes to the base when a signal is given to it.

IsmailJ6 (author)2016-05-06


i need circuit diagram of this circuit pls help

BiswajitN4 (author)2016-04-27


I have receiver of rc car, but i don t have Transmitter remote. How to make of this?
How to make dual H- Bridge RX -2 Transmitter?
Can you send the diagram of the remote?

prws (author)2015-11-24

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?

kevinwaite made it! (author)2015-11-01

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 :-(

gzip (author)kevinwaite2015-11-14

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.

AnirudhA9 (author)2015-11-14

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

gzip (author)AnirudhA92015-11-14

The diagram in step 7 shows two dark blue dots where you would connect. Basically the same place as the switch output.

ProBodger (author)2012-01-15

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:

kaisi (author)ProBodger2015-08-12

can you provide circuit diagram and the motor part number and specification thanks

gzip (author)ProBodger2012-01-15

Cool, thanks for sharing your photos.

RoyL4 (author)2015-06-11

Hi all,

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:

Battery = 8.07vDC - 50mA

Power leaving circuit to motor = 7.43vDC - 3.4mA!!!!

I then changed the resistors to 10K and get 2.0mA!!!

How am I losing so many Amps?

RoccoSmit made it! (author)2015-05-27

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.

gsandhu2 (author)2014-06-25

I’m working on a project which is about making a rescue
robot . I have struggling with it for 4 months and now all the mechanical works
had been done . but I’m facing difficulty in make the robot to work with rf
module can u plzz help me…

I want make transmitter and receiver that can control the
motion…I mean that receiver should have control 8 dc gear motor and each dc
motor should have a forward and backward botton to control the motion ……can u
kindly help me with this project ….if u can make the circuit board diagram for
the PCB ….or any other suggestion plz reply……mail me at “”

DerpS (author)gsandhu22015-05-13

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.

AlanH2 (author)2014-10-14

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.

Can you use the same design for MOSFET's

DerpS (author)AlanH22015-05-13

Yes, you can. MOSFETs are simply transistors that can handle higher power. When powering higher power motors, MOSFETs are the usual choice.

basim.moulana (author)2015-03-07

if i use 12v motor what should be the voltage of power supply ?

DerpS (author)basim.moulana2015-05-13

As long as your transistors can handle the power, then the same voltage as your motor. So 12 volts.

admin (author)2009-09-01

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!

Where is the circuit diagram? Could you send me circuit diagram please. İt's urgent. I need it immediently. Here my mail adress you can sent here:

seydanur.yilmaz.355 (author)2015-03-09

Where is the circuit diagram? Could you send me circuit diagram please. İt's urgent. I need it immediently. Here my mail adress you can sent here:

bmiller73 (author)2014-12-04

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?

gzip (author)bmiller732014-12-04

PNP requires a different configuration since they're normally closed (applying a current opens the circuit), as opposed to NPN which is normally open.

swan5 (author)2014-04-22

how can i modify this circuit using a 12v motor??can anyone help me...

dff3bc (author)2013-03-22

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 "base" voltage.

maxchu765 (author)dff3bc2013-12-16

what is the value of r1?

jlorenc (author)2013-07-24

To use the Pulse Width Modulation, do you just connect a microcontroller directly where the pins of the switch were?

leddiode (author)jlorenc2013-12-01

One pin of MCU going to one "buton" and second pin to second "button". Just programm it as you want and then you control it. (If you mean this)

American2020 (author)2013-04-02

Thanks for this guide. I made the schematic on Crocodile Technology and the emulation works perfect.

Pranjal Joshi (author)2011-12-20

this is totally awesome..!!
can i use it in my light following robot for forward and revers movement???
plz explain how it the bridge get activated for both movments..
in my robot circuit, current flows when light above certain limit is fall on LDR..
plz explain how and where do i connect this bridge in circuit??? if possible then show diagram..

Roshy10 (author)Pranjal Joshi2013-03-18

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.

cslatton (author)2013-01-16

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

electro18 (author)2012-12-20

I have used 2n4401 NPN for this but it won't work. The output voltage is just 0.47v....... Please help me!

lean04 (author)2012-10-09

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??
Sorry for my dumb question, i m begining to learn about electronics, self teaching for now (not very well apparently)
thanks for the help

EvrttGrn (author)2012-09-26

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.

cgmalantonio (author)2012-09-25

When trying to replicate your project (using 2N3904 NPN instead, all other parts were identical) i noticed the image in "Getting a Clear Picture" 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 - ).

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

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.

deathsmileyinc (author)2012-05-03

i have two questions.
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?

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

gzip (author)deathsmileyinc2012-05-03

1. Yes, that's possible.
2. That depends largely on the components and power supply you choose to use.

deathsmileyinc (author)gzip2012-05-06

well, i found out you cant just make the motor spin backwards in a tape player. but thanks anyway

Terr0rb0t (author)2012-02-20

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)?

gzip (author)Terr0rb0t2012-02-20

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.

Terr0rb0t (author)gzip2012-02-21

Cool, Thx!

David97 (author)2012-02-19

imm I think I have one of those motors out of a printer.

Terr0rb0t (author)2012-02-13

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.

gzip (author)Terr0rb0t2012-02-13

Yes, you understand correctly. You might want to take a look at a bistable multivibrator circuit using a 555 timer.

lkien (author)2011-11-10

I have just gotten familiar with programming MCU, and I really want to make some hw to play with.
Great intruction, I will make one and post the result here after the midterm exams. :))

mattadamsnet (author)2011-07-21

I used your instructable to build 2 dual h bridges to drive 2 bipolar stepper motors, works very well. Thank You

About This Instructable




More by gzip:IR Receiver for Infrared CaptureSimple Animatronics with Servos and Arduino3x3x3 LED Cube with Arduino Lib
Add instructable to: