# Adafruit TB6612 1.2A DC/Stepper Motor Driver Breakout Board

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/024/263/medium800/adafruit_products_2448_iso_ORIG.jpg?1427923448)

Fire four solenoids, spin two DC motors or step one bi-polar or uni-polar stepper with 1.2A per channel using the TB6612. These are perhaps better known as "[the drivers in our assembled Adafruit Motorshield](https://www.adafruit.com/products/1438) or [Motor HAT](https://www.adafruit.com/product/2348)" We really like these dual H-bridges, so if you want to control motors without a shield or HAT these are easy to include on any solderless breadboard or perma-proto.

![](https://cdn-learn.adafruit.com/assets/assets/000/024/270/medium800thumb/adafruit_products_2448_spinning_smallGIF.jpg?1448317377)

We solder on TB6612 onto a breakout board for you here, with a polarity protection FET on the motor voltage input and a pullup on the "standby" enable pin. Each breakout chip contains two full H-bridges (four half H-bridges). That means you can drive four solenoids, two DC motors bi-directionally, or one stepper motor. Just make sure they're good for 1.2 Amp or less of current, since that's the limit of this chip. They do handle a peak of 3A but that's just for a short amount of time, about 20 milliseconds. What we like most about this particular driver is that it comes with built in kick-back diodes internally so you dont have to worry about the inductive kick damaging your project or driver!

![](https://cdn-learn.adafruit.com/assets/assets/000/024/264/medium800/adafruit_products_2448_quarter_ORIG.jpg?1427923471)

There's two digital inputs per H-bridge (one for each half of the bridge) as well as a PWM input per driver so you can control motor speed. Runs at 2.7V-5V logic.&nbsp;The motor voltage is separate from the logic voltage. Good for motor voltages from 4.5V up to 13.5V! This wont work well for 3V motors.

![](https://cdn-learn.adafruit.com/assets/assets/000/024/265/medium800/adafruit_products_2448_kit_ORIG.jpg?1427923486)

Comes as one assembled and tested breakout plus a small strip of header. You'll need to do some light soldering to attach the header onto the breakout PCB. Arduino, motors, and power supply not included.

# Adafruit TB6612 1.2A DC/Stepper Motor Driver Breakout Board

## Pinouts

![](https://cdn-learn.adafruit.com/assets/assets/000/024/262/medium800/adafruit_products_2448_kit_ORIG.jpg?1427923394)

[This motor driver is a fairly simple breakout of the TB6612 motor chip, so do check out the datasheet for the TB6612 for any details you need about pin voltage limits, capacitance, etc!](http://www.adafruit.com/datasheets/TB6612FNG_datasheet_en_20121101.pdf)

# Power Pins

- **Vmotor** - This is the voltage for the motors, not for the logic level. Keep this voltage between 4.5V and 13.5V. This power supply will get noisy so if you have a system with analog readings or RF other noise-sensitive parts, you may need to keep the power supplies seperate (or filtered!)
- **Vcc** - this is the voltage for the logic levels. Set to the voltage logic you'll be using on your microcontroller. E.g. for Arduinos, 5V is probably what you want. Can be 2.7V to 5.5V so good for 3V or 5V logic
- **GND** - This is the shared logic and motor ground. All grounds are connected

# Signal in Pins

These are all 'Vcc logic level' inputs

- **INA1, INA2** - these are the two inputs to the Motor A H-bridges
- **PWMA** - this is the PWM input for the Motor A H-bridges, if you dont need PWM control, connect this to logic high.
- **INB1, INB2** - these are the two inputs to the Motor B H-bridges
- **PWMB** - this is the PWM input for the Motor B H-bridges, if you dont need PWM control, connect this to logic high.
- **STBY** - this is the standby pin for quickly disabling both motors, pulled up to Vcc thru a 10K resistor. Connect to ground to disable.

# Motor Out Pins

These are 'Vmotor level' power outputs

- **Motor A** - these are the two outputs for motor A, controlled by INA1, INA2 and PWMA
- **Motor B** - these are the two outputs for motor B, controlled by INB1, INB2 and PWMB

# Adafruit TB6612 1.2A DC/Stepper Motor Driver Breakout Board

## Assembly

![](https://cdn-learn.adafruit.com/assets/assets/000/024/271/medium800/adafruit_products_2448-01.jpg?1427929396)

## Prepare the header strip:

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

![adafruit_products_headers.jpg](https://cdn-learn.adafruit.com/assets/assets/000/024/272/medium640/adafruit_products_headers.jpg?1427929670)

## Add the breakout board:

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

![adafruit_products_place.jpg](https://cdn-learn.adafruit.com/assets/assets/000/024/273/medium640/adafruit_products_place.jpg?1427929679)

## And Solder!

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

![adafruit_products_solder1.jpg](https://cdn-learn.adafruit.com/assets/assets/000/024/274/medium640/adafruit_products_solder1.jpg?1427929690)

![adafruit_products_solder2.jpg](https://cdn-learn.adafruit.com/assets/assets/000/024/275/medium640/adafruit_products_solder2.jpg?1427929698)

![adafruit_products_solder3.jpg](https://cdn-learn.adafruit.com/assets/assets/000/024/276/medium640/adafruit_products_solder3.jpg?1427929704)

![adafruit_products_solder5.jpg](https://cdn-learn.adafruit.com/assets/assets/000/024/277/medium640/adafruit_products_solder5.jpg?1427929715)

# Adafruit TB6612 1.2A DC/Stepper Motor Driver Breakout Board

## Arduino Use: Stepper Motors

In this example we'll wire up and use a bi-polar stepper motor with recommended 12V motor voltage, and 200 steps per rotation.

![](https://cdn-learn.adafruit.com/assets/assets/000/024/261/medium800/adafruit_products_324-03.jpg?1427922712)

# Wiring

We'll wire it to a Metro, but you can use any microcontroller you like!

Connect:

- **Vmotor** to 12V (red wire)
- **Vcc** to 5V (orange wire)
- **GND** to ground
- **AIN2** to Digital 4
- **AIN1** to Digital 5
- **BIN1** to Digital 6
- **BIN2** to Digital 7
- **PWMA** and **PWMB** to Vcc (orange wire)

Then hook one stepper motor coil to **Motor A** (red and yellow) and the second coil to **Motor B** (green and gray/brown). If you have another motor, you'll need to experiment a little to figure out which wires are which coil. Check any documentation you have! You can use a multimeter to measure between wires, the ones with a small resistance between them are a pair to a coil, for example. If the motor is vibrating but not spinning, check all wires are connected and try flipping around a pair or rechecking the wire pairs.

If you have a unipolar motor, there will be a 5th or 6th wire that is the 'common' wire. Connect these wires to the GND pins in between the Motor A and B outputs on the breakout.

![](https://cdn-learn.adafruit.com/assets/assets/000/031/945/medium800/adafruit_products_2448_top_demo_revised_ORIG.jpg?1461615823)

# Software

[We'll use the built-in Arduino Stepper library](http://arduino.cc/en/Reference/Stepper), but you can manually toggle the AIN1/AIN2/BIN1/BIN2 pins with your own favorite microcontroller setup

```
#include &lt;Stepper.h&gt;

// change this to the number of steps on your motor
#define STEPS 200

// create an instance of the stepper class, specifying
// the number of steps of the motor and the pins it's
// attached to
Stepper stepper(STEPS, 4, 5, 6, 7);


void setup()
{
  Serial.begin(9600);
  Serial.println("Stepper test!");
  // set the speed of the motor to 30 RPMs
  stepper.setSpeed(60);
}

void loop()
{
  Serial.println("Forward");
  stepper.step(STEPS);
  Serial.println("Backward");
  stepper.step(-STEPS);
}
```

Basically after you make the **Stepper** object with the 4 control pins, you can set the rotational speed (in RPM) with **setSpeed(_rpm_)** and then step forward or backwards with **.step(_steps_)** where _steps_ is positive for 'forward' and negative for 'backward'

[For more details, check out the Stepper library](http://arduino.cc/en/Reference/Stepper)

# Adafruit TB6612 1.2A DC/Stepper Motor Driver Breakout Board

## Python & CircuitPython: Stepper Motors

It's easy to use the DRV8833 DC/Stepper Motor Driver or the TB6612 DC/Stepper Motor Driver breakouts with CircuitPython and Python using the [Adafruit CircuitPython Motor](https://github.com/adafruit/Adafruit_CircuitPython_Motor) library to control stepper motors. We'll show you how to wire them up and use the library to control a stepper motor. The code is the same for both breakouts, however the pinouts on each breakout are slightly different.

You can use this breakout with any CircuitPython microcontroller board or with a computer that has GPIO and Python [thanks to Adafruit\_Blinka, our CircuitPython-for-Python compatibility library](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux).

# CircuitPython Microcontroller Wiring

You can use any CircuitPython microcontroller board, but bear in mind that motors require external power to run. The Metro M0 and M4 have a convenient pin available for providing sufficient power, so this example will use the Metro M4.

Warning: 

We're using [this stepper motor](https://www.adafruit.com/product/324) with [this 9V power supply](https://www.adafruit.com/product/63). With the Metro board, the 9V power supply will power both the Metro and the stepper motor.

Connect a Metro M4, the DRV8833 breakout and a stepper motor as follows:

- **Board VM** to **Metro VIN**
- **Board GND** to **Metro GND**
- **Board SLP** to **Metro 5V**
- **Board AIN1** to **Metro D9**
- **Board AIN2** to **Metro D10**
- **Board BIN1** to **Metro D11**
- **Board BIN2** to **Metro D12**
- **Board AOUT (1 and 2)** to **stepper coil (red and yellow stepper wires)**
- **Board BOUT (1 and 2)** to **stepper coil (green and grey stepper wires)**
- **9V power supply** to **barrel jack on Metro**

![adafruit_products_DRV8833_Metro_stepper_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/094/465/medium640/adafruit_products_DRV8833_Metro_stepper_bb.jpg?1598649381)

For use with the TB6612, connect the Metro M4, breakout and stepper motor as follows:

- **Board VM** to **Metro VIN**
- **Board VCC** to **breadboard power rail**
- **Board GND** to **Metro GND**
- **Board PWMB** to **breadboard power rail**
- **Board BIN2** to **Metro D12**
- **Board BIN1** to **Metro D11**
- **Board AIN1** to **Metro D9**
- **Board AIN2** to **Metro D10**
- **Board PWMA** to **breadboard power rail**
- **Breadboard power rail** to **Metro 5V**
- **Board MOTORA (two pins)** to **stepper coil (red and yellow stepper wires)**
- **Board MOTORB (two pins)** to **stepper coil (green and grey stepper wires)**
- **9V power supply** to **barrel jack on Metro**

![adafruit_products_TB6612_Metro_stepper_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/094/485/medium640/adafruit_products_TB6612_Metro_stepper_bb.jpg?1598909609)

# Python Computer Wiring

Since there's _dozens_ of Linux computers/boards you can use we will show wiring for Raspberry Pi. For other platforms, [please visit the guide for CircuitPython on Linux to see whether your platform is supported](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux).&nbsp;

Warning: 

We're using [this stepper motor](https://www.adafruit.com/product/324), and powering the driver board with [this 9V power supply](https://www.adafruit.com/product/63). With the Raspberry Pi, you'll need a separate 5V power supply for the Pi (on USB as normal).

Here's the Raspberry Pi, breakout and stepper motor wired up to the DRV8833:

- **Board VM** to **positive terminal on barrel jack**  
- **Board GND** to **negative terminal on barrel jack**  
- **Barrel jack** to **9V power supply**
- **Board GND** to **Pi GND**
- **Board SLP** to **Pi 3.3V**
- **Board AIN1** to **Pi D19**
- **Board AIN2** to **Pi D26**
- **Board BIN1** to **Pi D20**
- **Board BIN2** to **Pi D21**
- **Board AOUT (1 and 2)** to **stepper coil (red and yellow stepper wires)**
- **Board BOUT (1 and 2)** to **stepper coil (green and grey stepper wires)**

![adafruit_products_DRV8833_RasPi_stepper_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/094/466/medium640/adafruit_products_DRV8833_RasPi_stepper_bb.jpg?1598650062)

And, the Raspberry Pi, breakout and stepper motor wired up to the TB6612:

- **Board VM** to **positive terminal on barrel jack**  
- **Board GND** to **negative terminal on barrel jack**  
- **Barrel jack** to **9V power supply**
- **Board VCC** to **breadboard power rail**
- **Board GND** to **Pi GND**
- **Board PWMB** to **breadboard power rail**
- **Board BIN2** to **Pi D21**  
- **Board BIN1** to **Pi D20**  
- **Board AIN1** to **Pi D19**  
- **Board AIN2** to **Pi D26**  
- **Board PWMA** to **breadboard power rail**
- **Breadboard power rail** to **Pi 3.3V**  
- **Board MOTORA (two pins)** to **stepper coil (red and yellow stepper wires)**
- **Board MOTORB (two pins)** to **stepper coil (green and grey stepper wires)**

![adafruit_products_TB6612_RasPi_stepper_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/094/486/medium640/adafruit_products_TB6612_RasPi_stepper_bb.jpg?1598910142)

# CircuitPython Installation of Motor Library

Next you'll need to install the&nbsp;[Adafruit CircuitPython Motor](https://github.com/adafruit/Adafruit_CircuitPython_Motor)&nbsp;library on your CircuitPython board.&nbsp;&nbsp;

First make sure you are running the&nbsp;[latest version of Adafruit CircuitPython](https://circuitpython.org/downloads)&nbsp;for your board.

Next you'll need to install the necessary library to use the hardware--carefully follow the steps to find and install the library from [Adafruit's CircuitPython library bundle](https://circuitpython.org/libraries).&nbsp; Our introduction guide has&nbsp;[a great page on how to install modules from the library bundle](https://learn.adafruit.com/welcome-to-circuitpython/circuitpython-libraries).

You'll need to manually install the necessary library from the bundle:

- **adafruit\_motor**

Before continuing make sure your board's lib folder or root filesystem has the&nbsp; **adafruit\_motor** folder copied over.

![adafruit_products_DRV8833_lib_folder_CIRCUITPY.png](https://cdn-learn.adafruit.com/assets/assets/000/094/464/medium640/adafruit_products_DRV8833_lib_folder_CIRCUITPY.png?1598643220)

# Python Installation of Motor Library

You'll need to install the Adafruit\_Blinka library that provides the CircuitPython support in Python. This may also require enabling I2C on your platform and verifying you are running Python 3. [Since each platform is a little different, and Linux changes often, please visit the CircuitPython on Linux guide to get your computer ready](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux)!

Once that's done, from your command line run the following command:

- `pip3 install adafruit-circuitpython-motor`

If your default Python is version 3 you may need to run 'pip' instead. Just make sure you aren't trying to use CircuitPython on Python 2.x, it isn't supported!

# CircuitPython & Python Usage

To demonstrate the usage of the DRV8833 and the TB6612, we'll use a complete code example to control a stepper motor. Code is the same for both boards.

Save the following code to your **CIRCUITPY** drive as **code.py** :

https://github.com/adafruit/Adafruit_CircuitPython_Motor/blob/main/examples/motor_stepper_digitalio.py

Once saved, watch your stepper motor move!

Let's take a look at the code. First, import the necessary libraries. Set the `DELAY` in seconds for the time between each motor control statement, and the number of `STEPS` used in each control block.

Next, set up the pins used by the driver board. If you followed the diagrams above, these will already be correct. If you did not, change these to match the pins you used. If you're using CircuitPython on a microcontroller, no changes are necessary. If you're using a Raspberry Pi with Adafruit Blinka, then you need to comment out the microcontroller pins, and uncomment the Raspberry Pi pins.

Then, set all the pins to `OUTPUT`, and instantiate `motor` with each of the four coils.

Now you can begin controlling the motor using the many options available in the Adafruit CircuitPython Motor library. You can [check out the documentation](https://circuitpython.readthedocs.io/projects/motor/en/latest/api.html#adafruit-motor-stepper) for details.

That's all there is to controlling a stepper motor with a DRV8833 or the TB6612!

# Adafruit TB6612 1.2A DC/Stepper Motor Driver Breakout Board

## Python Docs

# Adafruit TB6612 1.2A DC/Stepper Motor Driver Breakout Board

## Downloads

# Files

- [This motor driver is a fairly simple breakout of the TB6612 motor chip, so do check out the datasheet for the TB6612 for any details you need about pin voltage limits, capacitance, etc!](http://www.adafruit.com/datasheets/TB6612FNG_datasheet_en_20121101.pdf)
- [Fritzing object in the Adafruit Fritzing Library](https://github.com/adafruit/Fritzing-Library)
- [EagleCAD PCB files](https://github.com/adafruit/Adafruit-TB6612-Motor-Driver-Breakout-PCB)

# Schematic
![](https://cdn-learn.adafruit.com/assets/assets/000/024/267/medium800/adafruit_products_schem.png?1427923937)

# Fabrication print

Dimensions in inches

![](https://cdn-learn.adafruit.com/assets/assets/000/024/266/medium800/adafruit_products_motorfabprint.png?1427923687)


## Featured Products

### Adafruit TB6612 1.2A DC/Stepper Motor Driver Breakout Board

[Adafruit TB6612 1.2A DC/Stepper Motor Driver Breakout Board](https://www.adafruit.com/product/2448)
Spin two DC motors, step one bi-polar or uni-polar stepper, or fire off two solenoids with 1.2A per channel using the TB6612. These are perhaps better known as "[the drivers in our assembled Adafruit Motorshield](https://www.adafruit.com/products/1438)&nbsp;or&nbsp;<a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/2448)
[Related Guides to the Product](https://learn.adafruit.com/products/2448/guides)
### Stepper motor - NEMA-17 size - 200 steps/rev, 12V 350mA

[Stepper motor - NEMA-17 size - 200 steps/rev, 12V 350mA](https://www.adafruit.com/product/324)
A stepper motor to satisfy all your robotics needs! This 4-wire bipolar stepper has 1.8° per step for smooth motion and a nice holding torque. The motor was specified to have a max current of 350mA so that it could be driven easily with an <a...></a...>

Out of Stock
[Buy Now](https://www.adafruit.com/product/324)
[Related Guides to the Product](https://learn.adafruit.com/products/324/guides)
### Small Reduction Stepper Motor - 5VDC 32-Step 1/16 Gearing

[Small Reduction Stepper Motor - 5VDC 32-Step 1/16 Gearing](https://www.adafruit.com/product/858)
This is a great first stepper motor, good for small projects and experimenting with steppers. This uni-polar motor has a built-in mounting plate with two mounting holes. There are only 32 steps (11.25 degree) per revolution, and inside is a 1/16&nbsp;reduction gear set. (Actually it's...

In Stock
[Buy Now](https://www.adafruit.com/product/858)
[Related Guides to the Product](https://learn.adafruit.com/products/858/guides)
### Small Reduction Stepper Motor - 12VDC 32-Step 1/16 Gearing

[Small Reduction Stepper Motor - 12VDC 32-Step 1/16 Gearing](https://www.adafruit.com/product/918)
This is a great first stepper motor, good for small projects and experimenting with steppers. This uni-polar motor has a built in mounting plate with two mounting holes. There are only 32 step (11.25 degree) per revolution, and inside is a 1/16&nbsp;reduction gear set. (Actually its 1/16.128...

In Stock
[Buy Now](https://www.adafruit.com/product/918)
[Related Guides to the Product](https://learn.adafruit.com/products/918/guides)
### DC Toy / Hobby Motor - 130 Size

[DC Toy / Hobby Motor - 130 Size](https://www.adafruit.com/product/711)
These are standard '130 size' DC hobby motors. They come with a wider operating range than most toy motors: from 4.5 to 9VDC instead of 1.5-4.5V. This range makes them perfect for controlling with an Adafruit Motor Shield, or with an Arduino where you are more likely to have 5 or 9V...

Out of Stock
[Buy Now](https://www.adafruit.com/product/711)
[Related Guides to the Product](https://learn.adafruit.com/products/711/guides)

## Related Guides

- [Open Sesame! A SMS-controlled door lock](https://learn.adafruit.com/open-sesame-a-sms-controlled-door-lock.md)
- [Improve the Low Speed of Brushed DC Motors](https://learn.adafruit.com/improve-low-speed-performance-of-brushed-dc-motors.md)
- [Improve Brushed DC Motor Performance](https://learn.adafruit.com/improve-brushed-dc-motor-performance.md)
- [Adafruit QT Py CH32V203](https://learn.adafruit.com/adafruit-qt-py-ch32v203.md)
- [Glowing Hair Flowers with n00ds](https://learn.adafruit.com/glowing-hair-flowers-with-n00ds.md)
- [Dune Worm Thumper](https://learn.adafruit.com/dune-worm-thumper.md)
- [ Adafruit DRV8833 DC/Stepper Motor Driver Breakout Board](https://learn.adafruit.com/adafruit-drv8833-dc-stepper-motor-driver-breakout-board.md)
- [Cam Follower Automaton](https://learn.adafruit.com/cam-follower-automaton.md)
- [Adafruit Monochrome 1.12" 128x128 OLED Graphic Display](https://learn.adafruit.com/adafruit-monochrome-1-12-in-128x128-oled.md)
- [Adafruit NeoPot](https://learn.adafruit.com/adafruit-neopot.md)
- [Esenciales para CircuitPython](https://learn.adafruit.com/esenciales-para-circuitpython.md)
- [Introducing the Adafruit Grand Central M4 Express](https://learn.adafruit.com/adafruit-grand-central.md)
- [Bringing Characters to Life](https://learn.adafruit.com/bringing-characters-to-life.md)
- [Adafruit Metro Mini](https://learn.adafruit.com/adafruit-metro-mini.md)
- [Adafruit Feather RP2350 with HSTX](https://learn.adafruit.com/adafruit-feather-rp2350.md)
