Sub topic 2
The H-bridge: four switches around a motor
Assume you know basic Arduino output control, voltage and current, and how a transistor works as a switch. This chapter builds the circuit model that motor-driver modules hide inside their packages.
An H-bridge is a circuit that connects a brushed DC motor to a power supply in either direction. It uses four controlled switches arranged around the motor. The motor forms the crossbar of the letter H, while the switches form its two sides.
The four-switch arrangement
Label the switches as follows:
- Q1: upper-left switch
- Q2: lower-left switch
- Q3: upper-right switch
- Q4: lower-right switch
The motor connects between the left and right middle nodes. Q1 and Q3 connect those nodes to the positive motor supply. Q2 and Q4 connect them to ground.
Each vertical pair is called a half-bridge. Q1 and Q2 share the left motor node. Q3 and Q4 share the right motor node. A driver must control each pair so that the upper and lower switch on the same side are not on at the same time.
Direction, brake, and coast states
The motor's direction depends on which side is connected to the supply and which side is connected to ground.
| Q1 | Q2 | Q3 | Q4 | Motor state |
|---|---|---|---|---|
| On | Off | Off | On | Forward |
| Off | On | On | Off | Reverse |
| Off | On | Off | On | Dynamic brake |
| Off | Off | Off | Off | Coast |
In the forward state, current flows from the supply through Q1, across the motor, and through Q4 to ground. The voltage polarity across the motor produces one direction of rotation.
In the reverse state, current flows through Q3, across the motor in the opposite direction, and through Q2. Reversing the motor terminals electrically reverses its torque.
In the coast state, both motor terminals are disconnected from the supply and ground. The motor continues briefly because of its inertia, then slows through friction and internal electrical effects.
In the dynamic brake state, both motor terminals are connected to the same rail, usually ground. The motor's generated voltage drives current through its own circuit, producing torque that opposes rotation. Braking is faster than coasting, but it can create current and heat.
The unsafe combination
Never turn on Q1 and Q2 together. That creates a direct path from the motor supply to ground through two switches, with almost no motor resistance limiting the current. This fault is called shoot-through. It can destroy a driver or reset the controller.
The same rule applies to Q3 and Q4. Integrated drivers often insert dead time, which is a short delay between turning one switch off and the other on. Your control code should still avoid requesting contradictory states, especially during direction changes.
Exercise
Which switches conduct when the motor runs in reverse, and why must Q1 and Q2 never be on together?
Show answer
Q3 and Q2 conduct for reverse operation. Q1 and Q2 must never be on together because they short the motor supply directly to ground.