The DRV8871 is a versatile H-bridge DC motor driver IC designed for driving DC motors and stepper motors. It supports bidirectional motor control, making it ideal for applications requiring forward and reverse motor operation. The DRV8871 is equipped with built-in protection features, including overcurrent protection, thermal shutdown, and undervoltage lockout, ensuring reliable operation in various environments.
Parameter | Value |
---|---|
Supply Voltage (Vcc) | 6.5V to 45V |
Output Current (Iout) | Up to 3.6A (continuous) |
Peak Current | 6A (for short durations) |
Logic Input Voltage | 0V to 5.5V |
PWM Frequency | Up to 100 kHz |
Operating Temperature | -40°C to 125°C |
Built-in Protections | Overcurrent, thermal shutdown, undervoltage lockout |
The DRV8871 is available in an 8-pin package. Below is the pinout and description:
Pin Number | Pin Name | Description |
---|---|---|
1 | IN1 | Logic input 1 for controlling motor direction and speed. |
2 | IN2 | Logic input 2 for controlling motor direction and speed. |
3 | nFAULT | Fault indicator output (active low). |
4 | GND | Ground connection. |
5 | OUT1 | Motor output terminal 1. |
6 | OUT2 | Motor output terminal 2. |
7 | Vcc | Power supply input (6.5V to 45V). |
8 | nSLEEP | Sleep mode input (active low). Pull high to enable the device. |
Below is an example of how to control a DC motor using the DRV8871 and an Arduino UNO:
// DRV8871 Motor Driver Example Code
// Controls motor direction and speed using PWM signals
#define IN1 9 // IN1 connected to Arduino pin 9
#define IN2 10 // IN2 connected to Arduino pin 10
#define nSLEEP 8 // nSLEEP connected to Arduino pin 8
void setup() {
pinMode(IN1, OUTPUT); // Set IN1 as output
pinMode(IN2, OUTPUT); // Set IN2 as output
pinMode(nSLEEP, OUTPUT); // Set nSLEEP as output
digitalWrite(nSLEEP, HIGH); // Enable the DRV8871
}
void loop() {
// Forward rotation at 50% speed
analogWrite(IN1, 128); // PWM signal (50% duty cycle)
digitalWrite(IN2, LOW); // IN2 low
delay(2000); // Run for 2 seconds
// Reverse rotation at 75% speed
digitalWrite(IN1, LOW); // IN1 low
analogWrite(IN2, 192); // PWM signal (75% duty cycle)
delay(2000); // Run for 2 seconds
// Stop the motor
digitalWrite(IN1, LOW); // IN1 low
digitalWrite(IN2, LOW); // IN2 low
delay(2000); // Stop for 2 seconds
}
Motor Not Spinning
Motor Spins in the Wrong Direction
nFAULT Pin is Low
Excessive Heat
Can the DRV8871 drive stepper motors? Yes, the DRV8871 can drive stepper motors in a unipolar or bipolar configuration. However, additional control logic is required for stepper motor operation.
What is the maximum PWM frequency supported? The DRV8871 supports PWM frequencies up to 100 kHz.
Is it necessary to use external diodes for motor protection? No, the DRV8871 has built-in flyback diodes for motor protection.
Can I use the DRV8871 with a 3.3V microcontroller? Yes, the logic inputs are compatible with 3.3V and 5V systems.