H-bridge is a circuit that is able to change the voltage polarity on a load. This circuit is widely used for robotics and anything using a DC motor. It is named that because of its shape as the letter “H”.
H-bridge circuit is commonly used for:
- DC to AC converter (inverter)
- DC to DC converter (push-pull)
- AC to AC converter
Principle of H-Bridge Circuit
H-bridge circuit is a simple circuit that is very useful for controlling the direction of a DC motor. We can control the motor to go either clockwise or counterclockwise.
With the help of a simple microcontroller, controlling this DC motor is an easy task to do.
Just as mentioned above, we mainly use this circuit to control the direction of a DC motor. Observe the circuit below to understand how we make one.
Here we have a motor with its positive terminal on the left and two pair of switches or transistors that operate in a pair:
- S1 and S4
- S2 and S3
Let’s say we want to move the motor in a clockwise direction, we can close the switches S1 and S4. Thus, the current will flow through the positive terminal of the motor.
Thus, if we want to operate in the counterclockwise direction, we will close the switches S2 and S3. Thus, the current will flow through the negative terminal of the motor.
From the operations above, we should understand that S1 and S2 or S3 and S4 should never be closed together, this condition is known as shoot-through.
Not only controlling the direction of the motor, these four switches can generate other operations:
For braking the motor, we just need to close the switches opposite to the currently closed switches.
The operation sequence of our H-bridge with a DC motor can be seen in the table below.
- The “1” indicates that the switch is closed or ON
- The “0” indicates that the switch is open or OFF.
How to Build an H-Bridge Circuit with Transistors
Just like an example above, we basically can build an H-bridge circuit only with four transistors as electrical switches. If you have not understood how a transistor works first. From that explanation, you will fully understand how to operate a transistor as a switch.
Observe the circuit below.
Here we have:
- A DC power supply (VCC)
- A DC motor
- Two PNP transistors (S1 and S3)
- Two NPN transistors (S2 and S4)
Turning on and off transistors with a specific sequence can move the motor in clockwise or counterclockwise direction. Of course, the simplest method of controlling these transistors is by using a microcontroller.
Next question is, why do we use PNP transistors on top and NPN transistors on bottom?
From what we have learnt, what makes a transistor ON or OFF is its voltage difference between the base and emitter or VBE.
When using a PNP transistor, we can use a voltage lower than the VCC and still make the transistor conduct. For example, we can produce 5 V voltage from the microcontroller to the base and 12 V to the emitter.
So what if we insist on using an NPN transistor on the top.
Assume that we produce 5V from the microcontroller to the base, the base-emitter voltage, VBE will be 5 V – 0.7 V = 4.3 V. This is explained in the DC transistor analysis.
This means the motor will be supplied by 4.3 V only. It is too low right?
Other than the type of transistor we should use, we still have to determine its current rating and voltage drop across the collector and emitter.
Our transistors should handle the maximum possible current flowing in the circuit properly for the motor. Assume that our motor draws 2 A at maximum, our transistors should have at least 2 A current rating. It will be better if the current rating is higher than the rated current.
Please be cautious, you never want to turn on left and right transistors simultaneously or it will produce a short circuit.
How to Build an H-Bridge Circuit with Relays
Another approach to build an H-bridge is to use relays. The relay we will use is the DPDT or Double Pole Double Throw. This relay can produce the same principle as four transistors mentioned before.
But there is a disadvantage using a DPDT relay compared to the transistors. If we need fast switching, smaller physical size, and low control voltage, transistor is the clear winner.