# The Idea Behind it All. (Theory)...

DC motors are incredibly useful devices. However, without a way to control or modify their activity, such usefulness is limited. As you may (or may not) already know, a DC motor can rotate clockwise or counter-clockwise depending on the direction of the current passing through it. Most brushed DC motors (such as the type used in this tutorial) have two wire leads exiting the body.

Despite the fact that each lead in this motor is a different color, as long as one is connected to a positive voltage source and the other to ground, it will rotate in one direction. By swapping the leads between positive and ground, the direction will be reversed.

Sounds simple enough, and it is. However, it's quite inconvenient to have to manually pull wires out of a power source/ground and reverse them to get the proper direction you want. You are also unable to run the motor at any speed other than the maximum speed allowed by the voltage and current of your power supply. (More on that later). Here is where the H-bridge comes in.

Let's say we had four switches and we are able to arrange them in a clever configuration that allowed current to pass through the motor in two different directions depending on which switches were turned on/off:

In the above diagram, you can see that switches A and D are "ON", allowing current to pass through them while switches B and C are "OFF" thus blocking any current path and forcing it to travel through the motor in one particular direction. This will cause the motor to rotate in one particular direction. (Let's say clockwise for sake of argument in this example).

Now inversely, if we turn off/close switches A and D and turn on/open switches B and C, we get a situation that looks like the following:

Since the current is now flowing in the opposite direction through the motor coils (notice how the "+" and "-" of the motor leads reversed), it will rotate in the opposite direction accordingly (counter-clockwise).

That certainly is more convenient than physically swapping wires, but what exactly do we need in terms of the four switches in order to accomplish this? Well one possibility is hand-controlled, physically operated switches, but that doesn't leave many options for automated or digital control. You will find that most H-bridges are designed with transistors of some sort. We should probably discuss them a little bit before proceeding.