Anda di halaman 1dari 4

# Building the Corners Now that we have the transistors picked out, we look at implementing an H-bridge using them.

Because these transistors are a complementary pair, the circuit using them is very symmetrical. The upper right and upper left corners of the H-bridge are called "sources." This name originates from their function which is to be a source of current for the load (in our case the motor). Referring to the schematic on the right, you can see that there is a 10K resistor between the base of the TIP107 and the positive terminal of the battery. This is a pull-up resistor that insures that the transistor is "off" (or not sourcing any current) when the switch is open. The 1K resistor that is connected in series with the switch is used to limit the current coming out of the base when the base is grounded by the switch. So in this case when the switch is closed, the emitter-base junction becomes forward biased and current flows "out" through the base. If the battery is 12V and the voltage drop of the Base-Emitter junction is .7V, then the current flow in the base will be -11.3mA (negative because it is flowing "out"). Given the Hfe specs for this transistor, this level of base current will completely turn "on" this transistor allowing the load to consume as much current as it needs. Conversely, the schematic on the left is called a "sink." Its name is derived from this circuit's function which is to provide a place for current to go once it has passed through the load. The sink lower left and lower right corners of the H-bridge are implemented as circuits. In the sink circuit the 10K resistor connects the base of the transistor to ground, which forces the transistor off when the switch is open. When the switch is closed, current is injected into the base through the now forward biased base-emitter junction. Again the amount of current is nearly identical to the source configuration so an equal amount of current is allowed to flow through the load. Of course if we have to throw switches to turn these transistors on it doesn't make for a very useful Hbridge. In order to drive this H-bridge from a microprocessor we need to put the microprocessor pins in control. In the sink circuit, the transistor stays turned off if the base is grounded, it turns on when current flows through the 1K resistor and into the base. A typical microprocessor's output pin can generally put out either 3.3V or 5V as a logic "true" output. Given that we need only approximately 5 mA to turn the transistor fully on, you could compute the necessary base resistor by subtracting the baseemitter voltage drop (.7V) from the logic high voltage (3.3 or 5) and then dividing by the desired base current (5 mA) to get the appropriate resistor (660 or 1K ohms respectively). The source circuit is another problem entirely and an area I call "the high side problem." Turning on the source is easily accomplished by grounding the 1K resistor, however turning it off requires bringing the 1K resistor up to the motor voltage. You could tri-state the output and let the 10K resistor bring it up to the motor voltage. However, if you did, you're microprocessor pin might be exposed to a voltage that is was not designed to handle. A solution for this problem is to add another transistor to the high side which is a sink circuit to turn on the source circuit! In the schematic you can see that I added a 2N3904 NPN type transistor which replaces the switch in the original schematic. This works because the microprocessor only need turn on the 2N3904 (which is referenced to ground), then that pulls the base of the source