Hw 130 Motor Control Shield For Arduino Datasheet May 2026
Based on the pinout above, here is the truth table. To spin a motor, you set one direction pin HIGH and the other LOW. To brake, set both HIGH.
// HW-130 Motor Shield Pin Definitions #define ENA 5 // Speed for Motor A #define IN1 7 // Direction 1 #define IN2 8 // Direction 2#define ENB 6 // Speed for Motor B #define IN3 9 // Direction 1 #define IN4 10 // Direction 2
void setup() pinMode(ENA, OUTPUT); pinMode(ENB, OUTPUT); pinMode(IN1, OUTPUT); pinMode(IN2, OUTPUT); pinMode(IN3, OUTPUT); pinMode(IN4, OUTPUT); hw 130 motor control shield for arduino datasheet
void loop() // Motor A Forward at 75% speed digitalWrite(IN1, HIGH); digitalWrite(IN2, LOW); analogWrite(ENA, 191); // 255 * 0.75
// Motor B Backward at 50% speed digitalWrite(IN3, LOW); digitalWrite(IN4, HIGH); analogWrite(ENB, 127); Based on the pinout above, here is the truth table
delay(2000);
// Stop both motors digitalWrite(IN1, LOW); digitalWrite(IN2, LOW); digitalWrite(IN3, LOW); digitalWrite(IN4, LOW); delay(1000);void loop() // Motor A Forward at 75%
The datasheet implies "Standard Arduino Logic." Here is the translation:
// Define pins based on HW-130 hard-wiring
int MA_Speed = 3; // Motor A Speed
int MA_Dir = 12; // Motor A Direction
int MB_Speed = 11; // Motor B Speed
int MB_Dir = 13; // Motor B Direction
void setup()
pinMode(MA_Speed, OUTPUT);
pinMode(MA_Dir, OUTPUT);
// ... repeat for Motor B
void loop()
// Motor A Forward at half speed
digitalWrite(MA_Dir, HIGH);
analogWrite(MA_Speed, 128);
This shield utilizes specific Arduino pins to control the motors. If you attach the shield, these pins on the Arduino are occupied.
The heart of the HW 130 is the L298N dual full-bridge driver. To understand the logic, you must grasp the truth table for one channel (using IN1/IN2 and ENA).