

The HG7881 H-Bridge 4CH DC - 2CH Stepper Motor Driver Board, manufactured by Adafruit (Part ID: HG7881 H-Bridge 4CH DC - 2CH Stepper Motor Driver Board), is a compact and efficient motor driver board. It is designed to control up to four DC motors or two stepper motors, providing bidirectional control and speed regulation. The board is based on the HG7881 H-Bridge IC, which ensures reliable and efficient motor operation.
This motor driver board is ideal for robotics, automation, and other projects requiring precise motor control. Its small size and ease of use make it a popular choice for hobbyists and professionals alike.








The HG7881 motor driver board has the following pin layout:
| Pin Name | Description |
|---|---|
| IN1 | Control input for Motor A (Channel 1) |
| IN2 | Control input for Motor A (Channel 2) |
| IN3 | Control input for Motor B (Channel 3) |
| IN4 | Control input for Motor B (Channel 4) |
| Pin Name | Description |
|---|---|
| OUT1 | Output for Motor A (Channel 1) |
| OUT2 | Output for Motor A (Channel 2) |
| OUT3 | Output for Motor B (Channel 3) |
| OUT4 | Output for Motor B (Channel 4) |
| Pin Name | Description |
|---|---|
| VCC | Power supply input (2.5V to 12V DC) |
| GND | Ground connection |
Power the Board:
Connect Motors:
Control Logic:
Speed Control:
The following example demonstrates how to control a DC motor connected to the HG7881 motor driver board using an Arduino UNO.
// Example: Controlling a DC motor with HG7881 and Arduino UNO
// Define control pins for Motor A
const int IN1 = 9; // Connect to IN1 on the motor driver
const int IN2 = 10; // Connect to IN2 on the motor driver
void setup() {
// Set motor control pins as outputs
pinMode(IN1, OUTPUT);
pinMode(IN2, OUTPUT);
}
void loop() {
// Rotate motor forward
digitalWrite(IN1, HIGH); // Set IN1 HIGH
digitalWrite(IN2, LOW); // Set IN2 LOW
delay(2000); // Run motor for 2 seconds
// Stop motor
digitalWrite(IN1, LOW); // Set IN1 LOW
digitalWrite(IN2, LOW); // Set IN2 LOW
delay(1000); // Wait for 1 second
// Rotate motor backward
digitalWrite(IN1, LOW); // Set IN1 LOW
digitalWrite(IN2, HIGH); // Set IN2 HIGH
delay(2000); // Run motor for 2 seconds
// Stop motor
digitalWrite(IN1, LOW); // Set IN1 LOW
digitalWrite(IN2, LOW); // Set IN2 LOW
delay(1000); // Wait for 1 second
}
Motor Not Spinning:
Motor Spins in the Wrong Direction:
Motor Speed is Inconsistent:
Board Overheating:
Can I use this board to control a servo motor?
What happens if I exceed the voltage rating?
Can I control multiple motors simultaneously?
Is this board compatible with Raspberry Pi?
This concludes the documentation for the HG7881 H-Bridge 4CH DC - 2CH Stepper Motor Driver Board.