Homebrew H-Bridge possibly with pyrotechnics :-)

I thought I could wire up my own H-Bridge based on info I found in Internet, so instead of getting an SN754410, I bought four TIP120 darlington transistors.
http://www.fairchildsemi.com/ds/TI/TIP122.pdf

Based on the info from Wikipedia, I've wired up my transistors like this. To keep it simple, I represented each darlington pair as one transistor. D9 and D10 are Arduino Digital Pins 9 and 10.

hari.mindvision.com/2010/Arduino/img/H-bridge.png

I think it should work, but... when I turn on the Arduino, BEFORE I upload my sketch, who knows what pin 9 and 10 output would be?! What if they were both set to HIGH?!
I probably would see some impressive pyrotechnics when I short + and - together with those transistors, right?!

Obviously, I could add a NOT gate, and control one transistor pair with pin 9 and the other pair with the inverted pin 9. Is that my only option?

It's so easy to accidentally set pin 9 and 10 to high, so maybe I should abandon this and get the SN754410 instead. Your thoughts?

If you're this concerned:

  1. Install a fuse on the positive power rail for the h-bridge.

  2. Add another darlington on the positive rail to turn on/off the rail.

  3. Add a delay-on circuit to the power rail, thru an AND gate; AND gate only goes high when delay-on is on and the Arduino "init pin" is HIGH.

  4. Alternatively with 3, use your inversion idea on the directional control pins, and use the PIN to the AND gate to turn on/off power. You might also add an output from the delay-on switch back to the Arduino, so the Arduino knows the circuit is "ready".

:slight_smile:

Thanks cr0sh! So you think I'm being overcautious?

BTW, what's the pros and cons of wiring up an H-Bridge manually vs. just getting a chip?

Study many H-bridge schematics to get an idea of what works (there are a lot of bad designs on the net). Its rare to see NPN transistors used on the high side of the H-bridge. Having the high side transistors base current go thru the motor may cause issues.

You should also have some diodes protecting against back EMF spikes.

To prevent initial problems with the bridge fit pull down resistors on the arduino's output.

That circuit will only work if the signal from the arduino on Pins D9 & D10 are equal to the voltage on the + external supply. This limits the supply to 5V. As you say you then have the potential of what is know as a "drive through" condition when top and bottom transistors turn on. You can get round this with either a not gate or another transistor driving one of the bases, thus inverting it.

Thanks cr0sh! So you think I'm being overcautious?

No - actually, you're being very diligent in your design; I am actually kinda curious (haven't looked yet) as to what the power-up output states of the digital i/o pins are on the Arduino (ATMega, actually). I have a very similar circuit (though I buffer the output of the Arduino thru opto-isolators to isolate away from potential motor noise; plus my h-bridge is using TO-3 case 2N3055s), so I am facing the same questions. My answers to the issue were basically what I posted to you.

BTW, what's the pros and cons of wiring up an H-Bridge manually vs. just getting a chip?

In my case, AFAIK, there wasn't a "one-chip" solution (well, at least until I know for sure what the current pull will be on my robot platform, which I won't know until I get some real load on it - my h-bridge will drive a large gearmotor, with servo feedback, to turn the front wheels); so I designed for "large amperage" - plus I didn't want to spend a ton of money on an h-bridge driver board, at least at this stage; this is why I chose the 2N3055 in TO-3 cases, and will have heatsinks on them.

The pros are you get to learn about what an h-bridge is, how to build it, and how it works. You might even be able to size it to a higher-current spec than what a single-chip would support (though not always). Plus, the parts tend to be easily available (ie, you can typically buy them down at most local electronics shops; YMMV).

Cons are that you have to build it, you may build it wrong, it will take up more space, and it may cost more and not work as well. You won't have certain things that h-bridge chips usually include (like thermal protection, current sensing, various operation modes, etc).

In my case, I fully expect to actually buy an h-bridge driver board for my usage, but I wanted to go it alone first, myself (I will definitely be doing so for the drive wheels, once I get the basic relay-driver version I will be using initially working - post testing phase) - both to learn how to do it, as well as for some other reasons (then again, if it is good enough, I may just keep it as-is).

I also support MikMo's suggestion on adding the snubbing diodes; you may also want to add on heatsinks on your design as well, depending on your current load needs.

Grumpy_Mike's suggestion is something I didn't think about (well, I kinda did before I posted what I did, but I wasn't sure - I figured someone with more knowledge might chime in); I will definitely add something like this to my design once I get back to it. It is still sitting on a breadboard, fortunately. Grumpy_Mike - what do you suggest for values for the pull-downs?

It is sounding like I need to revisit my design later...

Study many H-bridge schematics to get an idea of what works (there are a lot of bad designs on the net). Its rare to see NPN transistors used on the high side of the H-bridge. Having the high side transistors base current go thru the motor may cause issues.

zoomcat, as I have noted before (here and elsewhere), my design is based on TO-3 NPN's (3055s), for all legs of the bridge; I haven't experienced any problems so far, but if I should change my design, I will - what are your suggestions? Most of the designs online and elsewhere I have seen (in books, etc) have been either all NPN or N-channel MOSFET based (some of the MOSFET designs have been dual N and P-channel designs; but finding such matched pairs didn't seem easy, or when found, cheap - at least for the current levels I am anticipating). I am just looking for some good design advice and pointers...

:slight_smile:

I am actually kinda curious (haven't looked yet) as to what the power-up output states of the digital i/o pins are on the Arduino (ATMega, actually).

It's been discussed quite a lot. I'll look around to see if I can find one thread that's been answered.

It's been discussed quite a lot. I'll look around to see if I can find one thread that's been answered.

Cool - thank you! I figured it had been discussed (plus, it is probably mentioned in the datasheet for the ATMega8/168/328), but I hadn't got around to looking into it because I am working on a separate piece in my project (Pololu Serial Comm Library). I figured I would look into it once I got back to that piece; but if you can find out where that thread was, that would be very helpful for later...

:slight_smile:

After checking my wiring and sketch for the nth time, I crossed my fingers and fired it up...

NO pyrotechnics!
The bridge seems to work. I was able to stop, go forward and backward. I'm using 4 AAA batteries to power a small toy motor. The transistors aren't even warm.

I put two LEDs on pin 9 and 10 (via 1k resistors of course) to watch the Arduino drive the transistor bases.
Interestingly, both rapidly blink a few times during sketch upload. Does anyone know why?

I also found this excellent article on building and theory of the HBridge.
http://www.mcmanis.com/chuck/robotics/tutorial/h-bridge/index.html

Thanks for all the feedback and pointers everyone!

The below open servo h-bridge will be the next design I'll try. Below that is more h-bridge info. Some show good detail and some are more "concptual".

http://www.openservo.com/moin.cgi/Schematic2

http://images.google.com/images?hl=en&as_epq=&as_oq=&as_eq=&num=100&lr=&as_filetype=&as_sitesearch=&as_qdr=all&as_rights=&as_occt=any&cr=&as_nlo=&as_nhi=&safe=images&q=h-bridge+schematic&um=1&ie=UTF-8&ei=ipGQS_rJL4eOlAfhxPD6AQ&sa=X&oi=image_result_group&ct=title&resnum=5&ved=0CCAQsAQwBA

Darlington transistors are not recommended for this application.
If this is just an experiment with a low power toy motor, you may be OK.
For anything more substantial use a H-bridge chip. The are many design issues not apparent from a simple diagram.The chip deals with them.

Darlingtons can behave poorly with PWM control, becuse they switch very slowly.

You have 2.8 volts of drop thru the darlingtons.
4 AAA cells = 6volts when fresh.
Thus almost half your power is wasted in the switches. As the batteries are used up it gets worse. :frowning:

In general people only use discreet transistors in hi-power designs. The transistors are power FET's with very low voltage drop.

zoomcat, as I have noted before (here and elsewhere), my design is based on TO-3 NPN's (3055s), for all legs of the bridge; I haven't experienced any problems so far, but if I should change my design, I will - what are your suggestions? Most of the designs online and elsewhere I have seen (in books, etc) have been either all NPN or N-channel MOSFET based (some of the MOSFET designs have been dual N and P-channel designs; but finding such matched pairs didn't seem easy, or when found, cheap - at least for the current levels I am anticipating). I am just looking for some good design advice and pointers...

I'm currently tinkering with the N channel IRF540 ($.78, 27A) and P channel IRF954N ($1.39, -23A) MOSFETS. Apparently the MOSFETs can be paralled for increased current capacity if needed.

plus my h-bridge is using TO-3 case 2N3055s

That's a very slow switching transistor cr0sh! It probably switches off 1000 times slower than a mosfet - be careful to allow enough dead-time to avoid shoot-through and don't expect it to work at high frequencies (above a few kHz).

Found a datasheet - turn on at 4A is 6us, turn off is 12us.
So at a 10% duty cycle at 1kHz drive you are switching for 18% of the time current is flowing. With mosfets that would be 0.1% or less.

MarkT:

This particular h-bridge is going to be used as a driver for an extremely slow moving Pittman gear motor, acting as servo (via a feedback potentiometer monitored by the Arduino) for a steering mechanism on a PowerWheels vehicle; there likely won't ever be any PWM used, and if it ever is, it isn't going to be pulsed at anywhere near 1 kHz.

But I am definitely keeping all the comments here in mind if I decide to create something for the drive motors on that same PowerWheels car (initially its going to be a relay h-bridge); that is, if I don't decide to purchase an h-bridge for it, or move on to the second beta platform (should I get that far), which will be a quad-cycle or polaris-style vehicle, or something custom.

That's the goal, anyhow - thanks for the comments!

:slight_smile:

aw I used to have a jeep powerwheel! Got it from the dreamfactory after i got out of my surgery for cancer as a kid. Loved that thing!!! Battery wouldn't hold a charge for shit after a couple years so never got it to work after that. Wish that thing was still around, I'd love to tinker on it!