Introduction: How to Make an H-bridge

Picture of How to Make an H-bridge
An H-bridge is a type of circuit that you can use to get a reversible DC motor to spin both clockwise and counterclockwise.

In other words, this circuit allows you to quickly reverse the direction a motor is spinning by using a switch or controller chip to change its direction.

I'm going to show you how to make the simplest and most reliable form of H-bridge that I know how to make. I must warn you that this is by no means the best H-bridge design and, in fact, it has a couple shortcoming which I will explain later.

Although, should you never have made an H-bridge before or simply need a circuit that can reverse the direction of a motor's spin, then this circuit is a quick and easy solution.

(You will notice the motor freaks out when I flip the switch. That is the motor changing directions!)

This H-Bridge was made with the love and support of Eyebeam

Step 1: Go Get Stuff.

Picture of Go Get Stuff.

Here's what you need to get:

4 - SPST 5VDC Reed Relays (Radioshack Model: 275-232 Catalog #: 275-232)
1 - SPDT 5VDC Reed Relay (Radioshack Model: 275-240 Catalog #: 275-240)
1 - package of 9V battery clips (Radioshack Model: 270-324 Catalog #: 270-324)
1 - 9V battery
1 - Toggle or slide switch (SPST)
1 - 7805 Voltage Regulator (Radioshack Model: 7805 Catalog #: 276-1770)
1 - PC Board (Radioshack Model: 276-150 Catalog #: 276-150)
1 - reversible DC motor

(You can find a reversible DC motor inside a broken Walkman or Discman. For those of you in NYC, you can get a motor and/or broken Walkman at Argo Electronics - 393 Canal Street)

Step 2: The Truth About H-bridges.

Picture of The Truth About H-bridges.

An H-bridge is a series of four controllable switches in which there are two sets of two switches.

One set of switches when closed allows electricity to flow one way. The other set of switches allows electricity to flow in the opposite direction.

Another important characteristic of an H-bridge is that it typically can use a smaller voltage (5VDC from a micro controller, for instance) to control a much larger voltage (12VDC used to power a motor). These two separate voltage sources are kept isolated from one another.

H-bridges can be made with either 4 relays or 4 transistors.

The best type of H-bridge is made with transistors since these can easily be used to control a motor's speed (by using the smaller voltage to modulate the much larger motor voltage). An H-bridge made using relays (like the one we are making) cannot easily be used to change a motor's speed (unless, of course, the motor voltage is being supplied from a power source capable of being modulated... i.e. the H-bridge itself cannot modulate the power source to down the motor. The power must be decreased to slow down the motor before it goes through the H-bridge).

Step 3: How It Works.

Picture of How It Works.

The H-bridge we are making uses relays.

What this means for you is that the motor will spin as fast as it can in one direction and then when reversed, spin as fast as it can in the other direction. The only thing that will slow down the spin of the motor is if you have a controller that can modulate the 9VDC the power signal BEFORE it enters the H-bridge.

When the coils on "Relay 1" and "Relay 4" are pulled high (electricity is flowing through them), then the motor will spin forwards (see "Image 1").

When the coils on "Relay 2" and "Relay 3" are pulled high (electricity is flowing through them), then the motor will spin backwards (see "Image 2").

When the coils on "Relay 1" and "Relay 2" are pulled high (electricity is flowing through them), then the motor will stop spinning (see "Image 3").

When the coils on "Relay 3" and "Relay 4" are pulled high (electricity is flowing through them), then the motor will stop spinning (see "Image 4").


You want AVOID:
"Relay 1" and "Relay 3" being pulled high. This is a short circuit since there is no load for the electricity to pass through. Bad things will happen! (see "Image 5")

"Relay 2" and "Relay 4" being pulled high. This is a short circuit since there is no load for the electricity to pass through. Bad things will happen! (imagine "Image 6")

More than 2 relays being pulled high at one time. Bad things will happen.

Step 4: About Our Circuit.

Picture of About Our Circuit.

Our circuit includes an H-bridge made out of 4 SPST relays (single-pole single-throw) and 1 additional SPDT (single-pole double-throw) relay which will be used to switch between the 2-sets of 2 relays.

Okay.... so this is how it works...

Power from the battery is going to the 7805 voltage regulator where is converted to 5V. Power from the battery is also going to "Relay 1" and "Relay 2" where it goes to the motor (but we're getting ahead of ourselves).

The 5V power is both going to the coil of the SPDT relay and it is also passing through the the SPDT relay. So, when the switch is closed, 5V flows through the coil of the SPDT relay and 5V also is routed through the SPDT relay to the coils of "Relay 1" and "Relay 4" forcing them to close. This allows 9V to flow through "Relay 1" and "Relay 4" in a way in which the motor can spin in a clockwise direction.

In other words, when we close the switch connected to the coil on the SPDT relay, we are triggering the H-bridge to allow the motor to spin clockwise.

Therefore, if we want the motor to spin counter-clockwise all we would need to do is flick the switch in the opposite direction. This will change the path through which the electricity passes through the SPDT relay and in turn close "Relay 2" and "Relay 3" (and by extension open "Relay 1" and "Relay 4").

Step 5: Start Your Soldering!

Picture of Start Your Soldering!

Solder your 4 SPST relays to the PCB as close together as possible (see secondary image).

If you don't know how to solder, learn how to solder with the help of Noah.

Next, solder the SPDT relay (the box-like thing) to the board as close to the SPST relays as you can get it (see secondary image)

Lastly, in the registers on either the far left or right side of the board, solder your 7805 5V regulator (see secondary image).

You should now have all of your major components connected to the board (see main image).

Step 6: Solder Some Wires.

Picture of Solder Some Wires.

You are going to want to now connect wires to your components so that they are actually wired together and can do things.

To begin with, solder a black wire to one side of the coil on each SPST relay. Pick a spot on the PCB where there is at least 8 empty slots and they are not connected to any of the components and then solder all 4 wires together on the underside of the board.

Step 7: Solder Some More Wires.

Picture of Solder Some More Wires.

You then need to connect two wires to each of the output pins on the SPDT relay. Consider each of these two wires belonging to the same set of wires. Connect one set of wires to the coils on the two closest relays. Connect the other set of wires to the coils on the two farthest relays (for clarification see image notes).

Step 8: Solder Even More Wires.

Picture of Solder Even More Wires.

Connect the middle pin of the first relay to the 9V input on the voltage regulator. Connect the middle pin of the second relay to ground (the place with all the black wires connected together). Connect the middle pin of the third relay to the 9V input on the voltage regulator. Connect the middle pin of the fourth relay to ground (the place with all the black wires connected together).

For clarification see images below.

Step 9: Who Would Have Though There Would Be This Many Wires?

Picture of Who Would Have Though There Would Be This Many Wires?

Connect the other end of one of these wires to the input pin on SPDT Relay. Connect the other wire to the coil on the SPDT relay.

And then there is the matter of the switch. One wire on the switch goes to the coil on the SPDT relay and the other wire on the switch goes to ground.

Now would also be a good time to attach a black wire between the ground and the middle pin on the voltage regulator.

Step 10: Attach a Plug You Sexy Beast!

Picture of Attach a Plug You Sexy Beast!

You're going to want to be able to turn your H-bridge on, right? And no matter how sexy you may think you are, the only way to turn it on is with electricity.

So, attach the red wire of the 9V plug to the 9V input on the voltage regulator. And then attach the black wire to all of the other ground wires on the board.

Step 11: For a Few Wires More.

Picture of For a Few Wires More.

Attach 5" of wire to the pins on the side of the SPST relay tubes that currently have no wires attached to it.

If there is a red +9V wire on the middle pin on the one side of the tube that currently has wires on it, then also attach a red wire on the side your currently attaching wires to. If there is a black wire on the side with all the wires, then attach a black wire on this side.

Step 12: Clean Up.

Picture of Clean Up.

Chop off all of the extra wire on the under side of the board.

Trim as close to the board as possible without breaking any connections.

This will keep wires from crossing later on.

Step 13: Testing... Testing... 1... 2... 3...

Picture of Testing... Testing... 1... 2... 3...

Now is time to see if it works.

Think of the red and black wire closest to one edge of the board as one set. Think of the farther red and black wire as another set. In the image below, I twisted the two wires of each set together.

When the H-bridge is triggered by the SPDT relay, either one set or the other set, at any given time, will have power flowing through it.

So, if we were to attach an LED in series with a 220 ohm resistor to each set, when we plug in a battery and flick the switch, either one LED will light up or the other will light up (see images below).


If your H-bridge doesn't work this way, make sure:
1. You are using the right "set" of wires
2. All of your wires are routed correctly (See diagram below)
3. You made all appropriate soldered connections and are not missing any wires
4. You have no crossed wires (The voltage regulator will most likely be excruciatingly hot if you do. You should also be able to see where it is crossed... usually.)
5. Your relays work (You can check by bridging the positive end of the coil directly to the 5V power source. When you do this, you should hear a little click)
6. Your battery isn't dead (Quickly touch an LED to it and see if it lights up)
7. Your LED isn't dead (try another LED)
8. Your LED isn't backwards and preventing the flow of electricity (Try turning it around).
9. The gods of electronics aren't angry at you.

Step 14: Connecting the Motor.

Picture of Connecting the Motor.

This is where it gets a little tricky.

Since we want electricity to flow through the motor both forwards an backwards, we are going to want to attach one set of wires to the motor with the correct polarity and the other set of wires to the motor with a reversed polarity.

In other words, the black from one set gets paired with red from another set and then attached to the red wire on the motor. And the red from one set gets paired with the black from the other set and attached to the black wire on the motor.

Or to just see what is going on, just look carefully at the picture. It should make sense.

Step 15: Improve Your Artbot.

Picture of Improve Your Artbot.

Aside from using it for a whole bunch of practical applications, you can now also use your H-bridge to get your fancy-shmancy drawing-bot to move in two directions.

Watch your back Jackson Pollack! We will draw on your grave!


djsnowman06 (author)2016-12-13

Why dont you just use 2 spdt relays. Connect each lead of the motor to the common pin. Connect the 2 nc pins to ground, and connect the 2 no pins to Vcc. That way you just energize one for clockwise and the other for counter-clockwise.

Benifits are it's simpler, uses less parts and is impossible to short circuit.

djsnowman06 (author)djsnowman062016-12-14

Here i just mad an instructable about it

DiegoF3 (author)2016-11-19

Hey man, I need to control a pump but it V and A ranges doesn`t match with any available H-Bridges for arduino, can you recommend any material that will help me build a custom one suitable for my needs?

TammyH59 (author)2016-04-27

i were hoping that I could find the answer to how to build a h bridge to change a electric door locking system from "fail-safe" to "fail -secure".

can someone help me please

DivasG (author)2015-01-19

Sir, I have question. I got 5 spst relays can you tell me how make hbridge with them

colin55 (author)2009-02-11

Of course you can make the project with a double-pole double-throw switch and not use any relays at all. The only problem is the motor is constantly turning in one direction or the other. The alternative is to use two double-pole push switches or 4 switches as shown in the following diagram. You need to push both of the forward switches at the same time. By pushing the reverse switches very briefly you will get braking when travelling in the forward direction.

tridecagon (author)colin552014-02-07

You can find DPDT switches with a center-off position. I got one from radioshack.

colin55 (author)2008-12-30

There is a much-simpler way to reverse the motor using just one relay. Connect a double-pole double-throw relay as shown in the enclosed diagram. No other components are required! Just a switch to energise the relay for forward or de-energise the relay for reverse. Colin - TALKINGELECTRONICS.COM

granjef3 (author)colin552009-02-10

colin55: then you would not be able to brake

tridecagon (author)granjef32014-02-07

Small motors like that don't need a brake. But if you insist on using one, I would recommend a friction brake. The motor here slows down too fast on it's own for an electric brake.

dagenius (author)granjef32009-04-28

just add another switch from one of the wires that goes to the motor, and then no matter which way you turn the first switch, the motor will only spin if you have the second switch on.

if you really need braking you can tie in a relay somewhere else to cut power.

rip333 (author)granjef32009-03-09

use a center off DPDT

dillonxti (author)2013-08-06


shobo (author)2013-06-18

looks nice man,but i think is more effective with 2 pais of npn and pnp,some diodes ans is the one i made

MackeFeet (author)2012-07-11

So.. How would I go about this controlling it with arduino... I know I could drop the whole spdt relay and switch! Seeing is I want it to be person less.. (I'll be using force sensor to trigger it.) But I don't know for sure.. I need some help! Maybe a schematic, but I need simpler type terms since I'm only 13.. Help please!!!!

Robot Lover (author)2012-01-02

If you have a DPDT relay, the other relays are non-essential for making a motor reverser circuit.

ARJOON (author)2010-09-29

the relay is so expensive

laxhead94 (author)2010-07-13

do you really need a 7805 in there?

milsorgen (author)2010-01-28

I was just at Radio Shack and the relays alone for this project are going to set you back over 20 dollars.

Nu (author)2009-08-29

The relays are being counted from right to left. The fist relay is the one farthest to the right, the second is the next one to the left and so-on. Thanks Nu

thecookiemonster (author)2009-06-20

you know you could just use a dpdt switch!!!!

colin55 (author)2009-02-10

Simply flick the switch to reverse the motor and it creates a brake function.

ijabi (author)colin552009-06-11

Hello colin:do you have any simple way to do h-bridge with mosfet(a Schematics by chance). thanks

colin55 (author)ijabi2009-06-11

There are lots of circuits on the web using MOSFETS in an H-bridge arrangement. These are generally high power circuits and you need to do your own research as there are so many designs.

Patented (author)2008-06-24

There should be a simpler way to do an H-bridge than this one

elginsteve (author)Patented2008-08-20

There is, a lot cheaper version too using four bi-polar transistors instead of relays.

amando96 (author)elginsteve2009-02-27

can i just use transistors, and is the voltage regulator really that important? coz i cant get one :(

dagenius (author)amando962009-04-28

I dought that the 7805 is mportant. if you really feel the need to not burn out your motors, then order a few off of digi-key.

amando96 (author)dagenius2009-04-30

used continuous rotation servos, easier to work with lol

dagenius (author)amando962009-04-30


Noodle93 (author)elginsteve2008-09-23

Or an IC.

awkrin (author)2008-05-25

there is a way of doing thing with a more complicated switch that's actually made by two separate switches and changes from one to another terminal, like a SPDT, but it's double: DPDT I mean:

dagenius (author)awkrin2009-04-28

colin55 has the same circuit.

Hydrotec (author)2008-05-25

I want to as a ? Can anyone help me ? I want a automatic timing switch that will change polarity back and forth as well do PWM on and of to speed a motor and slow a motor!

dagenius (author)Hydrotec2009-04-28

use a 555 timer circuit, and maybe use one of those fancy digital potentiometers to change the speed. Another 555 circuit would also help for that, if you don't want to use a digi-pot. just make the circuit have a very short cycle, and by changeing that, you may also more reliably change the speed of the motor.

thermoelectric (author)Hydrotec2008-07-14

Try this ask ewilhelm if that circuit doesn't suit u

raykholo (author)2009-02-15

really cool idea -- definitely gonna try this couple of questions though -- total cost? can this be done with dpdt relays so u wont have to use as many? cost of an actual h bridge circuit and anything important on those? thanks rak

cl0ney (author)2008-12-28

you rock. thank you for teaching for free.

PyroMonger (author)2008-01-31

I made a MUCH simpler H bridge by sumply using 2 AA batteries a SPDT switch and Voila! Of course i used a motor too or there would be no point of making it. I found it right here on instructables too. The BeetleBot

awkrin (author)PyroMonger2008-05-25

I know that's like that: but that uses only one battery, while a DPDT it's even simpler and uses both batteries

Hey awkrin.
I've posted a little instructable with it here.

Artificial Intelligence (author)2008-07-03

Nice, but if you just wanna control the motors direction with a switch, there is a much simpler and easier alternative.

EvilSnoopy24 (author)2008-06-01

when I had to make one, I gutted a nes controller, and used it to control a little car. but I used the up arrow for one switch and the down arrow for the other switch. anyways here's the diagram

wi-fi astronomer (author)2007-11-18

I did the same thing but with only 2 SPDT relays and a bipolar power supply. What you do is hook the motor to the common end of the relay's arm and the normally ON ends to one side of the supply. The normally OFF ends of the relays are hooked to the other side of the supply. When you activate ONE relay, the motor turns. Activate only the other, the motor reverses. Activate both, and the motor remains off. When I made this, you'll never imagine the use I made for it. I used the H-Bridge to control an old cordless drill with threaded rod chucked into it to open and close a window. A window with a remote!

randofo (author)wi-fi astronomer2007-11-18

You should post an Instructable of that window openeer. That sounds awesome.

wi-fi astronomer (author)randofo2007-11-19

Yeah, that was a cool invention. Until I made it I never heard of a "window servo". It did have a few problems, the most notable was that the whole assembly would vibrate severely so you'd want to let go of the button every few seconds when using it. It sure worked, but you had to know how to use it.

TerraPlop (author)2007-08-20

Elegantly complex solution to a simple problem that can be solved with half the parts and at less cost.

chavez00001 (author)TerraPlop2007-09-25


supafupa (author)TerraPlop2007-08-20

An H bridge gives you more control. You can interface with a microcontroller, using software to control the speed/direction. With a switch, the intelligence is left up to the operator.

About This Instructable




Bio: My name is Randy and I am a Community Manager in these here parts. In a previously life I had founded and run the Instructables ... More »
More by randofo:Large Motor ProjectsRemove a Wheelchair Motor BrakeBuild a Robot
Add instructable to: