Ardumoto Shield Hookup Guide

This Tutorial is Retired!

This tutorial covers concepts or technologies that are no longer current. It's still here for you to read and enjoy, but may not be as useful as our newest tutorials.

View the updated tutorial: Ardumoto Shield Kit Hookup Guide

Contributors: jimblom
Favorited Favorite 0

Meet the L298

At the heart of the Ardumoto -- the big, black chip right in the middle -- is an L298, one of our favorite dual-channel motor drivers around. On this page, we'll give you some background information on the chip we'll be depending on to drive our motors.

But First...Why a Motor Driver?

DC motors are the easiest motors to use. They're dumb (they don't provide feedback), but they're good at spinning in one direction or the other when we tell them to. Unlike servos or steppers, DC motors don't require any special signals -- just a straight DC voltage. So why can't we just connect them directly to the Arduino?

Well, motors tend to draw a lot of current, and trying to drive a motor straight from your Arduino output pins will make your Arduino quite cross with you. The Ardumoto lets you control a whole bunch of current (good for motors) with an itty-bitty signal (good for Arduinos). Everyone's happy!

Here are some of the important features and specifications of the L298. These extend out to be the specifications of the Ardumoto as well:

Two Channels @ 2A Each

The L298 is a two-channel motor driver. That means it can individually drive up to two motors. So it's perfect for a two-wheel drive vehicle, but if you have a special, four-wheel drive platform, you might need something else (or just two L298's).

Each channel on the L298 can deliver up to 2A to the motor to which it's connected. Keep in mind, though, that the amount of current available to your motor also depends on your system's power source. Batteries are great power sources because they're mobile, and can discharge a lot of current, but high current draw also means they'll drain faster.

The Control Signals

Controlling the L298 is very easy. If you've ever blinked or dimmed an LED, you already have all the tools necessary to control the L298.

For each of the L298's channels, there are two types of input we need to send to drive a motor: direction and enable. Each of these inputs are boolean -- either high or low.

Using the direction inputs, we can control whether the motor spins clockwise or counterclockwise. The L298 actually has two direction inputs for each channel, but on the Ardumoto, as we'll show on the next page, we've merged those two inputs into one.

The enable input can be driven either high or low to make the motor spin or stop. But, with pulse-width modulation (PWM), we can actually use this input to control the speed of our motor. Just like it can be used to dim LEDs, PWM is perfect for controlling how fast our DC motor spins.

All of the control signals are limited to a maximum of 7V. Which is great, because our Arduino is only going to supply a maximum of 5V.

That covers the basics of the L298. If you're curious, or want to know more about the chip, checking out the datasheet is a good place to start.