I am trying to build a direction control circuit for a DC motor using a H-bridge setup. I’ve seen the standard way an H-bridge is set up with transistors and usually it takes two cotrol lines but I was wondering if a slight modification of the layout could allow the use of only one control line to give forward/reverse but no off.
Attached is a scan of what I thought would work. I laied it out on a protoboard using a 7805 regulator to provide the digital input and TIP31(NPN) and TIP42(PNP) transistors. I first tried connecting the +V to the same 7805 output as the digital in and it seemed to work. With a volt meter connected to where a motor would be I was getting one polarity of 5v when the base of the transistors were grounded and then the opposite polarity of 5v with the base(s) connected to the +5v. However, when the base(s) were connected to +5v I think it was the upper right PNP transistor was getting very hot. The same thing would happen when I connected the +V to 12v from the power supply instead of the output of the 7805. But I also saw a difference in the operation when conneted to this higher voltage. When the base(s) were grounded I would get the full 12v power supply voltage, however when I connected the base(s) to the 5v I would read the same as the 7805 output on the volt meter where the motor would go.
Am I missing something as to why this isn’t working?
Thanks for any help!!
I realized that my babbeling can be hard to follow so here’s how the function of this circuit seems to break down:
- Digital in: ground=0 or +5V=1
- +V = +5v
- When Digital In = ground: A = ground, B = +5V
- When Digital In = +5v: A = +5V, B = ground
- Digital in: ground=0 or +5V=1
- +V = ~+14v
- When Digital In = ground: A = ground, B = ~+14V
- When Digital In = +5v: A = +5V, B = ground, Q2(upper right PNP) gets very hot very fast
A and B are the wires that would be connected to the motor as shown in the diagram, however I only have them connected to a volt meter.
You need to have your transistors in the more traditional configuration (PNP on the high side, NPN on the low side, with emitters toward the power rails). You usually have two control lines to two half bridges, but you can invert one of those and then connect to one signal for the kind of forward/reverse control you’re looking for.
I guess I don’t have a complete enough knowledge of transistors to think through it enough. I have seen the inverted configuration you mentioned. The specific example I’ve seen used NAND gates to invert the appropriate signals to provide a single fwd/rev control line. I was trying to eliminate the need for those extra gates by rearrainging the P and N types since I thought of that as basically inverted vs non-inverted already built into the transistors.
So is that the main condition? The emitters need to be towards the power rails? Can I not just turn the top PNP and top NPN around so that their emitters are on the power rails and their collectors are connected to the motor and the collectors of the bottom two transistors?
Am I asking too big of a question to want to know why the PNPs have to be on the high side and the NPNs on the low?
Thanks for the help!
The P vs N inversion isn’t that simple. The voltages or current directions (depending on how you define them) change, too, which is why you see the PNP on the high side and NPN on the low side. To get the low side PNP on, you’d need voltages below 0, and to turn on NPNs on the high side, you would need voltages above your supply voltage.
Anyway, you don’t need two NAND gates, just one inverter (though its output needs to swing from rail to rail). In general, making a decent H-bridge is not that easy; why are you doing it? For small to medium drivers, you can get an integrated circuit that will probably work better than anything you can design, and for high-power drivers where you have to use discrete transistors, it gets more complicated because of the higher voltages and currents involved.
Yea, I think I’m discovering all this out the hard way…
I think because I have such a simple case and lower power motor I’m just going to use a transistor controlled DPDT relay. Basically I am trying to control a valve that will turn a total of 90 degrees with a gear reduction motor. Using 12v it doesn’t pull anymore than maybe 200-300mA when nearly stalling so a small board mounted relay should work fine. An off-the-shelf H-bridge driver would probably work just fine too but even that is probably overkill for my simple implimentation. I have two limit switches that will be activated in the 0 degree and 90 degree positions. So in order to have it shut off when open and then be able to get power and reverse direction when the control line goes low I will use a second DPDT relay and put the appropriate contacts in parallel with the limit switches. I was originally planning on using NPN and PNP transistors in parrallel with those switches to have the same effect but I think I would be running into the same problem. So I think in my case I’ll just adhere to the KISS principle. I guess I just liked the idea of staying solid-state.
An H-bridge is an electronic circuit which enables a voltage to be applied across a load in either direction. These circuits are often used in robotics and other applications to allow DC motors to run forwards and backwards. H-bridges are available as integrated circuits, or can be built from discrete components.
But if you want to be able to control the motor in both forward and reverse with a processor, you will need more circuitry. You will need an H-Bridge. Notice the “H”-looking configuration in the next graphic. Relays configured in this fashion make an H-Bridge. The “high side drivers” are the relays that control the positive voltage to the motor. This is called sourcing current.
The “low side drivers” are the relays that control the negative voltage to sink current to the motor. “Sinking current” is the term for connecting the circuit to the negative side of the power supply, which is usually ground.