What is an H-bridge, how it works and how to use?

  • Dec 26, 2019
click fraud protection

H-Bridge - this is a simple circuit that allows you to control a DC motor for adjusting the direction of rotation.

H-bridge is often used with a microcontroller, e.g., Arduino, circuits for implementing control of the engine.

As an example of realization: you can control two motors, which will rotate in different directions, and based on this, you can create a simple robot!

Concept

Here the concept of H-bridge:

Fig. 1. Scheme H-bridge
Fig. 1. Scheme H-bridge

DC motor rotates forward or backward, depending on how you connect the plus and minus.

If you will close the switches S1 and S4 (Fig. 2), plus you have connected to the left side of the engine, and less to the other side. And the motor will rotate in the same direction.

Fig. 2. Alternatively, when the S1 and S4 are closed
Fig. 2. Alternatively, when the S1 and S4 are closed

If, instead, you will close the switch S2 and S3 (figure 3), you will be a plus, connected to the right side, and negative to the left side. And the motor will rotate in the opposite direction. It's simple!

Fig. 3. Alternatively, when S2 and S3 are closed
Fig. 3. Alternatively, when S2 and S3 are closed
instagram viewer

H-bridge circuit with transistors

You can build H-bridge with four transistors.

If you are not sure how the transistor, I recommend that you first read my article "How do the transistors". From there, you will know that the transistor can operate as a switch that you can open and close by applying voltage to the base.

Fig. 4. H-bridge transistors
Fig. 4. H-bridge transistors

Since the transistor can be a switch, you can rotate the motor in either direction, toggling the four transistors in the circuit above.

Typically, the control transistor of the microcontroller, such as the Arduino. I wrote good article in this regard.

What transistors are used?

Most importantly, all the transistors can withstand enough current to drive the motor. Otherwise, they will burn.

For example, if the engine consumes 1 ampere of current, you need transistors that can withstand at least 1 amp.

Next, you see them in Figure 4 are selected PNP-transistors (Q1 and Q2) above, and NPN-transistors (Q3 and Q4) below.

That enables or disables the transistor, - a voltage difference between the base and emitter.

With the PNP-transistors, you can use a higher voltage VCC (the diagram is referred to as A), than for the transistor base.

For example, you can use the outputs from a 3.3V microcontroller and 9 V to VCC.

Protective diodes in the H-bridge circuit

A side effect of engine operation is the fact that it also generates electrical power. When you turn off transistors to stop the operation of the engine, this energy must be some way to put out.

If you add diodes (Fig. 5) in the reverse direction for transistors, will give you the current path for the release of this energy. Without them, you are risking to raise tension and damage your transistor.

Fig. 5. Full scheme H-bridge with diodes
Fig. 5. Full scheme H-bridge with diodes

Resistors included in each database, designed to reduce the current to each transistor. You do not know how to calculate it? If you are using a microcontroller to control them, start with 1 k and adjust.