By treating this article as your living datasheet, you now understand not just how to wire the shield, but how to manage its power regulator, implement PWM speed control, and even read stall currents. Whether you are building a line-following robot, a CNC pen plotter, or a simple tank chassis, the HW 130 offers the reliability and power handling you need—all for the price of a coffee.
int currentPin = A0; float voltage, current; void setup() Serial.begin(9600); hw 130 motor control shield for arduino datasheet
| HW 130 Signal | Arduino Pin | Function | Notes | | :--- | :--- | :--- | :--- | | | Digital Pin 4 | Motor A Direction 1 | | | IN2 | Digital Pin 5 | Motor A Direction 2 | | | IN3 | Digital Pin 6 | Motor B Direction 1 | | | IN4 | Digital Pin 7 | Motor B Direction 2 | | | ENA | Digital Pin 3 | Enable / PWM for Motor A | Hardware PWM capable | | ENB | Digital Pin 11 | Enable / PWM for Motor B | Hardware PWM capable | | +5V | 5V Pin | Logic supply (input or output) | | | GND | GND | Common ground | | | CS A | Analog Pin A0 | Current sense for Motor A (voltage proportional to current) | | | CS B | Analog Pin A1 | Current sense for Motor B | | Critical Note: Unlike some generic L298N modules, the HW 130 reserves pins 3 and 11 for PWM, making it ideal for speed control. Do not use these pins for other sensors. Part 3: Schematic Logic & How It Works 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). 3.1 Motor Direction Truth Table (for Motor A) | IN1 (Pin 4) | IN2 (Pin 5) | ENA (Pin 3) | Motor A State | | :--- | :--- | :--- | :--- | | LOW | LOW | HIGH | Brake (stop fast) | | HIGH | LOW | HIGH | Forward | | LOW | HIGH | HIGH | Reverse | | HIGH | HIGH | HIGH | Brake (stop fast) | | X | X | LOW | Coast (free spin) | By treating this article as your living datasheet,
Detect stalls, measure load, or implement torque limiting. Do not use these pins for other sensors
To unlock the full potential of the HW 130, you must remove the ENA/ENB jumpers (JP2 and JP3). Without these jumpers, you manually control those pins via PWM. 5.1 Variable Speed Code (PWM) // HW 130 with analogWrite() PWM speed control // Remove the ENA and ENB jumpers from the shield first int ENA = 3; // PWM capable int ENB = 11; // PWM capable