L298NH 2A Double Channel DC Stepper Motor Driver Shield
The Motor Shield is based on the L298NH, a dual full-bridge driver designed to control inductive loads such as relays, solenoids, DC and stepper motors. With this, you can control two DC motors with your Arduino board, independently controlling the speed and direction of each motor. You can also measure the motor current consumption of each motor, among other things.
• In the Getting Started section, you will find all the information you need to configure your board, use the software for Arduino (IDE), and start tinkering with coding and electronics.
Technical specifications
Operating voltage 5V to 12V
Motor controller L298HN, controls 2 DC motors or 1 stepper motor
Max. current 2A per channel or maximum 4A (with external power supply)
Current detection 1.65 V/A
Idle, stop and brake function
Power
The Motor Shield must be powered by an external power supply only. Because the L298HN IC mounted on the shield has two separate power terminals, one for logic and one for the motor drive, the required motor current often exceeds the maximum USB current rating.
External (non-USB) power can come from an AC-to-DC adapter (wall plug) or from a battery. The adapter can be connected by plugging a 2.1mm center-positive plug into the Arduino board power jack to which the motor shield is mounted, or by connecting the wires leading the power to the Vin and GND screw terminals, respecting the polarity.
To prevent possible damage to the Arduino board on which the shield is mounted, we recommend using an external power supply that provides a voltage between 7 and 12V. If your motor requires more than 9V, we recommend separating the power cables from the shield and the Arduino board on which the shield is mounted. This is possible by cutting the "Vin Connect" jumper on the back of the shield. The absolute limit for the Vin at the screw terminals is 18V.
The shield can supply 2 amperes per channel, for a total of up to 4 amperes.
Input and output
This shield has two separate channels, named A and B, which each use 4 of the Arduino pins to drive or detect the motor. In total, 8 pins are used on this shield. You can use each channel separately to drive two DC motors or combine them to drive one bipolar stepper motor. The pins of the shield, distributed by channel, are shown in the table below:
Function pins per Ch.A pins per Ch.B
Direction D12 D13
PWM D3 D11
Brake D9 D8
Current detection A0 A1
If you do not need brake and current detection and also require more pins for your application, you can disable these functions by cutting the corresponding jumpers on the back of the shield.
Motor connection
Brushed DC motor. You can control two Brushed DC motors by connecting the two wires of each motor to the (+) and (-) screw terminals for each channel A and B. In this way, you can control the direction by setting the DIR A and DIR B pins to HIGH or LOW. You can control the speed by varying the duty cycle values of PWM A and PWM B. If set to HIGH, the brake A and brake B pins will effectively brake the DC motors instead of slowing them down by switching off the current. You can measure the current flowing 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 via the analogRead() function on analog inputs A0 and A1. For your convenience, it is calibrated to 3.3 V when the channel delivers the maximum possible current, i.e., 2 A.