The DRV8838 is a single brushed DC motor driver designed to provide efficient and reliable control of a single brushed DC motor. It features a compact design, making it ideal for space-constrained applications. The DRV8838 supports adjustable speed and direction control, and it includes built-in protection mechanisms such as overcurrent protection, thermal shutdown, and undervoltage lockout. This makes it a robust choice for motor control in a variety of applications.
The DRV8838 comes in an 8-pin WSON package. Below is the pinout and description:
Pin | Name | Type | Description |
---|---|---|---|
1 | IN1 | Input | Logic input to control motor direction and speed (PWM capable). |
2 | IN2 | Input | Logic input to control motor direction and speed (PWM capable). |
3 | nSLEEP | Input | Active-low sleep mode input. Pull high to enable the driver. |
4 | GND | Ground | Ground connection for the device. |
5 | OUT2 | Output | Motor output terminal 2. |
6 | VM | Power Supply | Motor power supply input (0 V to 11 V). |
7 | OUT1 | Output | Motor output terminal 1. |
8 | nFAULT | Output (Open-Drain) | Fault indicator. Pulled low during fault conditions (e.g., overcurrent). |
Below is an example of how to control a motor using the DRV8838 with an Arduino UNO:
// Define pin connections
const int IN1 = 9; // PWM pin for motor control
const int IN2 = 10; // Direction control pin
const int nSLEEP = 8; // Sleep mode pin
void setup() {
// Set pin modes
pinMode(IN1, OUTPUT);
pinMode(IN2, OUTPUT);
pinMode(nSLEEP, OUTPUT);
// Enable the motor driver
digitalWrite(nSLEEP, HIGH);
}
void loop() {
// Rotate motor in one direction at 50% speed
analogWrite(IN1, 128); // 50% duty cycle (0-255 scale)
digitalWrite(IN2, LOW);
delay(2000); // Run for 2 seconds
// Rotate motor in the opposite direction at 75% speed
analogWrite(IN1, 0); // Stop IN1
analogWrite(IN2, 192); // 75% duty cycle
delay(2000); // Run for 2 seconds
// Brake the motor
digitalWrite(IN1, LOW);
digitalWrite(IN2, LOW);
delay(2000); // Brake for 2 seconds
}
Motor Does Not Spin:
nFAULT Pin Pulled Low:
Motor Spins in the Wrong Direction:
Driver Overheats:
Can I use the DRV8838 with a 3.3 V microcontroller? Yes, the DRV8838 supports logic voltage levels as low as 1.8 V, making it compatible with 3.3 V systems.
What happens if both IN1 and IN2 are high? The motor will enter a high-impedance state (coast mode), and it will not actively brake.
Is the DRV8838 suitable for battery-powered applications? Yes, its low operating voltage and sleep mode make it ideal for battery-powered systems.
Can I control the speed of the motor? Yes, you can use a PWM signal on the IN1 or IN2 pin to adjust the motor speed.