Handson Technology: L298P 2-A Dual H-Bridge Motor Shield For Arduino
Handson Technology: L298P 2-A Dual H-Bridge Motor Shield For Arduino
User Guide
SKU: DRV1007
Brief Data:
1 www.handsontec.com
Functional Block Diagram:
You can use 2 brushed DC motor by connecting them to Motor A and Motor B terminals on the shield. By
making Direction Control A (D12) and Direction Control B (D13) pins HIGH or LOW, you can control
direction of motors. By changing PWM-A (D10) and PWM-B (D11) rate, you can control speed of the
motors.
2 www.handsontec.com
Board Dimension:
Unit: mm
3 www.handsontec.com
Arduino Connection Examples:
Controlling 2-DC Motor with +12V External Power Supply:
Below is the circuit connection using +12V external power supply, and should be done with the Jumper
inserted as shown. This connection can drive two 12V DC motors simultaneously.
4 www.handsontec.com
Sketch Listing:
Copy and paste the sketch below to Arduino IDE and upload to Arduino Uno/Mega board.
/*==========================================================================
// Author : Handson Technology
// Project : Arduino Uno
// Description : L298P Arduino Motor Shield demo
// Source-Code : L298.ino
//==========================================================================
*/
int E1 = 10;
int M1 = 12;
int E2 =11;
int M2 = 13;
void setup()
{
pinMode(M1, OUTPUT);
pinMode(M2, OUTPUT);
}
void loop()
{
{ int value;
for(value = 0 ; value <= 255; value+=5)
{
digitalWrite(M1,HIGH);
digitalWrite(M2, HIGH);
analogWrite(E1, value);
analogWrite(E2, value);
delay(30);
}
delay(1000);}
{ int value;
for(value = 0 ; value <= 255; value+=5)
{
digitalWrite(M1,LOW);
digitalWrite(M2, LOW);
analogWrite(E1, value);
analogWrite(E2, value);
delay(30);
}
delay(1000);}
}
After successfully download, the 2-DC motors attached to the motor shield will turn forward and backward.
The motor turning direction will be indicated by the yellow and green LED indicators.
5 www.handsontec.com
Web Resources:
6 www.handsontec.com
Handsontec. com
We have the parts for your ideas
7 www.handsontec.com
The Face behind our product quality…
In a world of constant change and continuous technological development, a new or replacement
product is never far away – and they all need to be tested.
Many vendors simply import and sell wihtout checks and this cannot be the ultimate interests of
anyone, particularly the customer. Every part sell on Handsotec is fully tested. So when buying from
Handsontec products range, you can be confident you’re getting outstanding quality and value.
We keep adding the new parts so that you can get rolling on your next project.
P
Engineering Material Mechanical Hardware Electronics Components
8 www.handsontec.com