So I attempted to do the following H bridge, and well..... it didn't work my transistors just got really hot really fast, so I unplugged everything quickly :.... I have been attempting many different variations to get this h bridge to work, and so far the only way I have been able to is to basically use a Digital pin for each transistor which makes it not an h bridge and uses up way to many pins..... If anyone has some suggestions to lead me down the right path I would greatly appreciate it.
denveralex:
and so far the only way I have been able to is to basically use a Digital pin for each transistor which makes it not an h bridge and uses up way to many pins
What makes you think that by using more than one pin to control each transistor separately, it ceases to be an h-bridge? It doesn't - it's still an h-bridge.
Check John's suggestion, and also make sure you are using the same parts as in the circuit, especially that you are using both NPN and PNP transistors, and that you have them on the right "sides" of the motor - NPNs are for switching the low-side (toward the ground) and PNPs on the high-side (closest to the positive rail). Also note the use of the shmitt trigger IC (74hc14) - don't leave it out, either.
One thing I don't see in that circuit are the flyback diodes; you may have smoked your transistors already, and one or more are shorting...
I have a personal love for logic level IGBTs for this type of thing. Admittedly you then have to use $1-2 transistors rather than $0.10-$0.20 transistors. However, they are significantly more robust and easier to work with. The flyback diodes are also a good point and are quite necessary. I believe they are reverse biased against current flow across each transistor. (So across the C-E of each transistor with the triangle pointed up).
One other note, The one problem with your design, is that the PNPs and NPNs switch at the same time. This could be very bad and cause shoot through, blowing the transistors. I usually see these having Pins Q1 and Q3 Paired together, with Q2 and Q4 paired together, and dead-time in between to prevent this from happening..
The circuit has endemic shoot-through - it can only work if the transistors turn off
instantly - they don't, in fact they turn off rather sluggishly so that for a brief
burst during the transition both high and low-side transistors are fully on and the current
will rise to whatever the supply can produce, all dissipated in the transistors - they get
hot.
This is a bad circuit.
You can arrange to switch a pair of transistors from one signal, but it needs to
be a low-side switch from one side of the H and a high side from the other. You
do this with an extra transistor for each pair:
The solution is simple. Just re-orient the transistors so they are all emitter followers. All emitters connect to the motor and the collectors to +5 and ground. Q1 and Q2 will be NPN and Q3 and Q4 will be PNP.
There will be no possibility of an NPN and PNP being turned on at the same time. The disadvantage would be a dead spot (called crossover distortion) between about 2.2 and 2.8 volts if you were driving it with varying analog signal but you are using a digital driver so that situation can not occur anyway. And yes, use those diodes to protect the transistors. And you won't need those 1K resistors to the base of each transistor, you can just connect the outputs of the 74HC14 directly to the bases in the emitter follower design.
pegwatcher, the problem with setting them up as emitter followers is that rather than having a saturated Vce of on the order of 100mV or less, you have about 700 to 800mV of Vce. But there's more... the output of a digital pin is not 0 to 5V. It depends on how much current it must source and sink. So it might be 0.5V low, 4.5V high. Or worse. Add that to the Vce drop. So in the end, you might be driving the motor with only 3V instead of 5V, and heating up the transistors.
The 74HC14 is a CMOS device so the voltage should go to the rails (0 to VCC) with reasonably low current. If the gain of the transistors is 100 or more, the 74CH14 would only have to source or sink about 4 ma for his stalled motor (he says 360ma). Not enough current to cause much of a drop. Vbe in my experience is about 600 mv for common silicon transistors, which is the important parameter in emitter followers. I believe he will get around 4.4v across his motor in normal operation, maybe slightly less for a stalled motor. I would give it a try and check it out with a voltmeter. Maybe he doesn't need more than 4.4v.
[corrected: Meant to say Vbe rather than Vce]
[another correction, need to add that Vbe in twice, once for the PNP and once for the NPN which would make the voltage across the motor probably slightly less than 4v. That's why we check over our stuff several times, lol. The saturated common emitter design needs to add the Vce drop twice also, but it should wind up closer to 4.5 v. Depends upon what his motor needs, I guess.
Don't forget, that is two Vce drops, so still under 4V to the motor.
And actually, at 4mA source, worst-case says 0.5V drop, and at 4mA sink, about 0.25V drop. So, still not 0 to 5V. So the Vbe adds to that to create a worst-case Vce of >1V on the high side, and around 0.8V low side. Which is .... about 3V across the motor.
Vbe and Vce are equal when both base and collector are at the same voltage, so you can forget about Vce, The emitter will always be within Vbe of the base. So it adds up to about 3.8 V across the motor.
My point is that the voltage on the base is NOT equal to 0V or 5V.
Of course the emitter will be one Vbe drop from the base, that is what Vbe is. But if the base voltage, Vb, is 4.5V and not 5V, then Ve is 4.5 - Vbe.
And the high side switch will be 4.5 - 0.6V = 3.9V, where the low side switch will be 0.25 + 0.6V = 0.85V. So across the motor is 3.9V - 0.85V or approximately 3V.
I am saying the base IS at 0 or 5V because it's driven by a CMOS device. And both the high side and low side will have about .6 Vbe which adds up to 1.2V. Also I can't understand where you get that .25 V on the low side.
You don't add Vce to Vbe. That would not make any sense at all. It is simply Vbe on both the NPN and PNP.
I didn't say that you add Vce to Vbe. Vce in this case is Vbe plus the difference between Vb (voltage at the base) and 0V or 5V, whichever you are trying to drive it to.
I got 0.5V and 0.25V from a datasheet for the 74HC14. CMOS logic has an output impedance, it only draws right to the rails without a load.
OK, I'll give you that. I didn't realize that chip had that much channel resistance, higher than CMOS I remember working with. So, yes, if his motor is drawing 360ma then the base would be offset by .15 or .16 volts from the rails, assuming current gain of 100, which would have to be added in twice for .3 v and now we are getting close to 3.5 volts. If it were me, I would still breadboard it and test it because of variations in components. He would certainly want high beta transistors. I don't know how much current his motor normally draws; he mentions 360 ma when 'stalled' and I don't know for sure what he means by that. Is he talking about the current needed to overcome inertia of his system from standstill or something else.
MarkT's circuit makes a lot more sense to me. Even if the digital driving signal can't go all the way to 5V, it still turns on all the way, and there is about 14mA of drive to/from the base of the transistors. And the H bridge transistors can go fully into saturation, something they can't do with emitter follower configurations.
I understand either the left side transistors or the right side transistors should be switched on. ( Or none )
So Mark's design is a short ( or even a pair of shorts ), if both signals are high, isn't it ?
This is very different to OP's (denveralex) initial picture.
MarkT's design does rely on never having both inputs be high. But the idea is that you always leave a minimum short time between switching one input low, and switching the other input high. In this way, you avoid shoot-through current.
Its not my design, I just copied a common circuit idiom for a 2-pin controlled H-bridge.
(I do claim an original thought of using a bridge-rectifier for the diodes though
There are designs that prevent shoot-through completely, but they are complex as
they need to manage dead-time between high and low switches being on - you might
as well get a chip that does this for you and drives MOSFETs then.
For discrete BJTs you have to manage deadtime yourself in software, or add various
monostables and logic to do what the MOSFET H-bridge drivers do...
With small BJTs shoot-through currents aren't that large as the base current sets a limit,
so people often get away with sloppy circuits.
Yes, saturation would be far superior but far more components needed. I was just looking for something simple with no chance of the shoot-through current, but his motor might not do what he wants with the lower voltage.
Another possibility might be his original circuit with an active current limiter in series with the 5 V?
It adds two transistors and a handful of resistors. The original circuit was missing the diodes (I meant to say something about the clever use of a bridge rectifier) so I don't count those as additional components. Same with the bypass caps.