An H-Bridge is an IC (integrated circuit) that is used to apply an adjustable amount of power to a component. The H-bridge has the ability to quickly change the direction of the current applied to a component, typically a motor. The switch in current direction effectively changes which way the motor spins. To control how much power is applied by an H-Bridge, they are directly controlled using a pulse-width modulation (PWM) signal. If you are unfamiliar with PWM, follow the red tab in the related materials section.
To properly use the H-bridge, it is important to understand how it actually works. To begin, let's look at a simple circuit that describes how a half H-bridge functions. Figure 1 illustrates a simplified representation of a half H-Bridge. As the name implies, a half H-Bridge has half the functionality of a regular H-Bridge. This means that a half H-Bridge can apply varying amounts of power to the motor, but can not change the motors direction.
In the half H-Bridge circuit, the enable switch is driven by a PWM signal. Different frequencies of PWM signals will let more or less current through the motor on average, increasing or decreasing the speed. Now you may be wondering, why not use the chipKIT™ PWM pin to directly drive the motor? The reason is that the H-bridges are designed to drive loads (i.e., motors) that need more power to function. Power in this sense is voltage times current (and is measured in Watts). Most motors have very low resistances (about 10 Ω to 100 Ω), so a large current (and thus power) is needed to keep the voltage at the required value.
For example, refer back to Ohm's law (Voltage = Current * Resistance), if you needed a motor to run at 5V and it had a resistance of 10 Ω. To balance the equation, you would need to be able to produce 500 mA of current to drive the motor. The chipKIT's PWM is limited in the amount of current it can supply (approximately 25 mA), where the H-bridge can supply a much larger amount (approximately 600 mA). So the H-bridge is able to supply more power than just the chipKIT's PWM alone.
Looking back at Fig. 1, you may have noticed that S1 and S2 are unnecessary for the circuit to function. You could hook the motor directly to the enable switch and get the same effect. While this is true, remember the circuit represents a half H-Bridge. Both S1 and S2 become important when you combine two half H-Bridges to make a full H-Bridge. A simplified representation of a full H-Bridge is shown in Fig. 2 below.
In a full H-bridge the switches form an H around the motor, hence the name H-Bridge. A full H-bridge can also be refereed as a double half H-Bridge, since it is essentially two half H-bridges combined. In the circuit depicted in Fig. 2, you can change the direction of current applied to the motor by keeping either S2 and S3 closed, or S1 and S4 closed.
S1 and S2 should never be closed at the same time, nor should S3 and S4. If either of these switch combos are used, it will create a short circuit while the enable switch is closed. Although this scenario seems unlikely, it can actually happen when working with an H-bridge. If you drive the H-bridge IC with a PWM signal and try to change directions at the same time, there is a good chance you will short circuit and damage your H-Bridge. So it is important to remember to always drive enable low when changing motor direction!