The Texas Instruments DRV8833 is a dual H-bridge motor driver capable of driving two DC motors (1.5A continuous each) or one bipolar stepper motor from a microcontroller. Unlike older drivers like the L298N, the DRV8833 uses modern MOSFETs with low Rds(on), meaning it wastes far less power as heat and operates on logic-level voltages down to 2.7V. This guide covers the exact wiring, a complete fault-handling C++ sketch, and the specific hardware traps that cause this IC to silently shut down.

DRV8833 Hardware Specs & Pin Mapping

Before wiring, you must understand the electrical boundaries of the IC. The most common failure mode on the bench is pushing the continuous current limit or misunderstanding the split power rails (VM vs. VCC). The table below details the exact datasheet specifications for the DRV8833PWPR variant used on most breakout boards.

Table 1: DRV8833 Electrical Specifications (25°C Ambient)
Parameter Min Typ Max Unit
VM (Motor Supply Voltage) 2.7 - 10.8 V
VCC (Logic Supply Voltage) 2.7 - 5.7 V
Continuous Output Current (per H-bridge) - - 1.5 A
Peak Output Current (per H-bridge, <1s) - - 2.0 A
High-Side Rds(on) (IOUT = 1.5A, VM = 8V) - 360 -
Low-Side Rds(on) (IOUT = 1.5A, VM = 8V) - 300 -
OCP Deglitch Time (Overcurrent blanking) - 3.4 - µs
VM Undervoltage Lockout (UVLO) Threshold 1.8 2.0 2.2 V

For this build, we are targeting the Arduino Uno R3 (ATmega328P) and the Pololu DRV8833 Dual Motor Driver Carrier. If you are using a generic red/blue breakout board from Amazon, the pin labels are identical, but you may need to manually solder the header pins.

Table 2: Arduino Uno R3 to DRV8833 Pin Mapping
Arduino Uno R3 Pin DRV8833 Pin Function & Notes
5V VCC Logic power (Do NOT connect to VM)
GND GND Common ground reference
D8 nSLEEP Sleep mode control (Active LOW)
D2 nFAULT Fault indicator (Active LOW, open-drain)
D5 (PWM) AIN1 Motor A Input 1
D6 (PWM) AIN2 Motor A Input 2
D9 (PWM) BIN1 Motor B Input 1
D10 (PWM) BIN2 Motor B Input 2
Battery Pack (+) VM Motor power supply (2.7V to 10.8V)

Parts List & Wiring Steps

Bench Tip: The DRV8833 has two separate positive power pins: VM (for the motors) and VCC (for the internal logic). Connecting VM to the Arduino 5V pin will starve your motors of current. Always use a dedicated battery pack for VM.

Required Components:

  • 1x Arduino Uno R3 (or Nano v3 with ATmega328P)
  • 1x Pololu DRV8833 Dual Motor Driver Carrier (Approx. $6.95) or equivalent generic breakout
  • 2x 3V-6V DC TT Gearmotors with wheels
  • 1x 4x AA Battery Holder (6V nominal) or 2S LiPo (7.4V nominal)
  • Dupont jumper wires (22 AWG stranded for motor leads, 24 AWG solid for breadboard)

Wiring Procedure:

  1. De-energize all power sources. Remove batteries and unplug the Arduino USB cable.
  2. Connect Logic Power: Wire Arduino 5V to the DRV8833 VCC pin, and Arduino GND to the DRV8833 GND pin.
  3. Connect Control Pins: Wire Arduino D5, D6, D9, and D10 to AIN1, AIN2, BIN1, and BIN2 respectively.
  4. Wire Fault & Sleep Lines: Connect Arduino D8 to nSLEEP, and Arduino D2 to nFAULT. (The nFAULT pin is open-drain; the Arduino's internal pull-up resistor will handle the HIGH state).
  5. Connect Motor Power: Wire your battery pack positive terminal to the VM pin, and the battery pack ground to a second GND pin on the DRV8833.
  6. Connect Motors: Solder or screw your motor leads to AOUT1/AOUT2 and BOUT1/BOUT2. Polarity does not matter; you can reverse it in software.

Complete Arduino Code for Dual DC Motor Control

The following sketch targets the Arduino Uno R3. It includes explicit pin definitions, PWM speed control, and a critical error-handling routine. The DRV8833 will pull the nFAULT pin LOW if it detects Overcurrent (OCP), Overtemperature (OVT), or Undervoltage Lockout (UVLO). This code monitors that pin and attempts a reset sequence.

#include <Arduino.h>

// --- Pin Definitions for Arduino Uno R3 ---
#define PIN_AIN1   5   // Motor A PWM 1
#define PIN_AIN2   6   // Motor A PWM 2
#define PIN_BIN1   9   // Motor B PWM 1
#define PIN_BIN2   10  // Motor B PWM 2
#define PIN_NFAULT 2   // Fault indicator (Active LOW, open-drain)
#define PIN_NSLEEP 8   // Sleep mode control (Active LOW)

// Motor speed limits (0-255)
const int MAX_SPEED = 220; 

void setup() {
  Serial.begin(115200);
  
  // Configure motor control pins as outputs
  pinMode(PIN_AIN1, OUTPUT);
  pinMode(PIN_AIN2, OUTPUT);
  pinMode(PIN_BIN1, OUTPUT);
  pinMode(PIN_BIN2, OUTPUT);
  
  // Configure fault and sleep pins
  pinMode(PIN_NSLEEP, OUTPUT);
  pinMode(PIN_NFAULT, INPUT_PULLUP); // Use internal pull-up for open-drain nFAULT
  
  // Wake up the DRV8833 (nSLEEP is active LOW)
  digitalWrite(PIN_NSLEEP, HIGH); 
  
  // Ensure motors are stopped on boot
  stopMotors();
  Serial.println("DRV8833 Initialized. System Ready.");
}

void loop() {
  // ERROR HANDLING: Check for hardware fault
  if (digitalRead(PIN_NFAULT) == LOW) {
    Serial.println("DRV8833 FAULT: nFAULT pin pulled LOW. Check for OCP or thermal shutdown.");
    stopMotors();
    
    // Reset sequence: Toggle nSLEEP to clear the fault latch
    digitalWrite(PIN_NSLEEP, LOW);
    delay(10);
    digitalWrite(PIN_NSLEEP, HIGH);
    
    // Wait to prevent rapid fault-looping if the motor is physically jammed
    delay(2000); 
  } 
  else {
    // Normal operation sequence
    motorAForward(MAX_SPEED);
    motorBForward(MAX_SPEED);
    delay(2000);
    
    stopMotors();
    delay(1000);
    
    motorABackward(MAX_SPEED / 2);
    motorBBackward(MAX_SPEED / 2);
    delay(2000);
    
    stopMotors();
    delay(2000);
  }
}

// --- Motor Control Functions ---

void motorAForward(int speed) {
  analogWrite(PIN_AIN1, speed);
  analogWrite(PIN_AIN2, 0);
}

void motorABackward(int speed) {
  analogWrite(PIN_AIN1, 0);
  analogWrite(PIN_AIN2, speed);
}

void motorBForward(int speed) {
  analogWrite(PIN_BIN1, speed);
  analogWrite(PIN_BIN2, 0);
}

void motorBBackward(int speed) {
  analogWrite(PIN_BIN1, 0);
  analogWrite(PIN_BIN2, speed);
}

void stopMotors() {
  analogWrite(PIN_AIN1, 0);
  analogWrite(PIN_AIN2, 0);
  analogWrite(PIN_BIN1, 0);
  analogWrite(PIN_BIN2, 0);
}

Debugging: First 3 Things to Check When It Fails

If your motors are stuttering, not spinning, or the Serial Monitor is flooded with the DRV8833 FAULT: nFAULT pin pulled LOW... error string, do not immediately assume the IC is fried. The DRV8833 has aggressive internal protection. Check these three specific hardware states first:

  1. VM Undervoltage Lockout (UVLO): The DRV8833 has a hard UVLO threshold at roughly 1.8V to 2.2V on the VM pin. If you are powering VM from a depleted 1S LiPo (which drops to ~3.0V under load) or a weak 2x AA pack, the voltage sag during motor startup will trip the UVLO. Fix: Measure VM with a multimeter while the motor is attempting to start. If it sags below 2.5V, upgrade your battery pack or add a large bulk capacitor (e.g., 470µF electrolytic) directly across the VM and GND pins.
  2. Overcurrent Protection (OCP) Tripping: The OCP deglitch time is only 3.4 µs. If your motor has a high stall current (many cheap TT gearmotors stall at 2.5A+), the initial inrush current when starting from a dead stop will instantly trip the OCP. Fix: Do not start the motor at 255 PWM. Ramp up the PWM value over 100ms in software, or physically limit the current by running the motors at a lower VM voltage.
  3. nSLEEP Pin Floating: The nSLEEP pin is active LOW. If you forget to wire it to the Arduino, or if the wire breaks, the internal pull-down resistor on the breakout board will pull it LOW, putting the IC into a low-power sleep state where the H-bridges are completely disabled. Fix: Verify with a multimeter that the nSLEEP pin is reading > 2.5V relative to GND during operation.

Extending and Simplifying the Build

Depending on your final application, you may want to strip this circuit down to its bare essentials or scale it up for more complex robotics.

How to Simplify:
If you are building a simple line-following robot and don't need serial debugging or fault resets, you can hardwire the nSLEEP pin directly to the VCC (5V) pin on the DRV8833. This permanently wakes the IC and frees up Arduino D8. You can also leave the nFAULT pin completely unconnected, removing the if (digitalRead(PIN_NFAULT) == LOW) block from the code to save flash memory and execution cycles.

How to Extend:
The DRV8833 is also a capable bipolar stepper motor driver. To extend this build to drive a small NEMA 14 or NEMA 17 stepper motor, wire the A-coil to AOUT1/AOUT2 and the B-coil to BOUT1/BOUT2. You will need to replace the analogWrite PWM functions with a digital step-sequencing array (energizing the coils in an A-B-A'-B' pattern). Note that the DRV8833 lacks the advanced microstepping decay modes of dedicated stepper drivers like the TI DRV8825, so it will run hotter and louder at high step rates, but it is perfectly adequate for slow-pan camera sliders or 3D printer extruders.