The HW-130 shield is electrically compatible with the , so the AFMotor library works directly.
void loop() if (BT.available()) char cmd = BT.read(); switch (cmd) case 'F': left.run(FORWARD); right.run(FORWARD); break; case 'B': left.run(BACKWARD); right.run(BACKWARD); break; // Additional cases for turning and stopping
Brings the Arduino reset button to the top and provides access to all six analog pins (A0-A5) for sensor integration.
A detailed schematic PDF for the functionally equivalent Adafruit V1 shield can be referenced for troubleshooting or board modification. hw 130 motor control shield for arduino datasheet
The datasheet often fails to mention that using the servo pins (D9, D10) disables the ability to use the Servo.h library and PWM on pins D9/D10 simultaneously without conflict on some Arduino variants, though generally, they work fine for standard hobby servos. Note that D9 and D10 are also PWM pins , so you lose the ability to use them for other analogWrite functions if servos are attached.
Connect your motor power supply (4.5V–25V) to the screw terminals. Pay close attention to polarity (+ and -).
#include <AFMotor.h>
The Ultimate Guide to the HW-130 Motor Control Shield for Arduino
Pins 2 and 13 are usually free, along with the Analog pins (A0–A5), which can also be used as digital I/O for sensors. 4. How to Use the HW-130 with Arduino
The HW-130 shield uses Arduino pins for motor control while leaving other pins free for sensors. Motor Terminals (M1, M2, M3, M4) The HW-130 shield is electrically compatible with the
Understanding the HW 130 requires a detailed look at its connectors, jumpers, and hidden pins.
Located on a 2-pin terminal block. It is highly recommended to use an external supply for motors rather than the Arduino's 5V pin to avoid overheating or logic resets. Power Jumper: Jumper ON: Powers the Arduino from the motor's external power supply. Jumper OFF: Separates the logic and motor power. Remove this
Controlled via pins D3, D4, D5, D6, D7, D8, D11, and D12 . Servos: Connected to D9 (Servo 2) and D10 (Servo 1) . The datasheet often fails to mention that using
For beginners or educators, the HW-130 works with , a visual programming environment for Arduino. You can drag and drop blocks to control motors without writing code. The AFMotor library must still be included in a global “insert code” block.