How to Use the DRV8251 Tiny Motor Driver

Introduction

This is a very small and capable H-Bridge motor driver which is great for small projects. It is only a 0.4″ (10.2mm) square, or about as big as the footprint for a DIP-8 chip. Unlike other small motor drivers, it has a supply voltage range from 4.5V to 48V, and a max current rating of 3.7A (~2.3A continuous). Because of it’s wide voltage and current range, it can be used for many brushed DC motors, solenoids, or large LED lighting loads.

Features

Here are the features of the DRV8251 H-bridge driver chip:

  • 4.5V-48V supply voltage
  • 3.7A Max, ~2.3A continuous
  • PWM control up to 200KHz
  • 1.5V-5.5V logic voltage
  • 450mΩ RDS(on)
  • Overcurrent protection
  • Thermal shutdown
  • Undervoltage lockout

The board has 2.54mm (0.1″) male headers for easy wiring, a 0.1uF capacitor, and an ESD protection diode.

Layout

The board has silkscreen markings for each of the pins on the bottom.

  • Power Ground is the common ground bus on the whole board. It is the logic ground to the motor driver chip, and also the ground to your motor power supply.
  • Motor Power is the supply pin for the motor outputs which can support 4.5V to 48V.
  • Motor Outputs are the output pins from the driver chip. These are where you should connect the two leads/wires of a brushed DC motor to. Which way you connect the leads of the motor does not matter, it will only reverse the default spinning direction.
  • Logic Inputs are the control inputs used for the motor driver. IN1 relates to OUT1 and IN2 relates to OUT2. These pins support 1.5V-5.5V, and a max frequency of 200KHz.
  • VREF is a necessary pin that you must supply 0.3V – 5V to (higher is better). This allows the driver to output a max current of 3.7A which is overcurrent and thermal protected. Just remember that the max continuous current is about 2.3A, and 3.7A can only be safely reached for short periods without extra cooling.

Usage

Start by connecting two digital output pins from a microcontroller to IN1 and IN2. You can just use HIGH or LOW outputs, but if you want PWM speed control, these pins should be PWM capable. Then connect a voltage to the REF pin as stated in the last section. This can be from a low power supply like the 5V pin on an Arduino UNO. After this, connect your high power supply 4.5V – 48V to VCC and GND, and your motor wires to O1 and O2.

The code below will spin the motor one direction at full speed for 2 seconds, spin the motor the other way at about half the speed for 2 seconds, then repeat. If you set both outputs to HIGH at the same time, you can make the motor stop quickly by making it act like a generator and have a braking effect. If you need to run the motor slower than full speed, you can use a PWM function in the Arduino IDE like analogWrite(IN1, 200);

const int IN1 = 0;
const int IN2 = 1;

void setup() {
  pinMode(IN1, OUTPUT);
  pinMode(IN2, OUTPUT);
}

void loop() {
  //turn motor one direction at full speed
  digitalWrite(IN2, LOW);
  digitalWrite(IN1, HIGH);
  delay(2000);

  //turn motor the other direction about half the speed
  analogWrite(IN2, 127);
  digitalWrite(IN1, LOW);
  delay(2000);
}

Resources


More Tutorials

  • How to Use the DRV8251 Tiny Motor Driver

    How to Use the DRV8251 Tiny Motor Driver

    This is a very small and capable H-Bridge motor driver which is great for small projects. It is only a 0.4″ (10.2mm) square, or about…

  • How to Use the DRV8251 Motor Driver

    How to Use the DRV8251 Motor Driver

    This is a simple, versatile, and powerful motor driver that can be used for almost any of your robotics projects. The board is based around…

  • How to Use the All In One ATtiny AVR Programmer

    How to Use the All In One ATtiny AVR Programmer

    This is an easy to use and versatile programmer for all sorts of AVR microcontrollers. It is great for classic ATtiny’s like the ATtiny85 and…

  • How to Use the UPDI Programmer

    How to Use the UPDI Programmer

    This UPDI programmer is great for programming the new ATtiny 0, 1 and 2 series microcontrollers. These microcontrollers are programmed with UPDI (Unified Program and…

  • How to Use the Naneato M0 Microcontroller Board

    How to Use the Naneato M0 Microcontroller Board

    Our Naneato M0 microcontroller board is one of the smallest and still practical boards out there. The entire board is only 16.5mm (0.65″) long and…

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *