Hw 130 Motor Control Shield For: Arduino Datasheet Free

This shield utilizes specific Arduino pins to control direction and speed (PWM). Note that when this shield is attached, you cannot use these pins for other sensors.

Here is the simplest sketch to test Motor 1 on channel A (Pins D4, D5):

// HW 130 Motor Control Shield - Free Datasheet Example
// Motor 1: Speed = D5 (PWM), Direction = D4

#define MOTOR1_DIR 4 #define MOTOR1_PWM 5

void setup() pinMode(MOTOR1_DIR, OUTPUT); pinMode(MOTOR1_PWM, OUTPUT); Serial.begin(9600); Serial.println("HW 130 Test Ready");

void loop() // Forward at 70% speed digitalWrite(MOTOR1_DIR, HIGH); analogWrite(MOTOR1_PWM, 179); // 179 = ~70% of 255 delay(2000); hw 130 motor control shield for arduino datasheet free

// Stop (coast) digitalWrite(MOTOR1_PWM, LOW); delay(1000);

// Reverse at full speed digitalWrite(MOTOR1_DIR, LOW); analogWrite(MOTOR1_PWM, 255); delay(2000);

// Brake (set both PWM and direction to LOW) digitalWrite(MOTOR1_DIR, LOW); digitalWrite(MOTOR1_PWM, LOW); delay(2000);

For stepper motors (using standard Stepper library):

#include <Stepper.h>
// HW 130: Stepper coils on M3 & M4 (Pins D8,D9,D10,D11)
Stepper myStepper(2048, 8, 10, 9, 11);  // steps per rev, pins

void setup() myStepper.setSpeed(12); // 12 RPM myStepper.step(2048); // one full rotation

| Shield Label | Arduino Pin | Function | | :--- | :--- | :--- | | VIN (Motor Power) | Vin (7-12V) | Supplies power to motors (pass-through from Arduino barrel jack) | | GND | GND | Common ground | | B-IA | Digital Pin 4 | Control signal for Motor B (Input A) | | B-IB | Digital Pin 5 | Control signal for Motor B (Input B) | | A-IA | Digital Pin 6 | Control signal for Motor A (Input A) | | A-IB | Digital Pin 7 | Control signal for Motor A (Input B) | This shield utilizes specific Arduino pins to control

Note: Some HW-130 variants use pins D3, D4 (Motor A) and D5, D6 (Motor B). Always verify with a multimeter or test sketch.

Unlike the generic L293D, the HW 130 shield includes onboard power regulation, status LEDs, and logic-level converters.

| Parameter | Value | | :--- | :--- | | Driver IC | L293D (x1) | | Logic Voltage | 5V (from Arduino) | | Motor Supply (VS) | 4.5V – 36V DC (External terminal) | | Max Continuous Current per channel | 600 mA | | Peak Current (per channel) | 1.2 A (for ~100ms) | | Max Total Current (all motors) | 1.2 A | | PWM Frequency Range | 0 – 5 kHz (optimal) | | Thermal Shutdown | Yes (at ~150°C) | | Flyback Diodes | Integrated (inside L293D) | | Board Size | 68.6mm x 53.3mm (Uno R3 footprint) |

// HW-130 motor A forward at 75% speed
int enA = 5;
int in1 = 4;
int in2 = 3;

void setup() pinMode(enA, OUTPUT); pinMode(in1, OUTPUT); pinMode(in2, OUTPUT); void loop() // Forward at 70% speed digitalWrite(MOTOR1_DIR,

void loop() digitalWrite(in1, HIGH); digitalWrite(in2, LOW); analogWrite(enA, 191); // 75% of 255