A current direction circuit allows you to reverse the polarity of a load—most commonly a DC motor—without physically swapping the wires. While integrated motor drivers like the L298N or DRV8833 are convenient for quick prototypes, understanding how to build a discrete H-bridge from individual transistors is a fundamental rite of passage for any electronics designer. It forces you to confront real-world issues like shoot-through, inductive kickback, and saturation voltages that are hidden inside silicon ICs.
In this guide, we will design a 5V discrete H-bridge current direction circuit using standard bipolar junction transistors (BJTs). We will cover the topology, select real component values based on load calculations, analyze failure modes, and walk through a safe breadboard testing procedure.
H-Bridge Topology and Node Definitions
The H-bridge gets its name from its schematic shape: four switches arranged in two parallel legs, with the load bridging the middle like the crossbar of an 'H'. For a low-voltage (5V) breadboard build, we use PNP transistors for the high-side switches and NPN transistors for the low-side switches.
Node Labels and Switch Mapping
- VCC (Node 1): 5V DC power supply positive rail.
- GND (Node 2): Common ground reference.
- OUT_A (Node 3): Left motor terminal (junction of Q1 and Q2).
- OUT_B (Node 4): Right motor terminal (junction of Q3 and Q4).
- IN1 (Node 5): Logic control input for the left-leg PNP (Q1) and right-leg NPN (Q4).
- IN2 (Node 6): Logic control input for the right-leg PNP (Q3) and left-leg NPN (Q2).
When IN1 is driven HIGH (5V) and IN2 is driven LOW (0V), Q1 turns OFF and Q4 turns ON, while Q3 turns ON and Q2 turns OFF. Current flows from VCC through Q3, across the motor from OUT_B to OUT_A, and down through Q4 to GND. Reversing the logic states reverses the current direction.
Behavior and Logic State Table
The following table defines exactly how the circuit behaves under all four standard logic combinations. This is the foundational truth table for any H-bridge current direction circuit.
| IN1 State | IN2 State | Q1 (PNP) | Q2 (NPN) | Q3 (PNP) | Q4 (NPN) | Current Path | Motor Action |
|---|---|---|---|---|---|---|---|
| 5V (HIGH) | 0V (LOW) | OFF | OFF | ON | ON | OUT_B → OUT_A | Forward Rotation |
| 0V (LOW) | 5V (HIGH) | ON | ON | OFF | OFF | OUT_A → OUT_B | Reverse Rotation |
| 5V (HIGH) | 5V (HIGH) | OFF | ON | OFF | ON | OUT_A/B → GND | Dynamic Braking (Low-Side Short) |
| 0V (LOW) | 0V (LOW) | ON | OFF | ON | OFF | OUT_A/B → VCC | Coast / High-Side Tie |
Why an H-Bridge Over the Alternatives?
Before committing to a discrete transistor layout, it is worth asking why we don't just use a simpler alternative. The choice of topology dictates your control bandwidth and efficiency.
| Topology | Direction Control | PWM Speed Control | Switching Speed | Wear & Tear |
|---|---|---|---|---|
| Discrete H-Bridge | Yes (Solid-State) | Yes (High Frequency) | Nanoseconds | None |
| DPDT Relay | Yes (Mechanical) | No (Contact Bounce) | Milliseconds | High (Arcing/Pitting) |
| Single N-MOSFET | No (Unidirectional) | Yes | Nanoseconds | None |
A DPDT relay can reverse polarity, but mechanical contacts suffer from bounce and arcing, making high-frequency PWM speed control impossible. A single transistor only allows unidirectional flow. The H-bridge is the only topology that provides both bidirectional control and solid-state PWM compatibility, which is why it remains the industry standard for motor drive stages (Texas Instruments, H-Bridge Motor Drive Application Report).
Component Selection and Design Walkthrough
Let's design this for a standard 5V DC hobby motor that draws roughly 300mA under normal load and up to 800mA when stalled. We are operating at 5V, which allows us to drive the BJT bases directly from a 5V microcontroller GPIO without needing complex level-shifting circuitry.
1. Transistor Selection
For the low-side NPN switches, we will use the 2N2222 (max Ic = 800mA). For the high-side PNP switches, we will use the 2N2907 (max Ic = 600mA). Both are widely available in TO-92 breadboard-friendly packages.
2. Base Resistor Calculation
To ensure the BJTs act as closed switches, we must drive them into hard saturation. The 2N2222 has a typical DC current gain (hFE) of around 100 in the active region, but in saturation, we use a forced beta of 10 to 20 to guarantee a low Vce(sat).
- Target Collector Current (Ic) = 300mA
- Forced Beta (hFE_sat) = 20
- Required Base Current (Ib) = 300mA / 20 = 15mA
- GPIO Voltage = 5V, Base-Emitter Drop (Vbe) ≈ 0.7V
- R_base = (5V - 0.7V) / 15mA = 286Ω
We will select a standard 270Ω or 330Ω resistor for all four bases. Using 330Ω yields about 13mA of base drive, which is sufficient to saturate the transistors for our 300mA continuous load while keeping the GPIO current well within the 20mA safe limit of most microcontrollers.
3. Flyback Diode Selection
When a BJT turns off, the motor's inductance resists the change in current ($V = L \frac{di}{dt}$), generating a massive voltage spike. You must clamp this. While the 1N4007 is common, its reverse recovery time (~30µs) is too slow for PWM frequencies above 1kHz. Instead, use the 1N5819 Schottky diode. It has a negligible recovery time and a low forward voltage drop (~0.6V), clamping the inductive spike safely back into the VCC rail (Electronics Tutorials, DC Motor Fundamentals).
Failure Modes: What Breaks at the Extremes?
Discrete H-bridges are unforgiving if you ignore their physical limitations. Here is what happens when you push the circuit to its extremes.
If IN1 and IN2 are both driven HIGH simultaneously, or if you switch directions without a software 'dead-time' delay, Q3 and Q2 (or Q1 and Q4) can turn on at the same time. This creates a direct, low-resistance path from VCC to GND. The resulting short circuit will instantly melt breadboard traces, pop the transistors, and potentially destroy your microcontroller. Always implement a 5µs to 10µs dead-time in your firmware where both inputs are LOW before reversing direction.
Open Circuit Failure (Missing Flyback Diodes)
If you omit the 1N5819 diodes and turn off the transistors while the motor is spinning, the inductive kickback will spike the voltage at the OUT_A/OUT_B nodes to 50V or more. The 2N2222 has a maximum Collector-Emitter breakdown voltage (Vceo) of 40V. The transistor will avalanche, short out internally, and fail permanently. Never energize an inductive load without a freewheeling path.
Short Circuit Failure (Stalled Motor)
If the motor mechanically jams, the current will spike to the stall current (e.g., 800mA). The 2N2907 PNP is rated for 600mA continuous. It will overheat and thermally runaway. In a production design, you would add a low-side shunt resistor and an op-amp to implement cycle-by-cycle current limiting. For a breadboard prototype, ensure your power supply has a current limit set to 1A.
Step-by-Step Breadboard Testing Procedure
Do not just plug everything in and apply power. Follow this systematic verification process to avoid burning out your components.
- Build the Low-Side First: Insert the two 2N2222 NPN transistors. Connect their emitters to the GND rail. Connect the 330Ω base resistors to your IN1 and IN2 control lines. Leave the collectors floating for now.
- Add the High-Side: Insert the two 2N2907 PNP transistors. Connect their emitters to the 5V VCC rail. Connect their base resistors to the control lines (IN1 drives Q3, IN2 drives Q1). Connect the collectors to the corresponding NPN collectors to form the OUT_A and OUT_B nodes.
- Install Flyback Diodes: Place four 1N5819 diodes across the motor terminals. Critical detail: The cathode (stripe) must point UP towards VCC for the high-side diodes, and DOWN towards the motor terminals for the low-side diodes. They must be reverse-biased during normal operation.
- Verify Dead (Multimeter Check): Before applying power, set your multimeter to continuity/diode mode. Probe between VCC and GND. You should read an open circuit (OL). If you read a short (< 5 ohms), you have a wiring error or a blown transistor. Fix it before proceeding.
- Logic Verification (No Motor): Apply 5V to the VCC rail. Connect IN1 to 5V and IN2 to GND. Measure the voltage at OUT_A and OUT_B with your multimeter. OUT_B should read ~4.8V (VCC minus Vce_sat and Vbe drops) and OUT_A should read ~0.2V. Reverse the logic and verify the voltages swap.
- Connect the Load: De-energize the board. Connect the 5V DC motor between OUT_A and OUT_B. Re-apply power and test the forward/reverse states using jumper wires to manually toggle IN1 and IN2.
Once the manual logic states are verified, you can connect IN1 and IN2 to your microcontroller's PWM pins. Remember to write your firmware with a strict dead-time delay between direction changes to protect your discrete current direction circuit from shoot-through destruction.






