Using the L298 Motor Bridge IC

A very popular and reasonably priced all-in-one H-bridge motor driver is the L298. It can control two motors, not just one. It can handle 2 amps per motor, though to get the maximum current be sure to add a heat sink. The L298 has a large cooling flange with a hole in it, making it easy to attach a homebrew metal heat sink to it.

If there’s a downside to the L298 it’s that it comes in a special “Multiwatt 15” package, with 15 offset pins that don’t match the standard 0.100" spacing of breadboards. But with care, the pins can be rebent as needed. Or you may prefer to simply get a breakout board for the L298, which is a small circuit board with holes drilled in it to accept the chip. You then plug the breakout board into your breadboard. Problem solved.

The schematic below shows a basic connection diagram for controlling two motors using the L298 motor bridge IC.There are three input pins for each motor: Input1, Input2, and Enable1 controls Motor1. Input3, Input4, and Enable2 controls Motor2.

The motors connect to Output1/Output2 and Output3/Output4, as shown.

The L298 uses two different supply voltages. The voltage on pin 9 powers the chip itself and should be 5 volts. The voltage on pin 4 supplies the motors, and it can be up to 46 volts.

Let’s look at how to control just one of the motors, Motor1. In order to activate the motor, the Enable1 line must be HIGH. You then control the motor and its direction by applying a LOW or HIGH signal to the Input1 and Input2 lines, as shown in this table.


Input1

Input2

Action

LOW

LOW

Motor breaks and stops*

HIGH

LOW

Motor turns forward

LOW

HIGH

Motor turns backward

HIGH

HIGH

Motor breaks and stops*

* To coast a motor to a slower stop, apply a LOW signal to the Enable1 line.

The L298 does not have built-in protection diodes, so you’ll need to add those. The datasheet for the L298 specifies “fast recovery” 1-amp diodes; an inexpensive selection is the 1N4933, available from most online electronic parts outlets.

The chip needs several other external parts for proper operation. Because of the added complexity of using the L298, frankly, most folks opt to get a fully integrated module based on the chip. Most of these are in kit form, so soldering is required, but they’re much easier (and often cheaper) to use than collecting and assembling all the parts yourself.