Building the H-Bridge

I really like this H-bridge for a number of reasons, not the least of which is that if you buy your parts in quantities of 1, all the parts cost under $5 (excluding tax & shipping of course) for a 1 - 5 amp capable H-bridge. This keeps the final circuit in the "cheap" category which was one of the design parameters we're optimizing for. The complete schematic for the bridge is shown below.

The fast recovery diodes (shown in light blue) are optional when you are using the TIP102/107 as those transistors have a diode built into them. However you can include them for greater protection at higher currents and still keep the cost at $5 per bridge. In the table below is a parts list, with prices from November of 2003, using part numbers from Mouser Electronics. You will note that I also take advantage of the symmetrical nature of the bridge by using resistor packs rather than individual resistors. These packs allow for a tighter design while still using through hole technology. If size is an issue, you'll probably go with surface mount rather than this type of circuit.

Qty Mouser Part # Description Each Total
2 511-TIP107 TIP107, PNP Power Darlington Transistor (TO-220AB) $0.70 $1.40
2 511-TIP102 TIP102, NPN Power Darlington Transistor (TO-220AB) $0.70 $1.40
1 652-4608X-102-10K 10K Ohm, SIP Resistor network (independent resistors) $0.23 $0.23
1 652-4608X-102-560 560 Ohm, SIP Resistor network (independent resistors) $0.23 $0.23
1 652-4608X-102-1K 1K Ohm, SIP Resistor network (independent resistors) $0.23 $0.23
1 551-PS2501-4 Quad Opto-coupler (16 pin DIP) $1.31 $1.31
4 625-1N4933 1A Fast Recovery Rectifier (Optional) $0.05 $0.20
   

Total For Components

  $5.00

Table 1) Parts List for the Simple H-Bridge

In the previous section we discussed the individual parts of this design, here they are gathered together in a single circuit. You should notice that the opto-isolator LEDs are connected to three wires  labeled "FWD", "REV", and "ENA*." These wires deserve a bit of explanation.

Processor Interface

The FWD, REV, and ENA* lines are the interface between the bridge and the microprocessor. You will notice their is no "ground" signal. When you connect these pins to a BASIC stamp or a 68HC11 or what-ever, combinations of 1's and 0's on the line turn on different pairs of transistors. The following table lists all possible combinations of input.

FWD REV ENA* Description
1 0 0 Turn on upper left source and lower right sink. (go forward)
1 0 1 Disable lower right sink. When fed a PWM signal the bridge modulates the "forward" current through the motor.
1 1 0 Turn on both lower left sink and lower right sink, shorting the motor. This causes a rotating motor to stop rotating so this mode is called "Braking."
1 1 1 Disable both lower sinks. When fed a PWM signal the bridge modulates the "braking" of the motor.
0 1 0 Turn on the upper right source and lower left sink. (go backward)
0 1 1 Disable lower left sink. When fed a PWM signal the bridge modulates the "reverse" current through the motor.
0 0 0 Turn off all sources and sinks. "Coast" motor is not engaged at all.
0 0 1 Turn off all sources and sinks in a different way, same effect though.

This works because the processor pins become a connection to ground when they are outputting a logic 0. Thus when FWD is 1 and ENA is 0, the lower right sink is getting current from FWD which it is returning through the pin connected to ENA. At any given time the pin must be able to supply enough current to turn on two LEDs and when set to zero sink the current of two LEDs. With the 560 ohm resistors and a 5V processor like the PIC this is not a problem. From the data sheet on the opto-isolator, each LED has a forward voltage drop of 1.2V, so (5 - 1.2) / 560 is 6.8mA per LED or 14mA of load total. The PIC is specified to be able to drive 20mA. You can replace the 560 ohm resistors with 680 ohm resistors to reduce the current through the LEDs still further. However the LED voltage drop can be as high as 1.4V and the PIC's operating voltage can be as low as 4.5V, in that condition with 680 ohm resistors you would only put 4.5mA into each LED which is below the 5mA specified in the datasheet. The 560 ohm resistor is the better choice as it maintains sufficient margin.

So why go to all this trouble? The interface as designed gives you access to all of the interesting combinations of sinks and sources enable, while not allowing for any "illegal" states. An illegal state in a full quadrant H-bridge (4 inputs, one for each quadrant) is one that turns on the upper source and lower sink on the same side. This combination causes a direct short circuit to be created between the battery terminals (not good!) and usually causes one or both of the transistors that are on to go up in smoke. Further, as the low end PIC chips like the PIC16F628 has a single hardware PWM line, this lets you connect that line to the bridge and a couple of GPIO pins to the FWD and REV lines to get a hardware PWM on the bridge. Just remember not to go above 2.5Khz unless you replace the opto-isolator with a faster one.

Summarizing

So before we solder it all together, lets analyze the design and try to characterize its performance. This will give us confidence that this H-bridge will meet the requirements we need it to meet, and we won't be surprised by it not working on us.

Next: Bridge Analysis ...


Implementing an H-bridge  

Bridge Analysis