![]() |
The L298N chip loses ~1.5V to 2V under load. If you feed it 6V, your motor sees only ~4.5V. For full performance, use 9V or 12V batteries.
Here is a complete code example to drive two DC motors forward, stop, reverse, and stop.
// HW-130 Motor Shield Pin Definitions
#define ENA 9 // Speed Motor A
#define IN1 4 // Direction Motor A
#define IN2 5 // Direction Motor A
#define ENB 10 // Speed Motor B
#define IN3 6 // Direction Motor B
#define IN4 7 // Direction Motor B
void setup()
// Set all control pins to outputs
pinMode(ENA, OUTPUT);
pinMode(IN1, OUTPUT);
pinMode(IN2, OUTPUT);
pinMode(ENB, OUTPUT);
pinMode(IN3, OUTPUT);
pinMode(IN4, OUTPUT);
void loop()
// --- Move Forward (Half Speed) ---
digitalWrite(IN1, HIGH);
digitalWrite(IN2, LOW);
analogWrite(ENA, 150); // Speed (0-255)
digitalWrite(IN3, HIGH);
digitalWrite(IN4, LOW);
analogWrite(ENB, 150);
delay(2000); // Run for 2 seconds
// --- Stop ---
digitalWrite(IN1, LOW);
digitalWrite(IN2, LOW);
delay(1000);
// --- Move Reverse (Full Speed) ---
digitalWrite(IN1, LOW);
digitalWrite(IN2, HIGH);
analogWrite(ENA, 255);
digitalWrite(IN3, LOW);
digitalWrite(IN4, HIGH);
analogWrite(ENB, 255);
delay(2000);
// --- Stop ---
digitalWrite(IN1, LOW);
digitalWrite(IN2, LOW);
digitalWrite(IN3, LOW);
digitalWrite(IN4, LOW);
delay(1000);
Introduction The HW-130 motor control shield is a compact, Arduino-compatible motor driver board that targets hobbyists and makers building small robots, RC vehicles, and automation projects. This post provides a clearer, more usable “datasheet-style” overview plus practical tips, wiring diagrams, Arduino code basics, and troubleshooting to help you get the most from the HW-130.
Key features (at-a-glance)
Pinout and electrical connections
Electrical characteristics (practical values) hw 130 motor control shield for arduino datasheet better
Typical wiring diagrams
Arduino example sketch (concept)
Basic code snippet
const int dir1 = 7;
const int pwm1 = 6;
void setup()
pinMode(dir1, OUTPUT);
pinMode(pwm1, OUTPUT);
digitalWrite(dir1, LOW);
void loop()
// forward
digitalWrite(dir1, HIGH);
analogWrite(pwm1, 200); // ~78% speed
delay(1500);
// stop
analogWrite(pwm1, 0);
delay(300);
// reverse
digitalWrite(dir1, LOW);
analogWrite(pwm1, 200);
delay(1500);
Thermal and power management
Safety, protection, and best practices
Troubleshooting checklist
When to choose a different driver
Summary The HW-130 is a handy, low-cost motor shield suitable for small robots and light DC motors when used within its thermal and current limits. Key to reliable operation: use proper power wiring, cooling, decoupling capacitors, and respect continuous current limits. If you need, I can produce (pick one):
Which deliverable would you like?
(If helpful: related search suggestions loaded.) The L298N chip loses ~1
| Parameter | Value | |-----------|-------| | Driver IC | L293D (x1) | | Logic voltage | 5V (from Arduino) | | Motor supply voltage (VS) | 4.5V – 12V (external) | | Max continuous current per channel | 600 mA | | Peak current | 1.2 A (per channel) | | PWM frequency | ~490 Hz (Arduino default) | | Onboard flyback diodes | Yes (internal to L293D) |
The shield has a terminal block (usually green screw terminals) labeled PWR.
| Feature | HW-130 | Adafruit L293D | SparkFun L293D | |---------|--------|----------------|----------------| | Enable pins accessible | Sometimes (jumpers) | Yes | Yes | | Flyback diode quality | Internal (weak) | External + internal | External | | Voltage regulator for servos | None | 5V/1A | None | | Documentation | Poor | Excellent | Good | | Price | $3–5 | $20–25 | $15–20 |
Verdict: HW-130 is usable for light robotics projects (e.g., small robot car with 3–6V motors, no stall). It is not suitable for high-torque or geared motors that stall frequently.