David thinking about robots ROBOT ROOM a robot
home | projects | contact | copyright & disclaimer | books | links

DC Motor-Driver H-Bridge Circuit

Physical motion of some form helps differentiate a robot from a computer. It would be nice if a motor could be attached directly to a chip that controlled the movement. But, most chips can't pass enough current or voltage to spin a motor. Also, motors tend to be electrically noisy (spikes) and can slam power back into the control lines when the motor direction or speed is changed.

Specialized circuits (motor drivers) have been developed to supply motors with power and to isolate the other ICs from electrical problems. These circuits can be designed such that they can be completely separate boards, reusable from project to project.

A very popular circuit for driving DC motors (ordinary or gearhead) is called an H-bridge. It's called that because it looks like the capital letter 'H' on classic schematics. The great ability of an H-bridge circuit is that the motor can be driven forward or backward at any speed, optionally using a completely independent power source.

An H-bridge design can be really simple for prototyping or really extravagant for added protection and isolation. An H-bridge can be implemented with various kinds of components (common bipolar transistors, FET transistors, MOSFET transistors, power MOSFETs, or even chips).

The example provided on this page features: A diode-less version of this circuit successfully drove Bugdozer to mini Sumo victory. The more robust (diode protected) version actually illustrated below is from Sweet, the line-following robot.

Hmm. It doesn't look like the letter 'H'.

R1 and R2:
Two 10-kilohm or 100-kilohm pull-up resistors.

These make sure the inputs are both on unless a signal from the microcontroller tells one or the other to turn off. With both on, the motor doesn't spin because there's no voltage drop between them.

Think of these as default values. Unless a different value is specified, the lines are pulled up. This means the circuit can come loose or be disconnected completely and the motor won't spin or stutter.

Pulling down to GND would seem logically nicer (both motor wires off by default), but pull-downs use more power for the same effect.

Technically, R1 and R2 could be eliminated, although then the motors are likely to jerk when the microcontroller powers up or powers down.

TC4424 3-amp dual MOSFET transistor driver chip. (The MAX4427 and TC4427A is the same but with a lower amperage rating.) The DIP part can be purchased at Digi-Key as part #TC4424CPA.

This chip provides two independent inputs that are compatible with CMOS or TTL chips. This circuit design uses IN A to vary power (on, off, or pulsed in-between) and IN B to determine direction.

OUT A follows the IN A signal but uses the full voltage from the power source, not the tiny voltage from the input signal itself. OUT B follows IN B in the same way.

For example, if IN A is turned on completely (2.4 volts or better) and IN B is turned off completely (0.8 volts or less) then OUT A turns on completely (up to 22 volts) and OUT B turns off completely (GND). The motor gets 22 volts.

This chip is constructed to protect the static sensitive MOSFETs, but also to protect the input sources from current being jammed back by the motors. Optoisolator ICs could be used at the inputs if greater protection and freedom from noise is desired.

Normally four transistors are needed in an H-bridge. Each transistor forms a corner in the letter 'H', with the motor being the bar in the middle. In this design, each output of the chip forms a complete vertical side of the letter 'H', with the motor still being in the middle. Because a side is now a single output, short-circuits can't form from the top of a side to the bottom of a side. No matter what the inputs, all power must travel from one side to the other -- through the motor.

A mechanical switch, relay, or logical gate could be used to turn the inputs on and off. It would work just fine at providing no movement (on/on or off/off), forward movement (on/off), or reverse movement (off/on). To provide power levels in between (like 50%), rapid pulses of on or off can be provided by pulse-width modulation using a chip or timer.

An important note regarding current rating: The plastic DIP package can only dissipate enough heat when the power usage is below 730 milliwatts. Therefore, it isn't possible to continuously run the chip at both the maximum voltage (22 V) and maximum amperage (3 A) rating. That would result in 66 watts of power usage. (That's ten times the maximum.)

From: Paul Jurczak
Sent: Monday, March 12, 2001 10:59 AM
Subject: DC Motor-Driver H-Bridge Circuit

66 W would be about 100x, not 10x, 730 mW.

But actual DC power losses in the H-bridge would be:
I2 * (Rl + Rh)
= (3 A * 3 A) * (2.8 ohm + 2.5 ohm) = 47.7 W typical
= (3 A * 3 A) * (5 ohm + 5 ohm) = 90 W maximum

Which still is more than enough to melt this IC.


I'm sincerely grateful for the feedback. I don't know what I was thinking with the 66 = 10 * 0.730 math!

As for the power, Paul is correctly pointing out that the chip only needs to dissipate the portion of power used in the chip's resistance.

For current to flow, the chip must have one gate high and one gate low. Therefore, Paul is adding the typical high and low resistance (from the 4427 datasheets) together to calculate the total amount of resistance the chip causes.

When a moving motor is added to the circuit, the motor uses up some (hopefully most) of the power. Just dive for that robot if the motors stall!

Regardless, the chip can't run at maximum volts and maximum amps because most of the 66 watts (47 watts typical) would need to be dissipated by the chip. Frankly, I didn't have this in my head when I originally wrote about it.

Thanks Paul!

D1 and D3:
Schottky small-signal diodes.

I couldn't find any! So, I used 5817 Schottky diodes instead.

The key factors in substitution are:
  • Are the diodes rated to turn on with less voltage than the TC4424's internal transistor base voltage? (600 millivolts)
  • Are the diodes rated to handle the maximum reverse voltage? (22 volts)
  • Are the diodes rated to handle the maximum current? (3 amps)
In the case of the 5817s, the datasheets answers are:
  • Yes. (400 millivolts or less)
  • Nearly. (20 volts -- so this is the circuit's new voltage maximum)
  • Yes, peak (25 amps)
When a motor accelerates or decelerates for any reason (signal, load, or friction), there is reluctance for the electric field present in the motor coils to change. More properly, the changing field induces power. This "refunded" power can jam back into the chips.

D1 and D3 protect the chips from overvoltage by turning on when more voltage is coming from the motor than is coming from the batteries. The batteries absorb the power.

The turn-on rating of the diode must be lower than the turn-on rating of the chip, or else the diode won't turn on early enough to protect the chip.

Because the diode is installed in "reverse", the power can't flow from the batteries to the motors. If the diode was installed differently, power would immediately flow to the motors, bypassing the chip outputs (or worse, short-circuiting through the chip).

By the way, this arrangement is why the reverse or breakdown voltage of the diodes is important. If the reverse voltage rating was less than the full battery voltage, the battery would break down the reversed diode and just shoot through.

D2 and D4:
Schottky small-signal diodes.

D2 and D4 protect the chips from undervoltage (less than ground) by turning on when the voltage in the motor is below GND. Once again, the batteries take care of the problem, rather than power flowing backwards from the chip.

D1 through D4 could be eliminated. In fact,
Bugdozer runs without the diodes. However, parasitic voltages can and do temporarily short power supplies (reset!) and can even destroy the driver chips.

Actual implementation of motor driver

Despite what may seem complicated at first, the above photograph includes added features such as a National Semiconductor LP2954 5V voltage regulator, a bicolor LED, and two switches for testing.

One H-bridge drives one motor. For a common two-wheeled robot, obviously two copies of the H-bridge circuit are needed.

Click for a movie of the H-bridge in action
(Click the picture above for a movie)

David thinking about robots ROBOT ROOM a robot
home | projects | contact | copyright & disclaimer | books | links