The Arduino Motor Shield uses an L298 a dual full-bridge driver designed to drive inductive loads such as relays, solenoids, DC and stepping motors. It lets you drive two DC motors with your Arduino board, controlling the speed and direction of each one independently. You can also measure the current absorption of each motor, among other features.
This shield has two separate channels, called A and B, which of which uses four Arduino pins to choose the rotation direction, vary the speed, fast brake or sense the current that is flowing through the motor. Thus, in total there are eight pins in use on this shield. You can use each channel separately to drive two DC motors, or combine them to drive one bipolar stepper motor. The shield can supply 2A per channel, for a total of 4A maximum. It has ports that are compatible with TinkerKit modules.
This shield has the 1.0 standard Arduino pinout that was introduced beginning with the Arduino Uno R3 board.
Arduino Motor Driver Shield Features
- Operating Voltage: 5V to 12V
- Motor controller: L298P
- Drives 2 DC motors or 1 stepper motor
- Max current: 2A per channel or 4A max (with external power supply)
- Current sensing: 1.65V/A
- Free running stop and brake function
- Dimensions: 2.7 × 2.1 inches
Powering the Shield The Arduino Motor Shield must be powered only by an external power supply. Because the L298 IC mounted on the shield has two separate power connections — one for the logic and one for the motor supply driver — the required motor current often exceeds the maximum USB current rating.
External (non-USB) power can come either from an AC-to-DC adapter (wall-wart) or battery. The adapter can be connected by plugging a 2.1mm center-positive plug into your Arduino board's power jack, or by connecting the wires that lead the power supply to the Vin and GND screw terminals, taking care to respect the polarities.
To avoid possible damage to the Arduino board on which the shield is mounted, you should use an external power supply that provides a voltage between 7V and 12V. If your motor requires more than 9V, you should separate the power lines of the shield and the Arduino board on which the shield is mounted. This is possible by cutting the Vin Connect jumper placed on the back side of the shield. The absolute limit for the Vin at the screw terminals is 18V.
The power pins are as follows:
- Vin on the screw terminal block is the input voltage to the motor connected to the shield. An external power supply connected to this pin also provides power to the Arduino board on which is mounted. By cutting the Vin Connect jumper, you make this a dedicated power line for the motor.
- GND Ground on the screw terminal block.
The shield can supply 2A per channel, for a total of 4A maximum.
Input and Output The shield's pins, divided by channel, are shown in the table below:
|Function ||Ch. A pin ||Ch. B pin |
If you don't need the Brake or the Current Sensing and you also need more pins for your application, you can disable these features by cutting their respective jumpers on the back side of the shield.
Additional I/O connections on the shield are as follows:
- Screw terminal to connect the motors and their power supply.
- 2 TinkerKit connectors for two Analog Inputs (in white), connected to A2 and A3.
- 2 TinkerKit connectors for two Analog Outputs (in orange in the middle), connected to PWM outputs on pins D5 and D6.
- 2 TinkerKit connectors for the TWI interface (in white with 4 pins) — one for input and the other one for output.
Motor Connections You can drive two Brushed DC motors by connecting the two wires of each one to the (+) and (-) screw terminals for each channel (A and B). In this way, you can control their direction by setting HIGH or LOW the DIR A and DIR B pins, and you can control their speed by varying the PWM A and PWM B duty cycle values. The Brake A and Brake B pins, if set HIGH, will effectively brake the DC motors rather than let them slow down by cutting the power. You can measure the current going through the DC motor by reading the SNS0 and SNS1 pins. On each channel there will be a voltage proportional to the measured current, which can be read as a normal analog input, through the function analogRead() on the analog inputs A0 and A1. For your convenience, it is calibrated to be 3.3V when the channel is delivering its maximum possible current, i.e. 2A.
Arduino Motor Driver Shield Resources