6 BJT H-bridge - Page 1
Forum section: electronics / beginners

author: alex.martinez
author_rank: Contributor
timestamp: November 17, 2017, 07:23:44 pm
content: Hello!I've been recently doing some projects that require some LED switching and I decided to use two of them in anti-parallel, driving them with an H-bridge. I decided to use the common 2N2222 and its counterpart 2N2907 (NPN and PNP, respectively) transistors.To achieve this I first designed one of the two symmetry branches, as I attach in the picture below. Thing is I know that Ib for the first NPN should be around 94 microamps (measured 90 microamps with the multimeter) applying a voltage of 5 V and a resistor of 47k, with a Vbe = 0.6 V (as in the datasheet) , but I arrive at a problem when doing further analysis.Thing is that I do not know what happens with the current from the base between the PNP and the second NPN, my intuition tells me it would have to be the Ib from the first NPN, as it "crosses" from base to emitter, turning on the PNP and the second NPN at the same time. However, when I measure the current between those two bases, I end up with a value of around 1 mA, and I don't know where it comes from. I also added another 2,2 k resistor between the base of the PNP and the collector of the first NPN, this cuts the current to 480 microamps.I'm aware that driving the circuit with MOSFETS, or simply through the micro-controllers PWM DAC would be more efficient, but I am doing this solely to learn about BJTs and H-bridges.If someone could give me any hint, or put me on the path to understand the problem, I would be very grateful.Thank you in advance, Alex.

author: jmelson
author_rank: Super Contributor
timestamp: November 17, 2017, 08:13:55 pm
content: Quote from: alex.martinez on November 17, 2017, 07:23:44 pmWhy on earth do you need THREE transistors to switch ONE LED? And, that is not an H-bridge.One will certainly work.As for your problem, the resistor at the top (2.2K) reduces the voltage across the whole works to a small voltage, when anything is conducting. If you really want to make this overcomplicated circuit work, moving the 2.2K resistor to directly in series with the LED ought to improve things.Jon

author: alex.martinez
author_rank: Contributor
timestamp: November 17, 2017, 08:25:20 pm
content: Quote from: jmelson on November 17, 2017, 08:13:55 pmAs I mentioned, this is just one of the two branches of the H-bridge. I am just learning about H-bridges, I could replace the anti-parallel LEDs with the terminals of a DC motor. I did not include any schematic to an H-bridge, just to one of its two branches.Quote from: jmelson on November 17, 2017, 08:13:55 pmWhy exactly? I do not understand how it can put current through (just the small Ib), when there is no bias. I do not want to make this overly-complicated circuit work to use it as a driver, I just want to understand how it is working.Thank you again,Alex.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: November 17, 2017, 09:50:47 pm
content: You need this:A and B are logic level inputs. Note the current limiting emitter resistors Re, which sets drive current. (In your circuit, current was limited by hFE, a very dangerous design pattern.) Rb provides faster turn-off, because the B-E junction acts like a very small battery (stored charge), and its self-discharge is relatively slow (10s of microseconds).Typical values: BJTs 2N4401/3, Rb = 100, Re = 220, V_IH > 4.5V, V_IL < 1V (that's "voltage, input high/low", typical for 5V CMOS like you get from an Arduino pin or 74HC gate), Iout <= 300mA, t_sw ~ 100ns.Note that you must add logic to prevent A and B turning on at the same time, otherwise the supply is shorted by both pairs of transistors, and the transistors will quickly die (within milliseconds). An example would be the logic inside a TL494 switchmode controller, which has two outputs that turn on alternately, with some "blanking" time between them. (The datasheet gives the equivalent logic circuit: a flip-flop to alternate the outputs, and some NOR gates to enable the outputs between clock pulses.)Tim

author: alex.martinez
author_rank: Contributor
timestamp: November 18, 2017, 04:39:46 pm
content: Quote from: T3sl4co1l on November 17, 2017, 09:50:47 pmThank you very much! When you say my design was limited by hFE, you mean that I should not use the beta value of the transistors? I am aware that it drifts a lot with temperature and other parameters.Sorry for my ignorance but, how does Re limit the current though the transistor? What my intuition tells me, and I am probably mistaken, is that Rb and Re form a voltage divider when A is high? I've run a couple of LTSpice simulation on this circuit, changing values for Re (and optimizing the resistor for the current I want on the output), in order to understand how does it work. But I still do not get how Re sets the current. Could you enlighten me?Quote from: T3sl4co1l on November 17, 2017, 09:50:47 pmYes, I understand that they would start smoking as soon as I turned both A and B high simultaneously, I have adressed that with the micro-controller's code.Again, thank you very much!Alex.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: November 18, 2017, 06:08:03 pm
content: Quote from: alex.martinez on November 18, 2017, 04:39:46 pmYes. For a given input (base) current, you have hFE times that, driving the output transistor bases, and hFE^2 total available output current. Now, for a saturated switch, having lots of available output current isn't necessarily a problem, but the uncertainty in the base currents is bad.With at least a series base resistor (or a signal source with similarly limited output current, like a CD4000 series gate, perhaps), the input current will be limited to a modest value, but the drive current has that factor of hFE.It also doesn't turn off very well, not just dynamically (taking >10us), but statically, too: the first transistor might draw a few nA of leakage current, typical, at room temperature; but, the datasheet gives a maximum of some uA, much more pessimistic. When multiplied by hFE, by the output transistors, this gives a max off-state leakage of perhaps 100s uA. That might not sound like much, but it's enough to dimly light an LED. And it's more when hot -- much more, perhaps mA, because hFE and leakage both rise significantly as temperature goes up.That's the other thing Rb does -- sink leakage current, preventing the output transistors from turning on. That way, the output leakage is only the output transistors' leakage, no contribution from the driver.QuoteYes, a voltage divider, on the low side. The voltage does not divide evenly, because the B-E junction gets forward-biased, pulling the divider node down to a maximum of about 0.7V.If you imagine the NPN output transistor disconnected for a moment, the voltage divider will be unloaded, and you can calculate the Thevenin equivalent circuit. The output voltage is: (V(A or B) - Vbe) * Rb / (Rb + Re), and the output resistance is about (Rb * Re) / (Rb + Re) (i.e., the two resistors act in parallel).This is because the drive transistor acts as an emitter follower, dropping Vbe (about 0.7V), and the rest of the input voltage appears across the divider. So, for a 5V logic input, 4.3V is applied to the divider.For the values I gave, Vth = 1.34V and Rth = 68.7R. Now connect the transistor back up: it sees this driving the base, which rises to 0.7V and therefore draws (1.34V - 0.7V) / (68.7R) = 9.3mA. This base current is nearly independent of hFE, and linearly dependent on input voltage (which is as stable a current limit as you can hope for, without adding additional circuitry).Meanwhile, the emitter follower is getting its current -- about 16mA -- from somewhere. That current is drawn through the collector, which therefore sinks the same current through the high side Rb and PNP transistor. Thus, high and low side are turned on equally well!You want resistor values so that Vth ~ 1.2V, and Rth ~ 0.6V * hFE(sat) / I(load). Vth must be greater than 0.8V to turn on the output transistors at all, and it should be about 2*Vbe to ensure a good balance between turn-on and turn-off performance. (Higher causes more stored charge -- slower turn off -- but if you don't need fast switching speed, that saves you a few mA otherwise wasted in Rb.)hFE(sat) is the saturated hFE -- note that hFE drops sharply as Vce goes towards Vce(sat), because there's simply no voltage left for the transistor to amplify with.Normally, this is chosen to be 1/2 to 1/20 the linear-range hFE value. The datasheet usually gives a hint, here -- check the conditions used to test Vce(sat) or switching speeds. For example, 2N4401 might be measured at hFE(sat) = 10. (On the other hand, low-Vce(sat) transistors have quite good hFE, even at high currents, and can use much higher hFE(sat) values -- PBSS303NX is tested at hFE(sat) = 100 at 4A!)You also need the input (V(A) or V(B)) to be greater than a couple Vbe's, otherwise little voltage is dropped across Re, and the circuit is sensitive to transistor parameter variations (in this case, mainly Vbe tempco -- expect a range of about 0.8 to 0.5V from cold to hot conditions). This means you should choose a different drive circuit for logic inputs below about 3V.Tim

author: alex.martinez
author_rank: Contributor
timestamp: November 18, 2017, 09:19:19 pm
content: Quote from: T3sl4co1l on November 18, 2017, 06:08:03 pmWow, thank you a lot! I have to pump up my BJT knowledge for sure. Thank you for explaining, now I understand it much better. I will try to experiment with this circuit, and make all the calculations.Thank you a lot!Alex.

author: David Hess
author_rank: Super Contributor
timestamp: November 20, 2017, 01:49:30 am
content: Back to your original circuit, the drive NPN pulls increasing current out of the base of the PNP increasing the voltage across the resistor until the collector-to-emitter voltage of the PNP drops enough for the PNP to go into saturation. Then the base current of the PNP increases and is limited only by the emitter resistor. So the PNP's base current increases when it goes into saturation preventing it from directing its emitter current to its collector.Essentially the Vbe junctions of the top and bottom transistors are in series with the collector-emitter saturation voltage of the drive transistor and the PNP's emitter resistor. If it were not for the emitter resistor, the drive current would only be limited only by the beta of the drive transistor.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: November 20, 2017, 01:12:41 pm
content: Yes, which leads to an idea: if you use a series collector resistor instead, you can limit the collector current (and thus, the majority of emitter current). This works similarly to the emitter resistor, but it's not actually as good, for two reasons: 1. base current is still unconstrained, so the source can drive as much excess base current, from the input, into the driver and low side output transistors, as it is capable of; 2. the drive transistor's Vce must swing over a wide range, which takes time -- this incurs full Miller effect, and causes the driver transistor to saturate, storing excess charge.In terms of speed, the practical consequence isn't actually all that much -- it might take 200ns instead of 50 or 100ns to turn on. It's more of a semantic distinction, where you have two similar options -- the same number of transistors and resistors, one arrangement where the resistor is in series with the collector, one the emitter -- and even if the difference is small in this particular case, the one option is unconditionally better. The semantic difference is hinting at a deeper, underlying truth about circuits, that you should minimize action -- changes in voltage and current -- where possible, so that you get the most efficient, fast and well-balanced circuit in the end.Tim