void motorA(int speed) // speed: -255 to 255 if (speed > 0) digitalWrite(IN1, HIGH); digitalWrite(IN2, LOW); else if (speed < 0) digitalWrite(IN1, LOW); digitalWrite(IN2, HIGH); speed = -speed; else digitalWrite(IN1, LOW); digitalWrite(IN2, LOW);
Note: Pin assignments can vary slightly depending on the specific clone manufacturer, but these are standard for the Adafruit-derived designs.
void setup() Serial.begin(9600); // set up Serial library at 9600 bps Serial.println("Motor test!"); hw 130 motor control shield for arduino datasheet better
for (int i = 255; i >= 0; i--) motor1.setSpeed(i); delay(10);
| Shield Label | Arduino Pin | Function | |--------------|-------------|-----------------------| | IN1 | D4 | Motor A direction 1 | | IN2 | D7 | Motor A direction 2 | | EN A (PWM) | D6 | Motor A speed | | IN3 | D8 | Motor B direction 1 | | IN4 | D12 | Motor B direction 2 | | EN B (PWM) | D9 | Motor B speed | void motorA(int speed) // speed: -255 to 255
This comprehensive technical guide serves as an enhanced datasheet and implementation manual, detailing the pin mappings, power limits, and programming workflows needed to maximize the performance of your HW-130 shield. Technical Specifications & Power Matrix
HW-130 Motor Control Shield (often referred to as the L293D V1 Motor Shield) is a versatile expansion board for the Arduino Uno and Mega. It acts as a bridge, allowing the low-power signals from your Arduino to control high-power motors without damaging the microcontroller. Technical Specifications The core of this shield consists of two L293D dual-channel H-bridge drivers 74HC595 shift register to manage I/O pins efficiently. Motor Capacity 4 DC motors with individual 8-bit speed selection. 2 stepper motors (unipolar or bipolar). 2 "hobby" servos (5V) connected to dedicated high-resolution timers. Power Ratings : Supports motors between 4.5V and 25V : Provides 600mA per channel (1.2A peak) with thermal shutdown protection. Safety Features It acts as a bridge, allowing the low-power
| Model | Driver IC | Max Current per Channel | Max Voltage (Motor) | Key Difference | | :--- | :--- | :--- | :--- | :--- | | | L293D | 600mA | 36V | Low-cost, plug-and-play, good for beginners. | | Standard L298N | L298N | 2A | 24V | Much higher current, no shield format, requires more wiring. | | Monster Moto Shield | VNH2SP30 | 30A | 16V | Designed for extremely high-current applications like combat robots. | | Pololu Dual VNH5019 | VNH5019 | 30A | 36V | Professional-grade, robust, and can handle higher voltages. |
A: The L293D chip can theoretically handle up to 36V, but for practical use with small hobby motors and to keep heat manageable, a voltage between 6V and 12V is recommended.
Connect up to 4 DC motors (M1, M2, M3, M4).