The darn H-bridge

There is also an L298 chip

There is also an L298 chip that can handle more current and can sense the motor voltage (this can be used for telling how fast the motor is running - I think :-))

- Jimmy

Ouch!

I just saw that I turned the NPN transistors in the wrong direction on the picture! They should be rotated 180 degrees… The collector pins from PNP and NPN are supposed to be connected.

- Jimmy

Problem
There are two problems with this design. 1 is the transistors. the 547 and 557 are designed for low current. I doubt you can drive a motor with it. 2 is that if you turn on A+B and/or C+D then yes, the motor will halt, but you will most likely see the whole thing go up in a puff of smoke. If you open both transistors in either side, you create a short between Vmotor and GND…

directions
There is an error in the pin description. To turn the motor one way, open C+B. The other way is A+D. Think of the transistors as a switch and follow the power from Vmotor, through the open transistor (A or C), through the motor and through the other open transistor (B or D)

Yes it’s true that the

Yes it’s true that the transistors are only rated for about 100 mA of current which I also pointed out to Frits in the mail I sent him. I guess he left that bit of information out when putting the thing online :-).

Aren’t motor drivers supposed to go up in a puff of smoke? :-D… I’m going for drama and not movement ;-).

- Jimmy

 

I think the pin description

I think the pin description is right. Remember that PNP transistors turn on when input is low and not high. NPN transistors are the other way around. Did I miss something else?

- Jimmy

Well, I missed the PNP/NPN

Well, I missed the PNP/NPN part. :slight_smile: But why use NPN and PNP? Why not NPN all the way? And connect A&D and B&C in your drawing to get 2 control lines instead of 4.

Also, remember to put protection diodes on the transistors. Put them across collector/emitter against the current direction.

The voltage at the base pin

The voltage at the base pin must be higher than the voltage at the emitter to turn an NPN on. If you put in an NPN where there are PNPs you would need the base-pin to go beyond the voltage supply for the motor. Of course this is possible either using voltage doublers or just keeping the motor voltage lower than the supply voltage.

Actually the h-bridge shown above was never meant to be in this forum. Frits asked me to show him the simplest possible (no protection or anything) h-bridge using the transistors he had (BC547 and BC557) and so I did :-). If I were to build an H-bridge myself I would start off by using my HEXFETs (rated for around 20 A) instead of the BJTs in this design and I would add protection schottky diodes like you describe (although the HEXFETs have built-in body diodes for protection) and I would add filtering capacitors to absorb voltage spikes from the motor. I think I would also use some bridge driver chip to drive the HEXFETs instead of interfacing them directly from the microcontroller.

If you connect A&D and B&C you limit you modes of operation. With a full bridge you get CW rotation, CCW rotation, brake and coast (and of course melt-down :-)). You will have to limit yourself to three of these if you do the connection. As previosly said this is a simple bridge not really meant for others than dare-devils like Frits :-).

- Jimmy

Dang I keep forgetting to

Dang I keep forgetting to click "reply" on the right comment… look below somewhere to find a comment to your comment :slight_smile:

- Jimmy

You are right, of course. I
You are right, of course. I just thought i remembered a design with only NPN transistors. I’ll see if I can dig it up somwhere and see how it works (if it works at all…)

Errata

"The voltage at the base pin must be higher than the voltage at the emitter to turn an NPN on."

Erh… of course I meant that the voltage at the base pin must be higher than the voltage at the COLLECTOR to turn an NPN on :slight_smile:

- Jimmy

I have now tested the

I have now tested the h-bridge design (where the NPN are connected correctly) and it seems to work. I used LEDs instead of a motor: green is one direction and red is the other. I guess it’s not so easy to see what the heck is on the breadboard but the camera couldn’t go any closer without blurring the whole thing up… The resistors used in series with the base-pins are 2.2K

|x

And the other direction:

|x

Please note that the green LED in the middle is just the power indicator connected to the voltage regulator (an 7805 in this case). Also you can see my picaxe setup on the right side of the breadboard with my homemade programming circuit for use in a breadboard - nice and handy!

- Jimmy

Nice, Jimbo!

I am not getting anything of this, so I can only say this rather off-topic:

Hey JIP, you can get 9V as rechargables, at the same price as one new Duracell (10USD in Denmark, Harald Nyborg)

/ Frits

Thanks for the tip! I just

Thanks for the tip! I just read the description from the batteries you pointed me to… “High capacity which makes them suitable for devices with high current demands”… I don’t think any 9V can deliver high current :-). Since both the charger and the battery are so cheap (the charger is about 15 USD) - and since I live really close to that store - I definitely think I will go get some!

The alkaline ones that I have now I bought from www.batterier.dk and I think it was 12 batteries for 250 DKK (which is about 50 USD).

- Jimmy

David Cook shows an H-bridge for BJTs

David Cook has written a nice and short introduction to H-bridges using bipolar junction transistors here

http://www.robotroom.com/BipolarHBridge.html

- Jimmy

If I may be so bold …

I wrote up a tutorial as well on how to build a simple transistor H-Bridge. You can find it here:

http://www.mcmanis.com/chuck/robotics/tutorial/h-bridge/

 

–Chuck

Chuck?!?! What an honer!!

Chuck commenting on my blog?

Man, you are a LEGEND! OF course I already entered a link to your famous H-bridge tutorial!!

It is right here: https://www.robotshop.com/letsmakerobots/node/121

- We must get a better overview on that links-section in here!

But of course, that is the best!

Reason for the original blog-entry on this long thread was that I just wanted the head on Yellow Drum Machine to be able to turn both ways. Just that simple task; flip voltage. And I found that just hooking up an L293D Motor driver was the simplest though overkill IMHO. I´d hoped for some smart wiring with a couple of transistors, but no, this was the fastest.

 

Anyway, again, I am honored that you actually is in here :slight_smile: I hope that you will post something?

Thanks,

/ Frits

I will never forget your

I will never forget your tutorial Chuck. I think it was the very first thing I read when I investigated how H-bridges worked and it was extremely helpful. Thanks for the awesome work and I encourage everyone who wants to drive their motors themselves to read it!

Hope to see more tutorials from you in the future!

- Jimmy

CHUCK FTW!!

CHUCK FTW!! CHUCK FTW!! CHUCK FTW!!

Hey - I actually wrote to Chuck recently, and even got a reply! Fun thing is that I wrote because I wanted to make sure he never deleted that tutorial, as it was getting old.

Chuck told me that he was hosting it himself now, and that it was going nowhere!

But I have a copy just in case :smiley:

/ Frits

Just what I’m looking for…sort of

I hate to resurrect the dead thread but…

This is sort of just what I’m looking for! I need a design that will only switch current. I noticed that changes had to be made through the comments. Would someone be really nice and post a schematic I can use that will power a 24V, 5A system? I have no idea what components would be needed for that type of power…I’ve started a search.

I also plan on using a D flip flop to make the bridge switch back and forth.

 

Thanks!!