Let's Make Robots!

PRACTICAL (and SAFE) H-BRIDGE for MOTOR DRIVE

I have noticed several people using an H-bridge schematic (commonly circulated on the web) that will work, but if both inputs are high at the same time, can throw a short across the motor power supply.  As long as they never let that happen, these circuits will work, but I consider it unsafe. Since many people here have different levels of expertise in both hardware and software, it is better to use an arrangement that prevents accidentally shorting anything.

Here is a circuit layout with 4 transistors that will drive a motor, but without the chance of shorting the power. In my circuit below, when Q1 is on, Q3 must be off, and when Q2 is on, Q4 must be off.

The reverse EMF diodes can be any fast switching diodes, but Schottky diodes would be preferred. They switch in like 100 picoseconds --(one ten billionth of a second.)

 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Looking at the schematic tells me, if I'm not wrong, that I will either have a voltage drop over the transistors or I will have to use above vcc and below gnd signals to make the transistors fully saturated.

I build one fourth of the circuit, the Q1, and just led the emitter through a 1K resistor to ground. Then I tied the base directly to vcc. After this I measured 0.65v less than vcc across my resistor, and 0.65v between collector and emitter. Q1 was a bc547

This must be due to the grounded collector design, which I then conclude is less optimal in applications were either vcc voltage is quite low or the current is rather high.

In my current project I only have approx 2v vcc, and after two times 0.7v loss there is not much energy left for my motors. (suggestions for low voltage H-bridge designs are most welcome)

And if we were talking high power applications, 0.7v across a transistor at perhaps 20A will lead to a lot of heat, and less "omph" in the motors.

Please correct me where I'm wrong, I'm still rater unexperienced with this analog electronic stuff.

Ok, let me take these one at a time.

You mentioned about voltage drop across the transistors. I would remind you that transistors always have a voltage drop across them; the question is how much of a drop.

To answer that question you have two choices.

      1) check the spec sheet for the transistors in question or

      2) breadboard the circuit and check the voltages across the transistors.

As it happens, I have done both. I did breadboard my circuit as drawn and it worked as designed.

First, let's look at the spec sheets for the 2N3904 & 2N3906. The minimum design spec for voltage drop on any transistor is at saturation. On page 3 of the spec sheet, we find VCE(sat), the collector-emitter saturation voltage showing 200 mV. (It reads the same on the sheets for both transistors.) In my breadboarded circuit, I found the actual readings ranged from 180 mV to 300 mV, This shows that individual transistors can vary from the design specs, and some of the variance could have been from other circuit components as well.

Now, you said you: "just led the emitter through a 1K resistor to ground". I get what you meant. Collector was tied to Vcc, Base was tied to Vcc and Emitter was tied to a 1 KΩ resistor, the other end of which was tied to ground (V-). When you said you read 0.65 volts across base-emitter, I can agree with that. The spec sheet for a BC547 shows 0.70 volts (700 mV) design spec at 10 mA current, which is close enough. We know from above that 650 mV versus 700 mV is within the same design-versus-real-world measurement differences.

I can answer your question about lower voltage H-bridges with 2 possible suggestions. 1) Find germanium transistors which will carry enough current for your motors, or 2) switch to FETs.  Either of these choices will have lower voltage drops than silicon transistors, but germanium transistors, while available in today's world can be a bit hard to find. FETs are known to be slower in responce than junction transistors, but at the switching speeds we use in these robot projects, you will not notice the difference. That "slowness" only affects very high speed switching.

I agree that we always have a (small) VCE  voltage drop. Thats not my problem.

Problem is that in the grounded collector circuit you will have a hard time to get enough VBE voltage to drive to transistor to saturation.

The transistor only conduct current between collector and emitter if it conduct a current between base and emitter. And that requires the base to be 0.7V (if silicon)  above emitter (if NPN type). 

In the grounded collector seen at your Q1, if you want emitter to reach the full VCC, you have to drive the base 0.7V higher than VCC. If you only have one VCC source, eg one battery, the highest you easily can get base voltage to will be the same as seen on your collector. And then the emitter will be 0.7V lower.

On the other hand, in grounded emitter circuits, you usually have plenty of "headroom" to drive the base 0.7V away from the emitter.

 

If the base is tied to the same voltage that the collector is, the transistor will naturally be in saturation. As you indicated, the emitters will not reach either full Vcc nor ground because of the inherent junction voltage drop, but this will not be a problem (except if Vcc should be a very small value). It is something you take into account when designing the circuit.

I am not sure why this matters, but if the voltage available at the emitter of the NPN is not high enough, then you needed to use a higher supply voltage. You are correct that for the emitter of one of the NPNs to be "the full VCC" value, the base would have to be biased higher than the present Vcc, but the collector will ALSO have to be higher than the present Vcc as well because of the collector-emitter voltage drop. So in other words, you would simply use a different Vcc that is a slightly higher voltage if it was not high enough before.  If you were using Vcc = 5 volts and the available voltage to the motor is not high enough, then you must use a higher battery voltage for Vcc. There is always a voltage drop across transistor junctions... -that is the nature of junction transistors. In designing your circuit, you must plan for that and set your supply voltage accordingly.

Whether you use grounded emitter or grounded collector, you will have the same voltage drops across the junctions. That is internal to how a transistor functions. -the "nature of the beast", so to speak.

If you wanted the available voltage to be closer to the Vcc you are already using and cannot live with the natural voltage drop, you could substitute germanium transistors which have a much lower junction drop than silicon, or your could use FETs which will give you "almost" the full Vcc swing.

Ok, I designed this more or less crazy circuit. It will short the supply if it raises more than a little over 2V, AND the inputs are not tied either high or low. But if you stay around 2V supply, it only looses a approx 0.1V in the transistors, the rest goes to the motor.

Low voltage, low power H-bridge

There are no protection diodes, maybe I should add them. But the motors I currently use, only draw 15mA under normal operation, and apparently they do not induct much then the transistors switch off.

Although a bit unorthodox, this design could actually work. I would have to breadboard it to be sure and do not have any BC547s nor BC557s, so I must resort to the spec sheets and use theoretical design values.

As you pointed out, if the Vcc were higher than 2 volts, you would indeed have both sides shorted across the battery.

There are a couple things that could still throw a spanner in the works.

1) Your motors draw ~15 mA during normal running, but how much do they draw in a motor-stall (or startup) condition? Remember that the gain at saturation for these transistors is ~20, so 1/20th the motor drive current must flow through the base of each "on" transistor. This may require changing the input resistors from 1 KΩ to another value.

2) Secondly, how well it will work also depends on what you are driving the A & B inputs from. If the drive current comes from an FET circuit, you would probably be fine, but if from junction transistors, the input voltage won't be able to swing the full 2 volts and you would have to count this series voltage drop against the voltage present at the Bases of your h-bridge transistors.

 

Yes, the 1Kohm is a bit high, that actually part of the plan, I don't want the motors to draw too much power, that would sink the battery voltage too much, causing the atmega328p to crash. I'm running on a really weak power source here. Two almost depleted AA cells. When my mouse rejects the batteries they get a second life powering my next robot. Call it recycling or call it madness!

And that answering your next question too, the bridge gets driven from an atmega328p port

Dan, Pretty sure C1 should be across the outputs, not in the in line position. Unless you are doing some super high freq Pwm that is :-) Thanks for the diag Dan, much appreciated Shane
Circuit diagram reading 101 fail. Sorry Dan.

<grins>  No worries.