# Adafruit DRV8871 Brushed DC Motor Driver Breakout

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/033/651/medium800/adafruit_products_3190_iso_ORIG.jpg?1467826217)

Crank up your robotics with powerful&nbsp; **Adafruit DRV8871** motor driver breakout board. This motor driver has a lot of great specs that make it useful for a wide variety of mechatronics. In particular, the simple resistor-set current limiting and auto-magic PWM support make it super easy to use with almost any brushed DC motor.

![](https://cdn-learn.adafruit.com/assets/assets/000/033/653/medium800/adafruit_products_3190_top_ORIG.jpg?1467826527)

Check out the specs for the DRV8871:

- 6.5V to 45V motor power voltage
- Up to 5.5V logic level on IN pins
- 565mΩ Typical RDS(on) (high + low)
- 3.6A peak current
- PWM control
- Current limiting/regulation without an inline sense resistor
- Undervoltage lockout
- Overcurrent protection
- Thermal shutdown

![](https://cdn-learn.adafruit.com/assets/assets/000/033/652/medium800/adafruit_products_3190_top_demo_ORIG.jpg?1467826450)

Using it is super simple. Connect your motor to the **OUT** terminal block. Power the board with 6.5-45VDC power on **VMotor** and provide the H-bridge input control on **IN1** and **IN2**. You can even PWM the inputs and the driver chip will do the right thing.

![](https://cdn-learn.adafruit.com/assets/assets/000/033/655/medium800/adafruit_products_3190_quarter_ORIG.jpg?1467826631)

You can set the current limiting with an external resistor **Rlim**. We solder in a 30K resistor by default for a ~2A current limit, however you can remove this resistor and/or solder a resistor over it to change the resistance and change the limit.

![](https://cdn-learn.adafruit.com/assets/assets/000/033/656/medium800/adafruit_products_3190_kit_ORIG.jpg?1467826789)

Each order comes with one fully assembled and tested motor driver breakout, two 2-pin terminal blocks and a small strip of header. Some light soldering is required to attach the header and terminal blocks but its a simple task that can be done with basic soldering equipment.

# Adafruit DRV8871 Brushed DC Motor Driver Breakout

## Pinouts

![](https://cdn-learn.adafruit.com/assets/assets/000/033/659/medium800/adafruit_products_pinout.jpg?1467827336)

# Motor power pins
![](https://cdn-learn.adafruit.com/assets/assets/000/033/660/medium800/adafruit_products_motorpower.jpg?1467827343)

These two sets of pads are connected internally so you can use breadboard or terminal blocks to provide motor power. Use 6.5V-45VDC to power the motor and the chip. This isn't the same as the logic level of the chip, which is up to 5.5 VDC. You do not have to provide a logic level power supply to the chip, how nice is that?

To power small, low-voltage motors, you can connect the VM pin to an Arduino VIN or 5v pin.&nbsp; For motors requiring higher voltages or more current, use an external supply connected to the POWER terminals.

Danger: If using an external supply, do not connect VM to the Arduino.  This will send the external supply voltage into the Arduino, likely causing damage to the Arduino.

# Motor Input Pins
![](https://cdn-learn.adafruit.com/assets/assets/000/033/661/medium800/adafruit_products_inputs.jpg?1467827463)

These are the inputs to the motor control. IN2 goes to OUT2, IN1 goes to OUT1. Use up to 5.5V DC logic on these pins. You can PWM the inputs up to 200KHz, but lower frequencies will be more efficient.

# Motor Output
![](https://cdn-learn.adafruit.com/assets/assets/000/033/662/medium800/adafruit_products_motorout.jpg?1467827642)

Pretty simple - this is where your motor goes! Works with any DC brushed motor. Use thick wires to avoid dropping voltage across the wire resistance

# Adafruit DRV8871 Brushed DC Motor Driver Breakout

## Assembly

![](https://cdn-learn.adafruit.com/assets/assets/000/033/718/medium800/adafruit_products_3190-01.jpg?1468255258)

## Prepare the header strip and Add the breakout board:

&nbsp;

Cut the strip to length if necessary. It will be easier to solder if you insert it into a breadboard - **long pins down**

&nbsp;

Place the breakout board over the pins so that the short pins poke through the breakout pads

![adafruit_products_1-header.jpg](https://cdn-learn.adafruit.com/assets/assets/000/033/751/medium640/adafruit_products_1-header.jpg?1468417946)

![adafruit_products_2-onbreadboard.jpg](https://cdn-learn.adafruit.com/assets/assets/000/033/776/medium640/adafruit_products_2-onbreadboard.jpg?1468426910)

## Solder!

&nbsp;

Be sure to solder all pins for reliable electrical contact.  
  
  
_(For tips on soldering, be sure to check out our&nbsp;_[_Guide to Excellent Soldering_](http://learn.adafruit.com/adafruit-guide-excellent-soldering)_)._

![adafruit_products_3-solder-1.jpg](https://cdn-learn.adafruit.com/assets/assets/000/033/781/medium640/adafruit_products_3-solder-1.jpg?1468427016)

![adafruit_products_3-solder-2.jpg](https://cdn-learn.adafruit.com/assets/assets/000/033/782/medium640/adafruit_products_3-solder-2.jpg?1468427066)

![adafruit_products_3-solder-3.jpg](https://cdn-learn.adafruit.com/assets/assets/000/033/783/medium640/adafruit_products_3-solder-3.jpg?1468427093)

![adafruit_products_3-solder-4.jpg](https://cdn-learn.adafruit.com/assets/assets/000/033/784/medium640/adafruit_products_3-solder-4.jpg?1468427117)

Next we will solder in the two 3.5mm terminal blocks used to connect power & the motor to the breakout board.&nbsp;

&nbsp;

**Make sure the open parts of the terminals face outwards** so you can easily connect wires

&nbsp;

To make it easier to keep these in place, you can use some tape to hold down the two header pieces. Tacky clay also works, whatever you've got handy!

&nbsp;

![adafruit_products_4-terminalplacement.jpg](https://cdn-learn.adafruit.com/assets/assets/000/033/785/medium640/adafruit_products_4-terminalplacement.jpg?1468427168)

![adafruit_products_4-terminalplacement-2.jpg](https://cdn-learn.adafruit.com/assets/assets/000/033/786/medium640/adafruit_products_4-terminalplacement-2.jpg?1468427185)

Solder in both pins of each&nbsp;terminal block. You can remove the tape when done.

![adafruit_products_5-soldering-1.jpg](https://cdn-learn.adafruit.com/assets/assets/000/033/787/medium640/adafruit_products_5-soldering-1.jpg?1468427208)

![adafruit_products_5-soldering-2.jpg](https://cdn-learn.adafruit.com/assets/assets/000/033/788/medium640/adafruit_products_5-soldering-2.jpg?1468427233)

![adafruit_products_5-soldering-3.jpg](https://cdn-learn.adafruit.com/assets/assets/000/033/789/medium640/adafruit_products_5-soldering-3.jpg?1468427252)

![adafruit_products_5-soldering-4.jpg](https://cdn-learn.adafruit.com/assets/assets/000/033/791/medium640/adafruit_products_5-soldering-4.jpg?1468427323)

OK You're done!&nbsp;Now you can get your motors spinnin' !&nbsp;

![adafruit_products_6-finished.jpg](https://cdn-learn.adafruit.com/assets/assets/000/033/792/medium640/adafruit_products_6-finished.jpg?1468427362)

# Adafruit DRV8871 Brushed DC Motor Driver Breakout

## Usage

Using the motor driver is really easy. Wire up the two input pins to your microcontroller's PWM outputs. We'll be using an Arduino but any microcontroller or microcomputer can be used. If you don't have PWM outputs you can also just use straight logic high and low but you wont get speed control

![](https://cdn-learn.adafruit.com/assets/assets/000/033/663/medium800/adafruit_products_3190_top_demo_ORIG.jpg?1467829880)

```auto
// Basic sketch for trying out the Adafruit DRV8871 Breakout

#define MOTOR_IN1 9
#define MOTOR_IN2 10

void setup() {
  Serial.begin(9600);

  Serial.println("DRV8871 test");
  
  pinMode(MOTOR_IN1, OUTPUT);
  pinMode(MOTOR_IN2, OUTPUT);
}

void loop() {

  // ramp up forward
  digitalWrite(MOTOR_IN1, LOW);
  for (int i=0; i<255; i++) {
    analogWrite(MOTOR_IN2, i);
    delay(10);
  }

  // forward full speed for one second
  delay(1000);
  
  // ramp down forward
  for (int i=255; i>=0; i--) {
    analogWrite(MOTOR_IN2, i);
    delay(10);
  }

  // ramp up backward
  digitalWrite(MOTOR_IN2, LOW);
  for (int i=0; i<255; i++) {
    analogWrite(MOTOR_IN1, i);
    delay(10);
  }

  // backward full speed for one second
  delay(1000);

  // ramp down backward
  for (int i=255; i>=0; i--) {
    analogWrite(MOTOR_IN1, i);
    delay(10);
  }
}
```

Info: The motor power voltage must be 6.5V to 45V.  If you are powering your Arduino with &gt; 6.5v, you can use VIN as shown in the diagram below.  Otherwise, you will need to use a separate power supply.

If using a separate supply for the motor, connect to the + &amp; - "Power" screw terminals and do not connect VIN from the Arduino.

![](https://cdn-learn.adafruit.com/assets/assets/000/033/664/medium800/adafruit_products_drv8871_bb.png?1467830204)

# Adafruit DRV8871 Brushed DC Motor Driver Breakout

## Download

# Datasheets & Files

- [DRV8871 Datasheet](https://cdn-shop.adafruit.com/product-files/3190/drv8871.pdf)
- [EagleCAD PCB Files on GitHub](https://github.com/adafruit/Adafruit-DRV8871-Breakout-PCB)
- [Fritzing object in our library](https://github.com/adafruit/Fritzing-Library)
- [3D Model on GitHub](https://github.com/adafruit/Adafruit_CAD_Parts/tree/main/3190%20DRV8871%20Breakout)

# Schematic
![](https://cdn-learn.adafruit.com/assets/assets/000/033/665/medium800/adafruit_products_schem.png?1467833194)

# Fabrication Print

Dimensions in Inches

![](https://cdn-learn.adafruit.com/assets/assets/000/033/666/medium800/adafruit_products_fapbirnt.png?1467833220)

# 3D Model
![](https://cdn-learn.adafruit.com/assets/assets/000/133/121/medium800/adafruit_products_3190_DRV8871_Breakout.jpg?1729004841)


## Related Guides

- [Robotic Creatures ](https://learn.adafruit.com/robotic-creatures.md)
- [Automatic Dice Roller](https://learn.adafruit.com/automatic-dice-roller.md)
- [Make It Bubble](https://learn.adafruit.com/make-it-bubble.md)
- [Improve the Low Speed of Brushed DC Motors](https://learn.adafruit.com/improve-low-speed-performance-of-brushed-dc-motors.md)
- [Introducing Adafruit Crickit #MakeRobotFriend](https://learn.adafruit.com/adafruit-crickit-creative-robotic-interactive-construction-kit.md)
- [Improve Brushed DC Motor Performance](https://learn.adafruit.com/improve-brushed-dc-motor-performance.md)
- [Desktop Dumpster Fire](https://learn.adafruit.com/desktop-dumpster-fire.md)
- [Using micro:bit and CRICKIT with MicroPython](https://learn.adafruit.com/using-micro-bit-and-crickit-with-micropython.md)
- [Crickit Paddle Wheel Boat](https://learn.adafruit.com/crickit-boat.md)
- [Make it Move with Crickit](https://learn.adafruit.com/make-it-move-with-crickit.md)
- [LEGO-Compatible Servo Mounts](https://learn.adafruit.com/lego-servo-mounts.md)
- [Adafruit MOSFET Driver](https://learn.adafruit.com/adafruit-mosfet-driver.md)
- [CRICKIT Snake Bot](https://learn.adafruit.com/crickit-snake-bot.md)
- [Adafruit ItsyBitsy nRF52840 Express](https://learn.adafruit.com/adafruit-itsybitsy-nrf52840-express.md)
- [Introducing the Adafruit Bluefruit LE Friend](https://learn.adafruit.com/introducing-adafruit-ble-bluetooth-low-energy-friend.md)
