Build Your Own Inexpensive H Bridge

Introduction: Build Your Own Inexpensive H Bridge

Build your own efficient H Bridge for driving motors, and other loads that need to be driven bidirectionally.

Start with an ebay purchase:

100PCS AO3401 A19T 4.2A/30V SOT23 P-Channel MOSFET SMD transistor ($2.50)

100PCS AO3400 A09T 5.7A/30V SOT23 N-Channel MOSFET SMD transistor ($2.50)

Arrange the transistors with 2ea. P type on top, and 2ea. N type below. Add an enable transistor. See circuit diagram. Solder the SMT transistors to the perfboard. Note they need to be slightly offset to fit to the 0.1" circuit board pads.

Finally, test out the H Bridge. The battery should put out no more than the microcontroller can handle. Put a small motor across the output, (with a parallel led with a series resistor if desired). Program an ATtiny85 or Arduino with the code provided. The motor should move one way for a few seconds, stop, and reverse direction. Install Schottky diodes across the transistors to limit reverse voltage spikes, especially for bigger motors. Note that you can simplify the wiring from the H Bridge to the ATtiny by combining gate drives on the left and right sides of the Bridge (connect the gate of the bottom right FET and top right FET to PB1, and bottom left FET and top left FET to PB0), and the sketch still works. Thus PB3 and PB4 are free for other uses.

If you want to use a higher voltage for the motor than the microcontroller uses, you need to add an additional 2 transistors to avoid shoot through, which will kill the H Bridge and, likely your microcontroller too. This is because the P mosfet gates won't get driven to a high enough level to insure turn- off, while the N mosfets would be driven fully on. Add the additional 2 transistors as shown in the circuit diagram.



    • Metalworking Contest

      Metalworking Contest
    • Water Contest

      Water Contest
    • Tiny Home Contest

      Tiny Home Contest

    4 Discussions

    So you are just using them as diodes right? Diodes would do the same job ?

    3 replies

    No, the problem with diodes is current can't be turned off in a diode. To control the current direction through the motor, one pair of diagonally placed transistors must be conducting, while the other diagonal pair must not conduct.

    But surely one diode one way and another the opposite way current can only flow one way at a time depending on the feed polarity?

    Current could flow through the diodes, but it would cause a short circuit, and no current would be flowing through the motor. See

    H bridge should operate like there are 4 switches that can be opened or closed to steer current through the motor. See